From 2639be18b575ad454b53085541c1595b555f01c2 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov <kostja@tarantool.org> Date: Sat, 12 Oct 2013 12:33:31 +0400 Subject: [PATCH] Silent a few compiler warnings. --- client/tarantar/indexate.c | 2 +- src/box/index.cc | 1 + src/box/tuple.cc | 2 +- src/lua/init.cc | 2 +- src/salloc.cc | 1 + third_party/lua-yaml/lyaml.c | 3 ++- 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/tarantar/indexate.c b/client/tarantar/indexate.c index 0899cd8d66..33ea08ad64 100644 --- a/client/tarantar/indexate.c +++ b/client/tarantar/indexate.c @@ -359,7 +359,7 @@ xlog_process(struct ts_spaces *s, char *wal_dir, uint64_t file_lsn, static int waldir_processof(struct ts_spaces *s, struct tnt_dir *wal_dir, int i) { - int rc; + int rc = 0; if (i < wal_dir->count) { rc = xlog_process(s, wal_dir->path, wal_dir->files[i].lsn, tss.last_snap_lsn, &tss.last_xlog_lsn); diff --git a/src/box/index.cc b/src/box/index.cc index 05c79c9089..25c6c6cbef 100644 --- a/src/box/index.cc +++ b/src/box/index.cc @@ -120,6 +120,7 @@ Index::factory(struct key_def *key_def) return new BitsetIndex(key_def); default: assert(false); + return NULL; /* silent compiler warning. */ } } diff --git a/src/box/tuple.cc b/src/box/tuple.cc index f3471fd4ba..c18e66b7ec 100644 --- a/src/box/tuple.cc +++ b/src/box/tuple.cc @@ -499,7 +499,7 @@ tuple_new(struct tuple_format *format, uint32_t field_count, char *base64_buf = (char *) malloc(base64_buflen); int len = base64_encode(end - tuple_len, tuple_len, base64_buf, base64_buflen); - write(STDERR_FILENO, base64_buf, len); + (void) write(STDERR_FILENO, base64_buf, len); free(base64_buf); tnt_raise(IllegalParams, "tuple_new(): incorrect tuple format"); } diff --git a/src/lua/init.cc b/src/lua/init.cc index 03aa12b44a..f7f71fdf63 100644 --- a/src/lua/init.cc +++ b/src/lua/init.cc @@ -467,7 +467,7 @@ tarantool_plugin_dir(struct lua_State *L, const char *dir) if (dent->d_type != DT_REG) continue; char *path; - asprintf(&path, "%s/%s", dir, dent->d_name); + (void) asprintf(&path, "%s/%s", dir, dent->d_name); if (!path) { say_error("Can't allocate memory for %s plugin dir", dir); diff --git a/src/salloc.cc b/src/salloc.cc index 4a15de7392..d37e60aa0d 100644 --- a/src/salloc.cc +++ b/src/salloc.cc @@ -340,6 +340,7 @@ sfree_delayed(void *ptr) return; struct slab_item *item = (struct slab_item *)ptr; struct slab *slab = slab_header(item); + (void) slab; assert(valid_item(slab, item)); SLIST_INSERT_HEAD(&free_delayed, item, next); arena.delayed_free_count++; diff --git a/third_party/lua-yaml/lyaml.c b/third_party/lua-yaml/lyaml.c index 51b2c8d041..04c80d6222 100644 --- a/third_party/lua-yaml/lyaml.c +++ b/third_party/lua-yaml/lyaml.c @@ -407,8 +407,9 @@ static int dump_node(struct lua_yaml_dumper *dumper); 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ -static int is_utf8(const unsigned char *str, size_t len) +static int is_utf8(const char *data, size_t len) { + const unsigned char *str = (const unsigned char *) data; size_t i = 0; size_t continuation_bytes = 0; -- GitLab