diff options
author | Haru <haru@dotalux.com> | 2016-09-15 15:29:16 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-10-07 01:10:28 +0200 |
commit | c5780deadbda31d4a76e7f4ded866d769c2a1151 (patch) | |
tree | 42a3c979fa9f96ddfe014f485115dffc4e9883d3 /src/common | |
parent | 953feee90e47d75449151834707a165f9ce57fda (diff) | |
download | hercules-c5780deadbda31d4a76e7f4ded866d769c2a1151.tar.gz hercules-c5780deadbda31d4a76e7f4ded866d769c2a1151.tar.bz2 hercules-c5780deadbda31d4a76e7f4ded866d769c2a1151.tar.xz hercules-c5780deadbda31d4a76e7f4ded866d769c2a1151.zip |
Fixed some issues detected by clang's static analyzer (Xcode 8/macOS Sierra)
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/HPM.c | 2 | ||||
-rw-r--r-- | src/common/socket.c | 4 | ||||
-rw-r--r-- | src/common/timer.c | 4 |
3 files changed, 1 insertions, 9 deletions
diff --git a/src/common/HPM.c b/src/common/HPM.c index c34828010..ff1371b14 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -898,7 +898,7 @@ bool hplugins_parse_conf(const struct config_t *config, const char *filename, en for (i = 0; i < VECTOR_LENGTH(HPM->config_listeners[point]); i++) { const struct HPConfListenStorage *entry = &VECTOR_INDEX(HPM->config_listeners[point], i); const char *config_name = entry->key; - const char *str = buf; + const char *str = NULL; if ((setting = libconfig->lookup(config, config_name)) == NULL) { if (!imported && entry->required) { ShowWarning("Missing configuration '%s' in file %s!\n", config_name, filename); diff --git a/src/common/socket.c b/src/common/socket.c index 5f284587a..d4b8bb43f 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -1023,10 +1023,6 @@ int do_sockets(int next) } } -#ifdef __clang_analyzer__ - // Let Clang's static analyzer know this never happens (it thinks it might because of a NULL check in session_is_valid) - if (!sockt->session[i]) continue; -#endif // __clang_analyzer__ sockt->session[i]->func_parse(i); if(!sockt->session[i]) diff --git a/src/common/timer.c b/src/common/timer.c index 0b28f6a06..f820ebe12 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -258,10 +258,6 @@ int64 timer_gettick(void) { /// Adds a timer to the timer_heap static void push_timer_heap(int tid) { BHEAP_ENSURE(timer_heap, 1, 256); -#ifdef __clang_analyzer__ // Clang's static analyzer warns that BHEAP_ENSURE might set BHEAP_DATA(timer_heap) to NULL. -#include "assert.h" - assert(BHEAP_DATA(timer_heap) != NULL); -#endif // __clang_analyzer__ BHEAP_PUSH(timer_heap, tid, DIFFTICK_MINTOPCMP, swap); } |