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

View file

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