diff --git a/include/tbuf.h b/include/tbuf.h index 791373fe6a38d07eff46c0d489c1cf860c6da379..12beb423393e5b38a87d9ee2616204ae53a3dfb7 100644 --- a/include/tbuf.h +++ b/include/tbuf.h @@ -40,9 +40,9 @@ extern "C" { struct tbuf { /* Used space in the buffer. */ - uint32_t size; + size_t size; /* Total allocated buffer capacity. */ - uint32_t capacity; + size_t capacity; /* Allocated buffer. */ char *data; struct palloc_pool *pool; diff --git a/src/admin.cc b/src/admin.cc index 9670a9250b8bd6a49a330899fde18a51156dc4d0..f6b5caf6523c0fb886c1970d703d4fb8b48691d7 100644 --- a/src/admin.cc +++ b/src/admin.cc @@ -171,7 +171,7 @@ static void fail(struct tbuf *out, struct tbuf *err) { start(out); - tbuf_printf(out, "fail:%.*s" CRLF, err->size, (char *)err->data); + tbuf_printf(out, "fail:%.*s" CRLF, (uint32_t)err->size, (char *)err->data); end(out); } diff --git a/src/tarantool.cc b/src/tarantool.cc index ea433395cc447a23a838f00b8a30152abf9d4ac2..3f9e029a9251dd10770d795e1b5a0c62d5043ca9 100644 --- a/src/tarantool.cc +++ b/src/tarantool.cc @@ -786,7 +786,7 @@ main(int argc, char **argv) if (gopt(opt, 'k')) { if (fill_default_tarantool_cfg(&cfg) != 0 || load_cfg(&cfg, 0) != 0) { say_error("check_config FAILED" - "%.*s", cfg_out->size, (char *)cfg_out->data); + "%.*s", (uint32_t)cfg_out->size, (char *)cfg_out->data); return 1; } @@ -796,7 +796,7 @@ main(int argc, char **argv) if (fill_default_tarantool_cfg(&cfg) != 0 || load_cfg(&cfg, 0) != 0) panic("can't load config:" - "%.*s", cfg_out->size, (char *)cfg_out->data); + "%.*s", (uint32_t)cfg_out->size, (char *)cfg_out->data); if (gopt_arg(opt, 'g', &cfg_paramname)) { tarantool_cfg_iterator_t *i; diff --git a/src/tbuf.c b/src/tbuf.c index 74631d9f99805c2cf79c4a92c7c77a5823b6cc1e..638fad4d51e3a6e2a135a30b96bcce69fdcf2e31 100644 --- a/src/tbuf.c +++ b/src/tbuf.c @@ -75,7 +75,7 @@ tbuf_ensure_resize(struct tbuf *e, size_t required) tbuf_assert(e); /* Make new capacity a multiple of alloc factor. */ - size_t new_capacity = MAX(e->capacity, (uint32_t)TBUF_ALLOC_FACTOR) * 2; + size_t new_capacity = MAX(e->capacity, (size_t)TBUF_ALLOC_FACTOR) * 2; while (new_capacity < e->size + required) new_capacity *= 2;