1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Switch to developer version numbering

Also clean up code while there.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2008-09-21 09:16:50 +01:00
parent 29b01b6d82
commit e5cc6f6b85
2 changed files with 13 additions and 18 deletions

View file

@ -69,25 +69,20 @@ void dbg_print_hit_rate() {
/// the constant EngineVersion (defined in misc.h) is empty.
const std::string engine_name() {
if(EngineVersion == "") {
static const char monthNames[12][4] = {
"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
};
const char *dateString = __DATE__;
if (EngineVersion.empty())
{
std::string date(__DATE__); // From compiler, format is "Sep 21 2008"
std::string months("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec");
size_t mon = 1 + months.find(date.substr(0, 3)) / 4;
std::stringstream s;
int month = 0, day = 0;
for(int i = 0; i < 12; i++)
if(strncmp(dateString, monthNames[i], 3) == 0)
month = i + 1;
day = atoi(dateString+4);
s << "Glaurung " << (dateString+9) << std::setfill('0') << std::setw(2)
<< month << std::setfill('0') << std::setw(2) << day;
s << "Glaurung " << date.substr(date.length() - 2) << std::setfill('0')
<< std::setw(2) << mon << date.substr(4, 2);
return s.str();
}
else
} else
return "Glaurung " + EngineVersion;
}

View file

@ -36,7 +36,7 @@
/// Version number. If this is left empty, the current date (in the format
/// YYMMDD) is used as a version number.
const std::string EngineVersion = "2.1";
const std::string EngineVersion = "";
////