Mercurial > dovecot > core-2.2
changeset 19778:3432ea258fe9
doveadm: Remove CMD_PARAM_NONE type, since it already defaulted to same as CMD_PARAM_BOOL
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Fri, 19 Feb 2016 16:34:53 +0200 |
parents | bcdda0e61d7d |
children | d5a022d714ea |
files | src/doveadm/client-connection-http.c src/doveadm/doveadm-cmd.c src/doveadm/doveadm-cmd.h |
diffstat | 3 files changed, 3 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/client-connection-http.c Fri Feb 19 19:11:53 2016 +0200 +++ b/src/doveadm/client-connection-http.c Fri Feb 19 16:34:53 2016 +0200 @@ -233,7 +233,6 @@ } else { conn->cmd_param->value_set = TRUE; switch(conn->cmd_param->type) { - case CMD_PARAM_NONE: case CMD_PARAM_BOOL: conn->cmd_param->value.v_bool = (strcmp(*value,"true")==0); break; case CMD_PARAM_INT64: @@ -523,7 +522,6 @@ o_stream_nsend_str(conn->client.output, str_c(tmp)); o_stream_nsend_str(conn->client.output, "\",\"type\":\""); switch(par->type) { - case CMD_PARAM_NONE: case CMD_PARAM_BOOL: o_stream_nsend_str(conn->client.output, "boolean"); break;
--- a/src/doveadm/doveadm-cmd.c Fri Feb 19 19:11:53 2016 +0200 +++ b/src/doveadm/doveadm-cmd.c Fri Feb 19 16:34:53 2016 +0200 @@ -187,7 +187,7 @@ const struct doveadm_cmd_param* param; if ((param = doveadm_cmd_param_get(argc, params, name))==NULL) return FALSE; - if (param->type == CMD_PARAM_NONE || param->type == CMD_PARAM_BOOL) { + if (param->type == CMD_PARAM_BOOL) { *value = param->value.v_bool; return TRUE; } @@ -332,7 +332,6 @@ { param->value_set = TRUE; switch(param->type) { - case CMD_PARAM_NONE: case CMD_PARAM_BOOL: param->value.v_bool = TRUE; break; case CMD_PARAM_INT64:
--- a/src/doveadm/doveadm-cmd.h Fri Feb 19 19:11:53 2016 +0200 +++ b/src/doveadm/doveadm-cmd.h Fri Feb 19 16:34:53 2016 +0200 @@ -3,7 +3,7 @@ #define DOVEADM_CMD_PARAMS_START .parameters = (const struct doveadm_cmd_param[]){ #define DOVEADM_CMD_PARAM(optP, nameP, typeP, flagP ) { .opt = optP, .name = nameP, .type = typeP, .flags = flagP }, -#define DOVEADM_CMD_PARAMS_END { .opt = NULL, .name = NULL, .type = CMD_PARAM_NONE, .flags = CMD_PARAM_FLAG_NONE } } +#define DOVEADM_CMD_PARAMS_END { .opt = NULL, .name = NULL, .type = CMD_PARAM_BOOL, .flags = CMD_PARAM_FLAG_NONE } } struct doveadm_cmd_ver2; struct doveadm_mail_cmd_context; @@ -11,8 +11,7 @@ typedef void doveadm_command_t(int argc, char *argv[]); typedef enum { - CMD_PARAM_NONE, /* same as below, used for empty */ - CMD_PARAM_BOOL, /* value will contain 1 (not pointer) */ + CMD_PARAM_BOOL = 0, /* value will contain 1 (not pointer) */ CMD_PARAM_INT64, /* ditto but contains number (not pointer) */ CMD_PARAM_STR, /* value contains const char* */ CMD_PARAM_ARRAY, /* value contains const char*[] */