Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
milindl committed Aug 9, 2023
1 parent ef3f480 commit bd7f5a7
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 30 deletions.
33 changes: 16 additions & 17 deletions examples/describe_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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 <options> <include_cluster_authorized_operations>"
"\n"
"Options:\n"
" -b <brokers> Bootstrap server list to connect to.\n"
" -X <prop=val> Set librdkafka configuration property.\n"
" See CONFIGURATION.md for full list.\n"
" -d <dbg,..> Enable librdkafka debugging (%s).\n"
"\n",
argv0, rd_kafka_get_debug_contexts());
fprintf(stderr,
"Describe cluster usage examples\n"
"\n"
"Usage: %s <options> <include_cluster_authorized_operations>"
"\n"
"Options:\n"
" -b <brokers> Bootstrap server list to connect to.\n"
" -X <prop=val> Set librdkafka configuration property.\n"
" See CONFIGURATION.md for full list.\n"
" -d <dbg,..> Enable librdkafka debugging (%s).\n"
"\n",
argv0, rd_kafka_get_debug_contexts());

if (reason) {
va_list ap;
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions examples/describe_consumer_groups.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/rdkafka_admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/rdkafka_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
20 changes: 11 additions & 9 deletions src/rdkafka_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bd7f5a7

Please sign in to comment.