mirror of
https://github.com/labwc/labwc.git
synced 2025-11-30 06:59:52 -05:00
treewide: remove empty statements in switch cases
For longer cases, factor out the logic to new functions. For very short cases, just move the declaration before the switch. v2: in one case, replace the switch with if/else.
This commit is contained in:
parent
fbb92e2e30
commit
a3d6226728
5 changed files with 59 additions and 50 deletions
|
|
@ -147,6 +147,7 @@ handle_sigchld(int signal, void *data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
const char *signame;
|
||||
switch (info.si_code) {
|
||||
case CLD_EXITED:
|
||||
wlr_log(info.si_status == 0 ? WLR_DEBUG : WLR_ERROR,
|
||||
|
|
@ -155,8 +156,7 @@ handle_sigchld(int signal, void *data)
|
|||
break;
|
||||
case CLD_KILLED:
|
||||
case CLD_DUMPED:
|
||||
; /* works around "a label can only be part of a statement" */
|
||||
const char *signame = strsignal(info.si_status);
|
||||
signame = strsignal(info.si_status);
|
||||
wlr_log(WLR_ERROR,
|
||||
"spawned child %ld terminated with signal %d (%s)",
|
||||
(long)info.si_pid, info.si_status,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue