Skip to content

Commit 1a5155f

Browse files
authored
Merge pull request #1010 from KFilipek/remove-macro-commas
Remove unnecessary commas due to removing pedantic option
2 parents 95e2410 + d93b3d7 commit 1a5155f

File tree

3 files changed

+33
-35
lines changed

3 files changed

+33
-35
lines changed

src/ctl/ctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#define CTL_VALUE_ARG_SEPARATOR ","
4545

4646
static int ctl_global_first_free = 0;
47-
static struct ctl_node CTL_NODE(global, )[CTL_MAX_ENTRIES];
47+
static struct ctl_node CTL_NODE(global)[CTL_MAX_ENTRIES];
4848

4949
/*
5050
* This is the top level node of the ctl tree structure. Each node can contain
@@ -316,7 +316,7 @@ int ctl_query(struct ctl *ctl, void *ctx, enum ctl_query_source source,
316316

317317
int ret = -1;
318318

319-
const struct ctl_node *n = ctl_find_node(CTL_NODE(global, ), name, indexes);
319+
const struct ctl_node *n = ctl_find_node(CTL_NODE(global), name, indexes);
320320

321321
if (n == NULL && ctl) {
322322
ctl_delete_indexes(indexes);
@@ -343,7 +343,7 @@ int ctl_query(struct ctl *ctl, void *ctx, enum ctl_query_source source,
343343
void ctl_register_module_node(struct ctl *c, const char *name,
344344
struct ctl_node *n) {
345345
struct ctl_node *nnode = c == NULL
346-
? &CTL_NODE(global, )[ctl_global_first_free++]
346+
? &CTL_NODE(global)[ctl_global_first_free++]
347347
: &c->root[c->first_free++];
348348

349349
nnode->children = n;

src/ctl/ctl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ int ctl_query(struct ctl *ctl, void *ctx, enum ctl_query_source source,
201201
#define CTL_LEAF_RW(name) \
202202
{ \
203203
CTL_STR(name), CTL_NODE_LEAF, \
204-
{CTL_READ_HANDLER(name, ), CTL_WRITE_HANDLER(name, ), NULL}, \
204+
{CTL_READ_HANDLER(name), CTL_WRITE_HANDLER(name), NULL}, \
205205
&CTL_ARG(name), NULL \
206206
}
207207

208208
#define CTL_REGISTER_MODULE(_ctl, name) \
209209
ctl_register_module_node((_ctl), CTL_STR(name), \
210-
(struct ctl_node *)CTL_NODE(name, ))
210+
(struct ctl_node *)CTL_NODE(name))
211211

212212
#ifdef __cplusplus
213213
}

test/ctl/ctl_debug.c

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ struct ctl *get_debug_ctl(void) { return ctl_debug; }
2424
/*
2525
* CTL_WRITE_HANDLER(alloc_pattern) -- sets the alloc_pattern field in heap
2626
*/
27-
static int
28-
CTL_WRITE_HANDLER(alloc_pattern, )(void *ctx, enum ctl_query_source source,
29-
void *arg,
30-
struct ctl_index_utlist *indexes) {
27+
static int CTL_WRITE_HANDLER(alloc_pattern)(void *ctx,
28+
enum ctl_query_source source,
29+
void *arg,
30+
struct ctl_index_utlist *indexes) {
3131
/* suppress unused-parameter errors */
3232
(void)source, (void)indexes, (void)ctx;
3333

@@ -39,10 +39,10 @@ CTL_WRITE_HANDLER(alloc_pattern, )(void *ctx, enum ctl_query_source source,
3939
/*
4040
* CTL_READ_HANDLER(alloc_pattern) -- returns alloc_pattern heap field
4141
*/
42-
static int CTL_READ_HANDLER(alloc_pattern, )(void *ctx,
43-
enum ctl_query_source source,
44-
void *arg,
45-
struct ctl_index_utlist *indexes) {
42+
static int CTL_READ_HANDLER(alloc_pattern)(void *ctx,
43+
enum ctl_query_source source,
44+
void *arg,
45+
struct ctl_index_utlist *indexes) {
4646
/* suppress unused-parameter errors */
4747
(void)source, (void)indexes, (void)ctx;
4848

@@ -51,10 +51,10 @@ static int CTL_READ_HANDLER(alloc_pattern, )(void *ctx,
5151
return 0;
5252
}
5353

54-
static int
55-
CTL_WRITE_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source,
56-
void *arg,
57-
struct ctl_index_utlist *indexes) {
54+
static int CTL_WRITE_HANDLER(enable_logging)(void *ctx,
55+
enum ctl_query_source source,
56+
void *arg,
57+
struct ctl_index_utlist *indexes) {
5858
/* suppress unused-parameter errors */
5959
(void)source, (void)indexes, (void)ctx;
6060

@@ -63,10 +63,10 @@ CTL_WRITE_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source,
6363
return 0;
6464
}
6565

66-
static int
67-
CTL_READ_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source,
68-
void *arg,
69-
struct ctl_index_utlist *indexes) {
66+
static int CTL_READ_HANDLER(enable_logging)(void *ctx,
67+
enum ctl_query_source source,
68+
void *arg,
69+
struct ctl_index_utlist *indexes) {
7070
/* suppress unused-parameter errors */
7171
(void)source, (void)indexes, (void)ctx;
7272

@@ -75,10 +75,9 @@ CTL_READ_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source,
7575
return 0;
7676
}
7777

78-
static int CTL_WRITE_HANDLER(log_level, )(void *ctx,
79-
enum ctl_query_source source,
80-
void *arg,
81-
struct ctl_index_utlist *indexes) {
78+
static int CTL_WRITE_HANDLER(log_level)(void *ctx, enum ctl_query_source source,
79+
void *arg,
80+
struct ctl_index_utlist *indexes) {
8281
/* suppress unused-parameter errors */
8382
(void)source, (void)indexes, (void)ctx;
8483

@@ -87,10 +86,9 @@ static int CTL_WRITE_HANDLER(log_level, )(void *ctx,
8786
return 0;
8887
}
8988

90-
static int CTL_READ_HANDLER(log_level, )(void *ctx,
91-
enum ctl_query_source source,
92-
void *arg,
93-
struct ctl_index_utlist *indexes) {
89+
static int CTL_READ_HANDLER(log_level)(void *ctx, enum ctl_query_source source,
90+
void *arg,
91+
struct ctl_index_utlist *indexes) {
9492
/* suppress unused-parameter errors */
9593
(void)source, (void)indexes, (void)ctx;
9694

@@ -105,15 +103,15 @@ static const struct ctl_argument CTL_ARG(enable_logging) = CTL_ARG_BOOLEAN;
105103

106104
static const struct ctl_argument CTL_ARG(log_level) = CTL_ARG_INT;
107105

108-
static const struct ctl_node CTL_NODE(heap, )[] = {CTL_LEAF_RW(alloc_pattern),
109-
CTL_LEAF_RW(enable_logging),
110-
CTL_LEAF_RW(log_level),
106+
static const struct ctl_node CTL_NODE(heap)[] = {CTL_LEAF_RW(alloc_pattern),
107+
CTL_LEAF_RW(enable_logging),
108+
CTL_LEAF_RW(log_level),
111109

112-
CTL_NODE_END};
110+
CTL_NODE_END};
113111

114-
static const struct ctl_node CTL_NODE(debug, )[] = {CTL_CHILD(heap, ),
112+
static const struct ctl_node CTL_NODE(debug)[] = {CTL_CHILD(heap),
115113

116-
CTL_NODE_END};
114+
CTL_NODE_END};
117115

118116
/*
119117
* debug_ctl_register -- registers ctl nodes for "debug" module

0 commit comments

Comments
 (0)