diff options
author | Martin Schwenke <martin@meltin.net> | 2019-05-25 22:04:10 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2019-06-05 10:25:50 +0000 |
commit | 90622ab901a2738c827d79c002123f758fb966b7 (patch) | |
tree | 6f53adf239314863ead464ca32d004d65debc2ea /ctdb/server/ctdb_recovery_helper.c | |
parent | 35368d871d94a0f7bf74ac227a6f0b62bd6c8f1c (diff) | |
download | samba-90622ab901a2738c827d79c002123f758fb966b7.tar.gz |
ctdb-recovery: Fix signed/unsigned comparisons by declaring as unsigned
Simple cases where variables and function parameters need to be
declared as an unsigned type instead of an int.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/server/ctdb_recovery_helper.c')
-rw-r--r-- | ctdb/server/ctdb_recovery_helper.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c index eed71da5df8..f2ea9b1fd56 100644 --- a/ctdb/server/ctdb_recovery_helper.c +++ b/ctdb/server/ctdb_recovery_helper.c @@ -154,7 +154,7 @@ static bool recdb_persistent(struct recdb_context *recdb) struct recdb_add_traverse_state { struct recdb_context *recdb; - int mypnn; + uint32_t mypnn; }; static int recdb_add_traverse(uint32_t reqid, struct ctdb_ltdb_header *header, @@ -304,8 +304,8 @@ struct recdb_file_traverse_state { bool persistent; bool failed; int fd; - int max_size; - int num_buffers; + size_t max_size; + unsigned int num_buffers; }; static int recdb_file_traverse(struct tdb_context *tdb, @@ -397,7 +397,7 @@ struct pull_database_state { struct recdb_context *recdb; uint32_t pnn; uint64_t srvid; - int num_records; + unsigned int num_records; int result; }; @@ -775,7 +775,7 @@ struct push_database_new_state { int fd; int num_buffers; int num_buffers_sent; - int num_records; + unsigned int num_records; }; static void push_database_new_started(struct tevent_req *subreq); @@ -1892,8 +1892,8 @@ static bool recover_db_recv(struct tevent_req *req) struct db_recovery_state { struct tevent_context *ev; struct ctdb_dbid_map *dbmap; - int num_replies; - int num_failed; + unsigned int num_replies; + unsigned int num_failed; }; struct db_recovery_one_state { @@ -1925,7 +1925,7 @@ static struct tevent_req *db_recovery_send(TALLOC_CTX *mem_ctx, { struct tevent_req *req, *subreq; struct db_recovery_state *state; - int i; + unsigned int i; req = tevent_req_create(mem_ctx, &state, struct db_recovery_state); if (req == NULL) { @@ -2022,7 +2022,7 @@ done: } } -static bool db_recovery_recv(struct tevent_req *req, int *count) +static bool db_recovery_recv(struct tevent_req *req, unsigned int *count) { struct db_recovery_state *state = tevent_req_data( req, struct db_recovery_state); @@ -2064,7 +2064,7 @@ struct recovery_state { struct ctdb_client_context *client; uint32_t generation; uint32_t *pnn_list; - int count; + unsigned int count; uint32_t destnode; struct ctdb_node_map *nodemap; uint32_t *caps; @@ -2256,7 +2256,8 @@ static void recovery_capabilities_done(struct tevent_req *subreq) struct ctdb_reply_control **reply; struct ctdb_req_control request; int *err_list; - int ret, i; + unsigned int i; + int ret; bool status; status = ctdb_client_control_multi_recv(subreq, &ret, state, &err_list, @@ -2360,8 +2361,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, i; - unsigned int count; + int ret; + unsigned int count, i; bool status; status = ctdb_client_control_multi_recv(subreq, &ret, NULL, &err_list, @@ -2544,7 +2545,7 @@ static void recovery_db_recovery_done(struct tevent_req *subreq) req, struct recovery_state); struct ctdb_req_control request; bool status; - int count; + unsigned int count; status = db_recovery_recv(subreq, &count); TALLOC_FREE(subreq); @@ -2553,7 +2554,7 @@ static void recovery_db_recovery_done(struct tevent_req *subreq) if (! status) { uint32_t max_pnn = CTDB_UNKNOWN_PNN, max_credits = 0; - int i; + unsigned int i; /* Bans are not enabled */ if (state->tun_list->enable_bans == 0) { |