summaryrefslogtreecommitdiff
path: root/ctdb/server
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-08-01 10:55:39 +1000
committerAmitay Isaacs <amitay@samba.org>2019-08-14 09:11:36 +0000
commit4bdfbbd8d4fb681d509d702a8a357b11c8dddcac (patch)
tree7818d3f8ed936709384fb146e0a83237fd86282d /ctdb/server
parent5a3d99dc7ad49717252d8c9625e0f8d064cffcd8 (diff)
downloadsamba-4bdfbbd8d4fb681d509d702a8a357b11c8dddcac.tar.gz
ctdb-daemon: Avoid signed/unsigned comparison by declaring as unsigned
Compiling with -Wsign-compare complains: ctdb/server/ctdb_call.c:831:12: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 831 | if (count <= ctdb_db->statistics.hot_keys[0].count) { | ^~ and ctdb/server/ctdb_call.c:844:13: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 844 | if (count <= ctdb_db->statistics.hot_keys[i].count) { | ^~ Found by cs-build. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/server')
-rw-r--r--ctdb/server/ctdb_call.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c
index 346fe89010e..876ae448cca 100644
--- a/ctdb/server/ctdb_call.c
+++ b/ctdb/server/ctdb_call.c
@@ -822,7 +822,7 @@ ctdb_defer_pinned_down_request(struct ctdb_context *ctdb, struct ctdb_db_context
static void
ctdb_update_db_stat_hot_keys(struct ctdb_db_context *ctdb_db, TDB_DATA key,
- int count)
+ unsigned int count)
{
int i, id;
char *keystr;
@@ -1983,7 +1983,7 @@ static void ctdb_migration_count_handler(TDB_DATA key, uint64_t counter,
{
struct ctdb_db_context *ctdb_db = talloc_get_type_abort(
private_data, struct ctdb_db_context);
- int value;
+ unsigned int value;
value = (counter < INT_MAX ? counter : INT_MAX);
ctdb_update_db_stat_hot_keys(ctdb_db, key, value);