Mercurial > projects > pwm
changeset 30:2552eec9b913
Explicitly handle all cases in switch statements
author | Guido Berhoerster <guido+pwm@berhoerster.name> |
---|---|
date | Tue, 28 Nov 2017 15:09:19 +0100 |
parents | 00d782cb45fa |
children | 9be355e742e5 |
files | cmd.c pwm.c pwmrc.c |
diffstat | 3 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/cmd.c Thu Sep 28 10:06:59 2017 +0200 +++ b/cmd.c Tue Nov 28 15:09:19 2017 +0100 @@ -308,6 +308,8 @@ case TOK_ERR_INVALID_MACRO_NAME: pwm_err(ctx, "invalid macro name referenced in macro"); goto out; + case TOK_ERR_OK: + break; } /* parse macro definition */ @@ -322,6 +324,8 @@ case MACRO_ERR_RECURSIVE: pwm_err(ctx, "macro definition must not be recursive"); goto out; + case MACRO_ERR_OK: + break; } macro_add(ctx->macro_head, macro_entry); @@ -565,6 +569,8 @@ case IO_PASSWORD_MISMATCH: pwm_err(ctx, "passwords do not match"); continue; + default: + break; } }
--- a/pwm.c Thu Sep 28 10:06:59 2017 +0200 +++ b/pwm.c Tue Nov 28 15:09:19 2017 +0100 @@ -182,6 +182,8 @@ goto out; } goto next; + case TOK_ERR_OK: + break; } /* expand macros */ @@ -224,6 +226,8 @@ fprintf(stderr, "received signal, quitting\n"); case CMD_QUIT: /* FALLTHROUGH */ goto quit; + default: + break; } ctx->prev_cmd = cmd->full_cmd;