From: Martin Schwenke Date: Mon, 16 Apr 2018 08:32:07 +0000 (+1000) Subject: ctdb: Fix some -Werror=strict-overflow issues X-Git-Tag: ldb-1.4.0~527 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7dbf83369705bf2fe7c4d6b79ddf794ea8adb5db;p=thirdparty%2Fsamba.git ctdb: Fix some -Werror=strict-overflow issues All quite obvious. For the LCP2 one, we're not actually counting so use a bool instead of an int. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c index 2a10b07b508..7495eb3a674 100644 --- a/ctdb/server/ctdb_recovery_helper.c +++ b/ctdb/server/ctdb_recovery_helper.c @@ -1068,7 +1068,7 @@ static struct tevent_req *push_database_send( struct tevent_req *req, *subreq; struct push_database_state *state; uint32_t *old_list, *new_list; - int old_count, new_count; + unsigned int old_count, new_count; int i; req = tevent_req_create(mem_ctx, &state, struct push_database_state); @@ -2359,7 +2359,8 @@ static void recovery_active_done(struct tevent_req *subreq) struct ctdb_req_control request; struct ctdb_vnn_map *vnnmap; int *err_list; - int ret, count, i; + int ret, i; + unsigned int count; bool status; status = ctdb_client_control_multi_recv(subreq, &ret, NULL, &err_list, diff --git a/ctdb/server/ipalloc_lcp2.c b/ctdb/server/ipalloc_lcp2.c index a57000feaff..565b58c9a0c 100644 --- a/ctdb/server/ipalloc_lcp2.c +++ b/ctdb/server/ipalloc_lcp2.c @@ -477,7 +477,8 @@ bool ipalloc_lcp2(struct ipalloc_state *ipalloc_state) { uint32_t *lcp2_imbalances; bool *rebalance_candidates; - int numnodes, num_rebalance_candidates, i; + int numnodes, i; + bool have_rebalance_candidates; bool ret = true; unassign_unsuitable_ips(ipalloc_state); @@ -500,13 +501,14 @@ bool ipalloc_lcp2(struct ipalloc_state *ipalloc_state) * continuing on... */ numnodes = ipalloc_state->num; - num_rebalance_candidates = 0; + have_rebalance_candidates = false; for (i=0; i