From: Martin Schwenke Date: Thu, 1 Aug 2019 00:46:36 +0000 (+1000) Subject: ctdb-common: Return value of ctdb_queue_length() should be unsigned X-Git-Tag: tdb-1.4.2~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a3d99dc7ad49717252d8c9625e0f8d064cffcd8;p=thirdparty%2Fsamba.git ctdb-common: Return value of ctdb_queue_length() should be unsigned Compiling with -Wsign-compare complains: ctdb/server/ctdb_daemon.c: scope_hint: In function ‘daemon_queue_send’ ctdb/server/ctdb_daemon.c:259:40: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] ... The struct ctdb_queue member out_queue_length is actually uint32_t, so just return that type. Found by csbuild. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/common/common.h b/ctdb/common/common.h index 79f6b9ed03a..c50b52a5eb5 100644 --- a/ctdb/common/common.h +++ b/ctdb/common/common.h @@ -27,7 +27,7 @@ typedef void (*ctdb_queue_cb_fn_t)(uint8_t *data, size_t length, void *private_data); -int ctdb_queue_length(struct ctdb_queue *queue); +uint32_t ctdb_queue_length(struct ctdb_queue *queue); int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length); diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index c16eb7f67b7..000f71e4c20 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -72,7 +72,7 @@ struct ctdb_queue { -int ctdb_queue_length(struct ctdb_queue *queue) +uint32_t ctdb_queue_length(struct ctdb_queue *queue) { return queue->out_queue_length; }