chiark / gitweb /
Fix a build failure on x32 (time_t printfs).
authorAdam Borowski <kilobyte@angband.pl>
Mon, 9 Mar 2015 06:58:10 +0000 (07:58 +0100)
committerSimon Tatham <anakin@pobox.com>
Mon, 9 Mar 2015 18:03:20 +0000 (18:03 +0000)
As that architecture has 64-bit time_t but only 32-bit longs, printf format
causes a warning.  Enter -Werror...

magnets.c
signpost.c

index 815f016126641b38ab3ceb3eae5473f8585e9f6d..5437c61443979be0eddc0d3be38b27676c69a6c7 100644 (file)
--- a/magnets.c
+++ b/magnets.c
@@ -2562,7 +2562,7 @@ int main(int argc, const char *argv[])
         goto done;
     }
     s = new_game(NULL, p, desc);
-    printf("%s:%s (seed %ld)\n", id, desc, seed);
+    printf("%s:%s (seed %ld)\n", id, desc, (long)seed);
     if (aux) {
         /* We just generated this ourself. */
         if (verbose || print) {
index e89a7c6c62b733cc7c9641f9bf9c7b560671073f..5650b2b67309a7c6f31afdba9de6e912eb7e8c16 100644 (file)
@@ -2393,7 +2393,7 @@ int main(int argc, const char *argv[])
         }
     }
 
-    sprintf(newseed, "%lu", time(NULL));
+    sprintf(newseed, "%lu", (unsigned long) time(NULL));
     seedstr = dupstr(newseed);
 
     if (id || !stdin_desc) {