1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

size_t tidying

This commit is contained in:
Alasdair Kergon 2003-04-02 19:11:23 +00:00
parent 12428fceee
commit 34e0f798e3
4 changed files with 6 additions and 10 deletions

View File

@ -13,11 +13,7 @@
#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;

View 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] = {

View 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;
}

View 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;
}