From bd7f5a7c73723f7e05a1ae88e910dc1c559c541d Mon Sep 17 00:00:00 2001 From: Milind L Date: Wed, 9 Aug 2023 19:27:39 +0530 Subject: [PATCH] Style fixes --- examples/describe_cluster.c | 33 ++++++++++++++--------------- examples/describe_consumer_groups.c | 4 ++-- src/rdkafka_admin.c | 3 ++- src/rdkafka_metadata.c | 3 ++- src/rdkafka_metadata.h | 20 +++++++++-------- 5 files changed, 33 insertions(+), 30 deletions(-) diff --git a/examples/describe_cluster.c b/examples/describe_cluster.c index f6ca517de9..b26ff0edcf 100644 --- a/examples/describe_cluster.c +++ b/examples/describe_cluster.c @@ -50,8 +50,8 @@ const char *argv0; static rd_kafka_queue_t *queue = NULL; /** Admin result queue. - * This is a global so we can - * yield in stop() */ + * This is a global so we can + * yield in stop() */ static volatile sig_atomic_t run = 1; /** @@ -71,19 +71,18 @@ static void stop(int sig) { static void usage(const char *reason, ...) { - fprintf( - stderr, - "Describe cluster usage examples\n" - "\n" - "Usage: %s " - "\n" - "Options:\n" - " -b Bootstrap server list to connect to.\n" - " -X Set librdkafka configuration property.\n" - " See CONFIGURATION.md for full list.\n" - " -d Enable librdkafka debugging (%s).\n" - "\n", - argv0, rd_kafka_get_debug_contexts()); + fprintf(stderr, + "Describe cluster usage examples\n" + "\n" + "Usage: %s " + "\n" + "Options:\n" + " -b Bootstrap server list to connect to.\n" + " -X Set librdkafka configuration property.\n" + " See CONFIGURATION.md for full list.\n" + " -d Enable librdkafka debugging (%s).\n" + "\n", + argv0, rd_kafka_get_debug_contexts()); if (reason) { va_list ap; @@ -187,9 +186,9 @@ static void cmd_describe_cluster(rd_kafka_conf_t *conf, int argc, char **argv) { rd_kafka_t *rk = NULL; char errstr[512]; rd_kafka_AdminOptions_t *options = NULL; - rd_kafka_event_t *event = NULL; + rd_kafka_event_t *event = NULL; rd_kafka_error_t *error; - int retval = 0; + int retval = 0; const int min_argc = 1; if (argc < min_argc) diff --git a/examples/describe_consumer_groups.c b/examples/describe_consumer_groups.c index d07e2fe7cd..feb8966782 100644 --- a/examples/describe_consumer_groups.c +++ b/examples/describe_consumer_groups.c @@ -281,11 +281,11 @@ int64_t parse_int(const char *what, const char *str) { */ static void cmd_describe_consumer_groups(rd_kafka_conf_t *conf, int argc, char **argv) { - rd_kafka_t *rk = NULL; + rd_kafka_t *rk = NULL; const char **groups = NULL; char errstr[512]; rd_kafka_AdminOptions_t *options = NULL; - rd_kafka_event_t *event = NULL; + rd_kafka_event_t *event = NULL; rd_kafka_error_t *error; int retval = 0; int groups_cnt = 0; diff --git a/src/rdkafka_admin.c b/src/rdkafka_admin.c index f32e0653e5..6d520fb52b 100644 --- a/src/rdkafka_admin.c +++ b/src/rdkafka_admin.c @@ -8259,7 +8259,8 @@ rd_kafka_DescribeCluster_result_description( static rd_kafka_ClusterDescription_t * rd_kafka_ClusterDescription_new(const rd_kafka_metadata_internal_t *mdi) { const rd_kafka_metadata_t *md = &mdi->metadata; - rd_kafka_ClusterDescription_t *clusterdesc = rd_calloc(1, sizeof(*clusterdesc)); + rd_kafka_ClusterDescription_t *clusterdesc = + rd_calloc(1, sizeof(*clusterdesc)); rd_list_t *authorized_operations = rd_kafka_AuthorizedOperations_parse( mdi->cluster_authorized_operations); int i; diff --git a/src/rdkafka_metadata.c b/src/rdkafka_metadata.c index cc9524bbfc..be06f0d985 100644 --- a/src/rdkafka_metadata.c +++ b/src/rdkafka_metadata.c @@ -596,7 +596,8 @@ rd_kafka_parse_Metadata0(rd_kafka_broker_t *rkb, if (ApiVersion >= 2) { rd_kafka_buf_read_str(rkbuf, &cluster_id); if (cluster_id.str) - mdi->cluster_id = rd_tmpabuf_write_str(&tbuf, cluster_id.str); + mdi->cluster_id = + rd_tmpabuf_write_str(&tbuf, cluster_id.str); } diff --git a/src/rdkafka_metadata.h b/src/rdkafka_metadata.h index d1abf700b9..bc13014a09 100644 --- a/src/rdkafka_metadata.h +++ b/src/rdkafka_metadata.h @@ -98,15 +98,17 @@ typedef struct rd_kafka_metadata_internal_s { rd_bool_t rd_kafka_has_reliable_leader_epochs(rd_kafka_broker_t *rkb); -rd_kafka_resp_err_t rd_kafka_parse_Metadata(rd_kafka_broker_t *rkb, - rd_kafka_buf_t *request, - rd_kafka_buf_t *rkbuf, - rd_kafka_metadata_internal_t **mdip); - -rd_kafka_resp_err_t rd_kafka_parse_Metadata_admin(rd_kafka_broker_t *rkb, - rd_kafka_buf_t *rkbuf, - rd_list_t *request_topics, - rd_kafka_metadata_internal_t **mdip); +rd_kafka_resp_err_t +rd_kafka_parse_Metadata(rd_kafka_broker_t *rkb, + rd_kafka_buf_t *request, + rd_kafka_buf_t *rkbuf, + rd_kafka_metadata_internal_t **mdip); + +rd_kafka_resp_err_t +rd_kafka_parse_Metadata_admin(rd_kafka_broker_t *rkb, + rd_kafka_buf_t *rkbuf, + rd_list_t *request_topics, + rd_kafka_metadata_internal_t **mdip); rd_kafka_metadata_internal_t * rd_kafka_metadata_copy(const rd_kafka_metadata_internal_t *mdi, size_t size);