diff options
author | Rich Salz <rsalz@openssl.org> | 2016-08-30 13:31:18 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-09-22 08:36:26 -0400 |
commit | f3b3d7f0033080f86ede5a53e8af2fb313091b5a (patch) | |
tree | c3761c9e3503980b7a2933211424165adad3fa8d /apps/openssl.c | |
parent | 39c136cc53d7b6fafdd1a0b52c035fd24358e01c (diff) |
Add -Wswitch-enum
Change code so when switching on an enumeration, have case's for all
enumeration values.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'apps/openssl.c')
-rw-r--r-- | apps/openssl.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/openssl.c b/apps/openssl.c index 4f4175c4a0..fceb458542 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -393,26 +393,32 @@ int list_main(int argc, char **argv) return 0; } +typedef enum HELP_CHOICE { + OPT_hERR = -1, OPT_hEOF = 0, OPT_hHELP +} HELP_CHOICE; + OPTIONS help_options[] = { - {"help", OPT_HELP, '-', "Display this summary"}, + {"help", OPT_hHELP, '-', "Display this summary"}, {NULL} }; + int help_main(int argc, char **argv) { FUNCTION *fp; int i, nl; FUNC_TYPE tp; char *prog; - HELPLIST_CHOICE o; + HELP_CHOICE o; prog = opt_init(argc, argv, help_options); - while ((o = opt_next()) != OPT_EOF) { + while ((o = opt_next()) != OPT_hEOF) { switch (o) { - default: + case OPT_hERR: + case OPT_hEOF: BIO_printf(bio_err, "%s: Use -help for summary.\n", prog); return 1; - case OPT_HELP: + case OPT_hHELP: opt_help(help_options); return 0; } |