From 5fe850132ae05bbf9b4b166f035b672093cc7774 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 11 Oct 2015 16:22:31 +0200 Subject: Fixed various compiler warnings (follow-up to 5c22b63) Signed-off-by: Haru --- src/common/HPM.c | 4 ++-- src/common/db.h | 2 +- src/common/socket.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/common/HPM.c b/src/common/HPM.c index 578e90bbc..5373c8b6a 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -655,7 +655,7 @@ void hplugins_config_read(void) { libconfig->destroy(&plugins_conf); if (VECTOR_LENGTH(HPM->plugins)) - ShowStatus("HPM: There are '"CL_WHITE"%"PRIuS""CL_RESET"' plugins loaded, type '"CL_WHITE"plugins"CL_RESET"' to list them\n", VECTOR_LENGTH(HPM->plugins)); + ShowStatus("HPM: There are '"CL_WHITE"%d"CL_RESET"' plugins loaded, type '"CL_WHITE"plugins"CL_RESET"' to list them\n", VECTOR_LENGTH(HPM->plugins)); } /** @@ -674,7 +674,7 @@ CPCMD(plugins) return; } - ShowInfo("HPC: There are '"CL_WHITE"%"PRIuS""CL_RESET"' plugins loaded\n", VECTOR_LENGTH(HPM->plugins)); + ShowInfo("HPC: There are '"CL_WHITE"%d"CL_RESET"' plugins loaded\n", VECTOR_LENGTH(HPM->plugins)); for(i = 0; i < VECTOR_LENGTH(HPM->plugins); i++) { struct hplugin *plugin = VECTOR_INDEX(HPM->plugins, i); diff --git a/src/common/db.h b/src/common/db.h index afec62d86..1df306038 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -1175,7 +1175,7 @@ HPShared struct db_interface *DB; /* reduce size */ \ VECTOR_DATA(_vec) = aRealloc(VECTOR_DATA(_vec), (_n)*sizeof(VECTOR_FIRST(_vec))); /* reallocate */ \ VECTOR_CAPACITY(_vec) = (_n); /* update capacity */ \ - if (VECTOR_LENGTH(_vec) > (_n)) \ + if ((_n) - VECTOR_LENGTH(_vec) > 0) \ VECTOR_LENGTH(_vec) = (_n); /* update length */ \ } \ } while(false) diff --git a/src/common/socket.c b/src/common/socket.c index f1318ab47..b4b67da40 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -1523,7 +1523,7 @@ void send_shortlist_add_fd(int fd) return;// already in the list if (send_shortlist_count >= ARRAYLENGTH(send_shortlist_array)) { - ShowDebug("send_shortlist_add_fd: shortlist is full, ignoring... (fd=%d shortlist.count=%d shortlist.length=%"PRIuS")\n", + ShowDebug("send_shortlist_add_fd: shortlist is full, ignoring... (fd=%d shortlist.count=%d shortlist.length=%d)\n", fd, send_shortlist_count, ARRAYLENGTH(send_shortlist_array)); return; } -- cgit v1.2.3-70-g09d2