Skip to content

Commit

Permalink
bar, block, ini, json: fix unused parameter
Browse files Browse the repository at this point in the history
This fixes several unused parameters using the common method:

	(void)the_unused_parameter;
  • Loading branch information
gportay committed Jul 10, 2019
1 parent bb167d9 commit be34b6b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bar.c
Expand Up @@ -76,6 +76,8 @@ static int i3bar_dump_key(const char *key, const char *value, void *data)
bool escape;
int err;

(void)data;

/* Skip unknown keys */
if (!index)
return 0;
Expand Down Expand Up @@ -154,12 +156,16 @@ static void term_reset_cursor(void)

static void term_start(struct bar *bar)
{
(void) bar;

term_save_cursor();
term_restore_cursor();
}

static void term_stop(struct bar *bar)
{
(void) bar;

term_reset_cursor();
}

Expand Down Expand Up @@ -260,6 +266,8 @@ static void i3bar_start(struct bar *bar)

static void i3bar_stop(struct bar *bar)
{
(void)bar;

/* From now on the bar can handle log messages */
log_handle = NULL;
log_data = NULL;
Expand Down
6 changes: 6 additions & 0 deletions block.c
Expand Up @@ -59,6 +59,8 @@ static int block_setenv(const char *name, const char *value, void *data)
{
int err;

(void)data;

if (!value)
value = "";

Expand Down Expand Up @@ -233,6 +235,8 @@ void block_touch(struct block *block)
unsigned long now;
int err;

(void)block;

err = sys_gettime(&now);
if (err) {
block_error(block, "failed to touch block");
Expand All @@ -252,6 +256,8 @@ static int block_child_sig(struct block *block)
sigset_t set;
int err;

(void)block;

/* It'd be safe to assume that all signals are unblocked by default */
err = sys_sigfillset(&set);
if (err)
Expand Down
2 changes: 2 additions & 0 deletions ini.c
Expand Up @@ -47,6 +47,8 @@ static int ini_property(struct ini *ini, char *key, char *value)

static int ini_parse_line(char *line, size_t num, void *data)
{
(void)num;

/* comment or empty line? */
if (*line == '\0' || *line == '#')
return 0;
Expand Down
2 changes: 2 additions & 0 deletions json.c
Expand Up @@ -347,6 +347,8 @@ static int json_line_cb(char *line, size_t num, void *data)
size_t len;
int err;

(void)num;

for (;;) {
/* Only support inline flattened structures at the moment */
while (*line == '[' || *line == ']' || *line == ',' ||
Expand Down

0 comments on commit be34b6b

Please sign in to comment.