mirror of
https://github.com/labwc/labwc.git
synced 2025-11-14 06:59:54 -05:00
src: add braces to switch cases containing declarations
This limits the scope of the declarations to avoid accidents.
This commit is contained in:
parent
b48c250177
commit
681f9e9a7b
3 changed files with 6 additions and 3 deletions
|
|
@ -141,12 +141,13 @@ tokenize_xbm(char *buffer)
|
|||
add_token(&ctx, TOKEN_IDENT);
|
||||
get_identifier_token(&ctx);
|
||||
continue;
|
||||
case '0' ... '9':
|
||||
case '0' ... '9': {
|
||||
add_token(&ctx, TOKEN_INT);
|
||||
get_number_token(&ctx);
|
||||
struct token *token = ctx.tokens + ctx.nr_tokens - 1;
|
||||
token->value = (int)strtol(token->name, NULL, 0);
|
||||
continue;
|
||||
}
|
||||
case '{':
|
||||
add_token(&ctx, TOKEN_SPECIAL);
|
||||
get_special_char_token(&ctx);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue