X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.h;h=62f26fdb8eed64cce76f733c8a15fa58ff0b2b51;hb=cecf7a56ed5a5efd939b21c760c69da616306005;hp=e7f597765c09beec930e33b24220d89364e57abb;hpb=e1fc548ff893f35d24565b381eca454ba6319ef4;p=novacoin.git diff --git a/src/util.h b/src/util.h index e7f5977..62f26fd 100644 --- a/src/util.h +++ b/src/util.h @@ -37,6 +37,7 @@ static const int32_t nOneHour = 60 * 60; static const int32_t nOneDay = 24 * 60 * 60; +static const int64_t nOneWeek = 7 * 24 * 60 * 60; static const int64_t COIN = 1000000; static const int64_t CENT = 10000; @@ -61,6 +62,18 @@ static const int64_t CENT = 10000; void LogStackTrace(); #endif +#if defined(_MSC_VER) || defined(__MSVCRT__) + /* Silence compiler warnings on Windows + related to MinGWs inttypes.h */ + #undef PRIu64 + #undef PRId64 + #undef PRIx64 + + #define PRIu64 "I64u" + #define PRId64 "I64d" + #define PRIx64 "I64x" + +#endif /* Format characters for (s)size_t and ptrdiff_t */ #if defined(_MSC_VER) || defined(__MSVCRT__) @@ -370,7 +383,7 @@ inline int64_t GetPerformanceCounter() inline int64_t GetTimeMillis() { - return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) - + return (boost::posix_time::microsec_clock::universal_time() - boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds(); } @@ -510,7 +523,7 @@ public: T median() const { - int size = vSorted.size(); + size_t size = vSorted.size(); assert(size>0); if(size & 1) // Odd number of elements {