summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-10-11 16:22:31 +0200
committerHaru <haru@dotalux.com>2015-10-11 16:22:31 +0200
commit5fe850132ae05bbf9b4b166f035b672093cc7774 (patch)
tree41ec952ff8dda13dff2c7aebec137bf56d8e312b /src/common
parent497510b22278aafaa7dedb8a6c705e8cdd35e9db (diff)
downloadhercules-5fe850132ae05bbf9b4b166f035b672093cc7774.tar.gz
hercules-5fe850132ae05bbf9b4b166f035b672093cc7774.tar.bz2
hercules-5fe850132ae05bbf9b4b166f035b672093cc7774.tar.xz
hercules-5fe850132ae05bbf9b4b166f035b672093cc7774.zip
Fixed various compiler warnings (follow-up to 5c22b63)
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/HPM.c4
-rw-r--r--src/common/db.h2
-rw-r--r--src/common/socket.c2
3 files changed, 4 insertions, 4 deletions
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;
}