evil: fix warnings.
authorChunEon Park <hermet@hermet.pe.kr>
Thu, 20 Aug 2015 06:33:06 +0000 (15:33 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Thu, 20 Aug 2015 06:33:06 +0000 (15:33 +0900)
correct data size for 32/64 compatibility.

src/lib/evil/evil_time.c

index 6964654..1c06ecb 100644 (file)
@@ -310,7 +310,11 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
               continue;
 
 #ifndef TIME_MAX
-# define TIME_MAX      INT64_MAX
+# if INTPTR_MAX == 0xffffffffffffffff
+#  define TIME_MAX INT64_MAX
+# else
+#  define TIME_MAX INT32_MAX
+# endif
 #endif
            case 's':   /* seconds since the epoch */
              {
@@ -331,7 +335,7 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
                   } while ((sse * 10 <= TIME_MAX) &&
                            rulim && *bp >= '0' && *bp <= '9');
 
-                if (sse < 0 || (__int64)sse > TIME_MAX)
+                if (sse < 0 || sse > TIME_MAX)
                   {
                      bp = NULL;
                      continue;