aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-05-19 09:17:27 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-05-19 09:17:27 -0400
commit93f9023b46c1c33c59e978acd305dfd015bc0df3 (patch)
tree6a332440b8a9c8e2e1c048361ccabe13a8f79efd
parent4fc6e06465a03c295e70d11eb0864dbed906550d (diff)
downloadrneovim-93f9023b46c1c33c59e978acd305dfd015bc0df3.tar.gz
rneovim-93f9023b46c1c33c59e978acd305dfd015bc0df3.tar.bz2
rneovim-93f9023b46c1c33c59e978acd305dfd015bc0df3.zip
Merge klib upstream.
Silence -Wstrict-prototypes and static analyser warnings Using "(void)" provides an explicit there-are-no-arguments prototype. Using the exact type in "malloc(...sizeof)" is clearer and silences warnings from clang's static analyzer. (John Marshall)
-rw-r--r--src/nvim/lib/klist.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/lib/klist.h b/src/nvim/lib/klist.h
index 65f87ed5e3..07fd872e1a 100644
--- a/src/nvim/lib/klist.h
+++ b/src/nvim/lib/klist.h
@@ -37,7 +37,7 @@
size_t cnt, n, max; \
kmptype_t **buf; \
} kmp_##name##_t; \
- static inline kmp_##name##_t *kmp_init_##name() { \
+ static inline kmp_##name##_t *kmp_init_##name(void) { \
return xcalloc(1, sizeof(kmp_##name##_t)); \
} \
static inline void kmp_destroy_##name(kmp_##name##_t *mp) { \
@@ -56,7 +56,7 @@
--mp->cnt; \
if (mp->n == mp->max) { \
mp->max = mp->max? mp->max<<1 : 16; \
- mp->buf = xrealloc(mp->buf, sizeof(void*) * mp->max); \
+ mp->buf = xrealloc(mp->buf, sizeof(kmptype_t *) * mp->max); \
} \
mp->buf[mp->n++] = p; \
}
@@ -79,7 +79,7 @@
kmp_##name##_t *mp; \
size_t size; \
} kl_##name##_t; \
- static inline kl_##name##_t *kl_init_##name() { \
+ static inline kl_##name##_t *kl_init_##name(void) { \
kl_##name##_t *kl = xcalloc(1, sizeof(kl_##name##_t)); \
kl->mp = kmp_init(name); \
kl->head = kl->tail = kmp_alloc(name, kl->mp); \