It's a c++: use string.clear()
[novacoin.git] / src / util.h
index 3ef7331..62f26fd 100644 (file)
@@ -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__)
@@ -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
         {