]> sourceware.org Git - lvm2.git/commitdiff
size_t tidying
authorAlasdair Kergon <agk@redhat.com>
Wed, 2 Apr 2003 19:11:23 +0000 (19:11 +0000)
committerAlasdair Kergon <agk@redhat.com>
Wed, 2 Apr 2003 19:11:23 +0000 (19:11 +0000)
lib/datastruct/lvm-types.h
lib/display/display.c
lib/mm/pool-debug.c
lib/mm/pool-fast.c

index 006916f8c009ddd7c9056220faa6d4d2ac1a53c7..e9c15e44665d6498842fabd39ad07a5db9622d33 100644 (file)
 #include <inttypes.h>
 
 /* Define some portable printing types */
-#if (SIZE_MAX == UINT64_MAX)
-#define PRIsize_t PRIu64
-#elif (SIZE_MAX == UINT32_MAX)
-#define PRIsize_t PRIu32
-#endif
+#define PRIsize_t "Zu"
 
 struct str_list {
        struct list list;
index 7c78fc0d6fa2f60cd98afde835489289882d53a5..c860a32f98557fcbadc63011668249200a9fb36b 100644 (file)
@@ -166,7 +166,7 @@ const char *display_size(struct cmd_context *cmd, uint64_t size, size_len_t sl)
 {
        int s;
        int suffix = 1;
-       uint64_t byte;
+       uint64_t byte = UINT64_C(0);
        uint64_t units = UINT64_C(1024);
        char *size_buf = NULL;
        const char *size_str[][3] = {
index 1263d65337a9ed277c539c2da7fe2649dfcf5bf4..ecb92e63c87dcf494c513ae67d0107624132a6a6 100644 (file)
@@ -29,7 +29,7 @@ struct pool *pool_create(size_t chunk_hint)
        struct pool *mem = dbg_malloc(sizeof(*mem));
 
        if (!mem) {
-               log_error("Couldn't create memory pool (size %u)",
+               log_error("Couldn't create memory pool (size %" PRIsize_t ")",
                          sizeof(*mem));
                return NULL;
        }
index a8825054d250df881cad5f22671abf718aff1c03..423d60a7805a823bab39fbb5c4bb48dc1e23b49c 100644 (file)
@@ -33,7 +33,7 @@ struct pool *pool_create(size_t chunk_hint)
        struct pool *p = dbg_malloc(sizeof(*p));
 
        if (!p) {
-               log_error("Couldn't create memory pool (size %" PRIuPTR ")",
+               log_error("Couldn't create memory pool (size %" PRIsize_t ")",
                          sizeof(*p));
                return 0;
        }
@@ -221,8 +221,8 @@ struct chunk *_new_chunk(struct pool *p, size_t s)
                p->spare_chunk = 0;
        } else {
                if (!(c = dbg_malloc(s))) {
-                       log_err("Out of memory.  Requested %" PRIuPTR " bytes.",
-                               s);
+                       log_err("Out of memory.  Requested %" PRIsize_t
+                               " bytes.", s);
                        return NULL;
                }
 
This page took 0.035341 seconds and 5 git commands to generate.