ithewei há 6 anos atrás
pai
commit
cf10deba6f
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 1 1
      base/htime.c
  2. 1 1
      base/htime.h

+ 1 - 1
base/htime.c

@@ -28,7 +28,7 @@ unsigned long long gethrtime() {
     if (s_freq != 0) {
         LARGE_INTEGER count;
         QueryPerformanceCounter(&count);
-        return count.QuadPart / (double)s_freq * 1000000;
+        return (unsigned long long)(count.QuadPart / (double)s_freq * 1000000);
     }
     return 0;
 #elif HAVE_CLOCK_GETTIME

+ 1 - 1
base/htime.h

@@ -57,7 +57,7 @@ static inline int gettimeofday(struct timeval *tv, struct timezone *tz) {
     _ftime(&tb);
 
     if (tv) {
-        tv->tv_sec =  tb.time;
+        tv->tv_sec =  (long)tb.time;
         tv->tv_usec = tb.millitm * 1000;
     }