Remove useless blocks in switch/case

Remove unnecessary additional blocks.
This commit is contained in:
Romain Vimont 2018-03-21 11:14:15 +01:00
parent f5cf6c1b2c
commit 3b3803da0d

View file

@ -191,36 +191,30 @@ static SDL_bool parse_args(struct args *args, int argc, char *argv[]) {
int c; int c;
while ((c = getopt_long(argc, argv, "b:hm:p:s:v", long_options, NULL)) != -1) { while ((c = getopt_long(argc, argv, "b:hm:p:s:v", long_options, NULL)) != -1) {
switch (c) { switch (c) {
case 'b': { case 'b':
if (!parse_bit_rate(optarg, &args->bit_rate)) { if (!parse_bit_rate(optarg, &args->bit_rate)) {
return SDL_FALSE; return SDL_FALSE;
} }
break; break;
} case 'h':
case 'h': {
args->help = SDL_TRUE; args->help = SDL_TRUE;
break; break;
} case 'm':
case 'm': {
if (!parse_max_size(optarg, &args->max_size)) { if (!parse_max_size(optarg, &args->max_size)) {
return SDL_FALSE; return SDL_FALSE;
} }
break; break;
} case 'p':
case 'p': {
if (!parse_port(optarg, &args->port)) { if (!parse_port(optarg, &args->port)) {
return SDL_FALSE; return SDL_FALSE;
} }
break; break;
} case 's':
case 's': {
args->serial = optarg; args->serial = optarg;
break; break;
} case 'v':
case 'v': {
args->version = SDL_TRUE; args->version = SDL_TRUE;
break; break;
}
default: default:
// getopt prints the error message on stderr // getopt prints the error message on stderr
return SDL_FALSE; return SDL_FALSE;