mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04: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);
|
||||
|
|
|
|||
|
|
@ -323,11 +323,12 @@ manager_handle_commit(struct wl_client *client, struct wl_resource *resource)
|
|||
struct lab_transaction_op *trans_op, *trans_op_tmp;
|
||||
lab_transaction_for_each_safe(trans_op, trans_op_tmp, addon->ctx) {
|
||||
switch (trans_op->change) {
|
||||
case CW_PENDING_WS_CREATE:
|
||||
case CW_PENDING_WS_CREATE: {
|
||||
group = trans_op->src;
|
||||
struct ws_create_workspace_event *ev = trans_op->data;
|
||||
wl_signal_emit_mutable(&group->events.create_workspace, ev->name);
|
||||
break;
|
||||
}
|
||||
case CW_PENDING_WS_ACTIVATE:
|
||||
workspace = trans_op->src;
|
||||
wl_signal_emit_mutable(&workspace->events.activate, NULL);
|
||||
|
|
|
|||
|
|
@ -295,11 +295,12 @@ manager_handle_commit(struct wl_client *client, struct wl_resource *resource)
|
|||
struct lab_transaction_op *trans_op, *trans_op_tmp;
|
||||
lab_transaction_for_each_safe(trans_op, trans_op_tmp, addon->ctx) {
|
||||
switch (trans_op->change) {
|
||||
case WS_PENDING_WS_CREATE:
|
||||
case WS_PENDING_WS_CREATE: {
|
||||
group = trans_op->src;
|
||||
struct ws_create_workspace_event *ev = trans_op->data;
|
||||
wl_signal_emit_mutable(&group->events.create_workspace, ev->name);
|
||||
break;
|
||||
}
|
||||
case WS_PENDING_WS_ACTIVATE:
|
||||
workspace = trans_op->src;
|
||||
wl_signal_emit_mutable(&workspace->events.activate, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue