Skip to content

Commit

Permalink
Adjusted client_read_string_args() prototype to handle CLang warning.
Browse files Browse the repository at this point in the history
Clang -Wvargargs complained about passing a bool argument to va_start().
  • Loading branch information
stephanbosch committed Oct 14, 2016
1 parent 68806ea commit ceebdaa
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/managesieve/cmd-deletescript.c
Expand Up @@ -18,7 +18,7 @@ bool cmd_deletescript(struct client_command_context *cmd)
struct sieve_script *script;

/* <scrip name>*/
if ( !client_read_string_args(cmd, 1, TRUE, &scriptname) )
if ( !client_read_string_args(cmd, TRUE, 1, &scriptname) )
return FALSE;

script = sieve_storage_open_script
Expand Down
2 changes: 1 addition & 1 deletion src/managesieve/cmd-getscript.c
Expand Up @@ -103,7 +103,7 @@ bool cmd_getscript(struct client_command_context *cmd)
enum sieve_error error;

/* <scriptname> */
if ( !client_read_string_args(cmd, 1, TRUE, &scriptname) )
if ( !client_read_string_args(cmd, TRUE, 1, &scriptname) )
return FALSE;

ctx = p_new(cmd->pool, struct cmd_getscript_context, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/managesieve/cmd-putscript.c
Expand Up @@ -478,7 +478,7 @@ bool cmd_putscript(struct client_command_context *cmd)
const char *scriptname;

/* <scriptname> */
if ( !client_read_string_args(cmd, 1, FALSE, &scriptname) )
if ( !client_read_string_args(cmd, FALSE, 1, &scriptname) )
return FALSE;

return cmd_putscript_start(cmd, scriptname);
Expand Down
2 changes: 1 addition & 1 deletion src/managesieve/cmd-renamescript.c
Expand Up @@ -19,7 +19,7 @@ bool cmd_renamescript(struct client_command_context *cmd)
struct sieve_script *script;

/* <oldname> <newname> */
if (!client_read_string_args(cmd, 2, TRUE, &scriptname, &newname))
if (!client_read_string_args(cmd, TRUE, 2, &scriptname, &newname))
return FALSE;

script = sieve_storage_open_script
Expand Down
2 changes: 1 addition & 1 deletion src/managesieve/cmd-setactive.c
Expand Up @@ -20,7 +20,7 @@ bool cmd_setactive(struct client_command_context *cmd)
int ret;

/* <scriptname> */
if ( !client_read_string_args(cmd, 1, TRUE, &scriptname) )
if ( !client_read_string_args(cmd, TRUE, 1, &scriptname) )
return FALSE;

/* Activate, or .. */
Expand Down
4 changes: 2 additions & 2 deletions src/managesieve/managesieve-client.c
Expand Up @@ -482,7 +482,7 @@ bool client_read_args(struct client_command_context *cmd, unsigned int count,
}

bool client_read_string_args(struct client_command_context *cmd,
unsigned int count, bool no_more, ...)
bool no_more, unsigned int count, ...)
{
const struct managesieve_arg *msieve_args;
va_list va;
Expand All @@ -493,7 +493,7 @@ bool client_read_string_args(struct client_command_context *cmd,
if ( !client_read_args(cmd, count, 0, no_more, &msieve_args) )
return FALSE;

va_start(va, no_more);
va_start(va, count);
for ( i = 0; i < count; i++ ) {
const char **ret = va_arg(va, const char **);

Expand Down
2 changes: 1 addition & 1 deletion src/managesieve/managesieve-client.h
Expand Up @@ -131,7 +131,7 @@ bool client_read_args
/* Reads a number of string arguments. ... is a list of pointers where to
store the arguments. */
bool client_read_string_args
(struct client_command_context *cmd, unsigned int count, bool no_more, ...);
(struct client_command_context *cmd, bool no_more, unsigned int count, ...);

static inline bool client_read_no_args
(struct client_command_context *cmd)
Expand Down

0 comments on commit ceebdaa

Please sign in to comment.