tdb: 64-bit fixes.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 20 Oct 2010 02:28:20 +0000 (12:58 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 20 Oct 2010 02:28:20 +0000 (12:58 +1030)
ccan/tdb/summary.c
ccan/tdb/tdb_private.h
ccan/tdb/test/logging.c

index a8f2b71bf1ff1ae4f741cc6179dd018e1afb178a..3404a4144f8e78df40bb3e2c6e05c98463183f8b 100644 (file)
@@ -19,7 +19,7 @@
 #include <ccan/tally/tally.h>
 
 #define SUMMARY_FORMAT \
-       "Size of file/data: %zu/%zu\n" \
+       "Size of file/data: %u/%zu\n" \
        "Number of records: %zu\n" \
        "Smallest/average/largest keys: %zu/%zu/%zu\n%s" \
        "Smallest/average/largest data: %zu/%zu/%zu\n%s" \
index 1fdf2c6a6e8e86dce987c88f9bee689d25591cca..7482c84f725bcc4ad79fc312dfee82dbb11ffd74 100644 (file)
@@ -72,7 +72,7 @@ typedef uint32_t tdb_len_t;
 typedef uint32_t tdb_off_t;
 
 #ifndef offsetof
-#define offsetof(t,f) ((unsigned int)&((t *)0)->f)
+#define offsetof(t,f) ((size_t)&((t *)0)->f)
 #endif
 
 #define TDB_MAGIC_FOOD "TDB file\n"
index fa413f63c1e3b55b2ce589d753a3dd5d4d4a9cc6..ae598a9845b60488bb7165dfb66c4fd93fa3a55c 100644 (file)
@@ -25,7 +25,7 @@ static void taplog(struct tdb_context *tdb,
 
        /* Strip trailing \n: diag adds it. */
        if (line[0] && line[strlen(line)-1] == '\n')
-               diag("%s%.*s", log_prefix, strlen(line)-1, line);
+               diag("%s%.*s", log_prefix, (unsigned)strlen(line)-1, line);
        else
                diag("%s%s", log_prefix, line);
 }