Skip to content

Remove unnecessary commas due to removing pedantic option #1010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ctl/ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#define CTL_VALUE_ARG_SEPARATOR ","

static int ctl_global_first_free = 0;
static struct ctl_node CTL_NODE(global, )[CTL_MAX_ENTRIES];
static struct ctl_node CTL_NODE(global)[CTL_MAX_ENTRIES];

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

int ret = -1;

const struct ctl_node *n = ctl_find_node(CTL_NODE(global, ), name, indexes);
const struct ctl_node *n = ctl_find_node(CTL_NODE(global), name, indexes);

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

nnode->children = n;
Expand Down
4 changes: 2 additions & 2 deletions src/ctl/ctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ int ctl_query(struct ctl *ctl, void *ctx, enum ctl_query_source source,
#define CTL_LEAF_RW(name) \
{ \
CTL_STR(name), CTL_NODE_LEAF, \
{CTL_READ_HANDLER(name, ), CTL_WRITE_HANDLER(name, ), NULL}, \
{CTL_READ_HANDLER(name), CTL_WRITE_HANDLER(name), NULL}, \
&CTL_ARG(name), NULL \
}

#define CTL_REGISTER_MODULE(_ctl, name) \
ctl_register_module_node((_ctl), CTL_STR(name), \
(struct ctl_node *)CTL_NODE(name, ))
(struct ctl_node *)CTL_NODE(name))

#ifdef __cplusplus
}
Expand Down
58 changes: 28 additions & 30 deletions test/ctl/ctl_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ struct ctl *get_debug_ctl(void) { return ctl_debug; }
/*
* CTL_WRITE_HANDLER(alloc_pattern) -- sets the alloc_pattern field in heap
*/
static int
CTL_WRITE_HANDLER(alloc_pattern, )(void *ctx, enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
static int CTL_WRITE_HANDLER(alloc_pattern)(void *ctx,
enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
/* suppress unused-parameter errors */
(void)source, (void)indexes, (void)ctx;

Expand All @@ -39,10 +39,10 @@ CTL_WRITE_HANDLER(alloc_pattern, )(void *ctx, enum ctl_query_source source,
/*
* CTL_READ_HANDLER(alloc_pattern) -- returns alloc_pattern heap field
*/
static int CTL_READ_HANDLER(alloc_pattern, )(void *ctx,
enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
static int CTL_READ_HANDLER(alloc_pattern)(void *ctx,
enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
/* suppress unused-parameter errors */
(void)source, (void)indexes, (void)ctx;

Expand All @@ -51,10 +51,10 @@ static int CTL_READ_HANDLER(alloc_pattern, )(void *ctx,
return 0;
}

static int
CTL_WRITE_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
static int CTL_WRITE_HANDLER(enable_logging)(void *ctx,
enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
/* suppress unused-parameter errors */
(void)source, (void)indexes, (void)ctx;

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

static int
CTL_READ_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
static int CTL_READ_HANDLER(enable_logging)(void *ctx,
enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
/* suppress unused-parameter errors */
(void)source, (void)indexes, (void)ctx;

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

static int CTL_WRITE_HANDLER(log_level, )(void *ctx,
enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
static int CTL_WRITE_HANDLER(log_level)(void *ctx, enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
/* suppress unused-parameter errors */
(void)source, (void)indexes, (void)ctx;

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

static int CTL_READ_HANDLER(log_level, )(void *ctx,
enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
static int CTL_READ_HANDLER(log_level)(void *ctx, enum ctl_query_source source,
void *arg,
struct ctl_index_utlist *indexes) {
/* suppress unused-parameter errors */
(void)source, (void)indexes, (void)ctx;

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

static const struct ctl_argument CTL_ARG(log_level) = CTL_ARG_INT;

static const struct ctl_node CTL_NODE(heap, )[] = {CTL_LEAF_RW(alloc_pattern),
CTL_LEAF_RW(enable_logging),
CTL_LEAF_RW(log_level),
static const struct ctl_node CTL_NODE(heap)[] = {CTL_LEAF_RW(alloc_pattern),
CTL_LEAF_RW(enable_logging),
CTL_LEAF_RW(log_level),

CTL_NODE_END};
CTL_NODE_END};

static const struct ctl_node CTL_NODE(debug, )[] = {CTL_CHILD(heap, ),
static const struct ctl_node CTL_NODE(debug)[] = {CTL_CHILD(heap),

CTL_NODE_END};
CTL_NODE_END};

/*
* debug_ctl_register -- registers ctl nodes for "debug" module
Expand Down
Loading