Skip to content

Commit ef54dc6

Browse files
committed
Style fixes
1 parent 9f9e670 commit ef54dc6

6 files changed

Lines changed: 9 additions & 16 deletions

File tree

src/rdhdrhistogram.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,7 @@ typedef struct rd_hdr_iter_s {
275275
int64_t highestEquivalentValue;
276276
} rd_hdr_iter_t;
277277

278-
#define RD_HDR_ITER_INIT(hdr) \
279-
{ .hdr = hdr, .subBucketIdx = -1 }
278+
#define RD_HDR_ITER_INIT(hdr) {.hdr = hdr, .subBucketIdx = -1}
280279

281280
static int rd_hdr_iter_next(rd_hdr_iter_t *it) {
282281
const rd_hdr_histogram_t *hdr = it->hdr;

src/rdkafka_msg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ typedef struct rd_kafka_msgq_s {
230230
} rd_kafka_msgq_t;
231231

232232
#define RD_KAFKA_MSGQ_INITIALIZER(rkmq) \
233-
{ .rkmq_msgs = TAILQ_HEAD_INITIALIZER((rkmq).rkmq_msgs) }
233+
{.rkmq_msgs = TAILQ_HEAD_INITIALIZER((rkmq).rkmq_msgs)}
234234

235235
#define RD_KAFKA_MSGQ_FOREACH(elm, head) \
236236
TAILQ_FOREACH(elm, &(head)->rkmq_msgs, rkm_link)

src/rdkafka_proto.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,9 @@ typedef struct rd_kafkap_str_s {
281281
/* strndup() a Kafka string */
282282
#define RD_KAFKAP_STR_DUP(kstr) rd_strndup((kstr)->str, RD_KAFKAP_STR_LEN(kstr))
283283

284-
#define RD_KAFKAP_STR_INITIALIZER \
285-
{ .len = RD_KAFKAP_STR_LEN_NULL, .str = NULL }
284+
#define RD_KAFKAP_STR_INITIALIZER {.len = RD_KAFKAP_STR_LEN_NULL, .str = NULL}
286285

287-
#define RD_KAFKAP_STR_INITIALIZER_EMPTY \
288-
{ .len = 0, .str = "" }
286+
#define RD_KAFKAP_STR_INITIALIZER_EMPTY {.len = 0, .str = ""}
289287
/**
290288
* Frees a Kafka string previously allocated with `rd_kafkap_str_new()`
291289
*/
@@ -661,8 +659,7 @@ typedef struct rd_kafka_pid_s {
661659
int16_t epoch; /**< Producer Epoch */
662660
} rd_kafka_pid_t;
663661

664-
#define RD_KAFKA_PID_INITIALIZER \
665-
{ -1, -1 }
662+
#define RD_KAFKA_PID_INITIALIZER {-1, -1}
666663

667664
/**
668665
* @returns true if \p PID is valid

src/rdsysqueue.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@
9494
*/
9595

9696
#ifndef TAILQ_HEAD_INITIALIZER
97-
#define TAILQ_HEAD_INITIALIZER(head) \
98-
{ NULL, &(head).tqh_first }
97+
#define TAILQ_HEAD_INITIALIZER(head) {NULL, &(head).tqh_first}
9998
#endif
10099

101100
#ifndef TAILQ_INSERT_BEFORE
@@ -391,8 +390,7 @@
391390
#endif
392391

393392
#ifndef SIMPLEQ_HEAD_INITIALIZER
394-
#define SIMPLEQ_HEAD_INITIALIZER(head) \
395-
{ NULL, &(head).sqh_first }
393+
#define SIMPLEQ_HEAD_INITIALIZER(head) {NULL, &(head).sqh_first}
396394
#endif
397395

398396
#ifndef SIMPLEQ_EMPTY

src/rdwin32.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ static RD_INLINE RD_UNUSED const char *rd_getenv(const char *env,
231231
/**
232232
* Empty struct initializer
233233
*/
234-
#define RD_ZERO_INIT \
235-
{ 0 }
234+
#define RD_ZERO_INIT {0}
236235

237236
#ifndef __cplusplus
238237
/**

tests/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static const char *test_states[] = {
100100

101101
#define _TEST_DECL(NAME) extern int main_##NAME(int, char **)
102102
#define _TEST(NAME, FLAGS, ...) \
103-
{ .name = #NAME, .mainfunc = main_##NAME, .flags = FLAGS, __VA_ARGS__ }
103+
{.name = #NAME, .mainfunc = main_##NAME, .flags = FLAGS, __VA_ARGS__}
104104

105105

106106
/**

0 commit comments

Comments
 (0)