Ensure version number->string conversion is consistent

This commit is contained in:
Jeff Garzik
2011-04-15 03:58:28 -04:00
committed by Jeff Garzik
parent b37f09aa2e
commit a584320357
4 changed files with 33 additions and 11 deletions

9
util.h
View File

@@ -184,6 +184,7 @@ uint64 GetRand(uint64 nMax);
int64 GetTime();
int64 GetAdjustedTime();
void AddTimeData(unsigned int ip, int64 nTime);
string FormatFullVersion();
@@ -431,14 +432,6 @@ inline bool GetBoolArg(const string& strArg)
return false;
}
inline string FormatVersion(int nVersion)
{
if (nVersion%100 == 0)
return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
else
return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
}