Skip to content

Commit

Permalink
Fix parsing of command line options for {amp,int6k,plc}rate and int6k…
Browse files Browse the repository at this point in the history
…baud

When compiling with -Wimplicit-fallthrough= I noticed that compiler
warned about several statements which may fall through. After inspection
I'm sure that falling through is not desired behavior but simply
a break is missing in all cases.

So let's fix the unwanted side-effects which occur at the moment
when using the affected command line options.

Signed-off-by: Michael Heimpold <[email protected]>
  • Loading branch information
mhei authored and n1000 committed Oct 19, 2018
1 parent 933471a commit 1726f91
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions plc/amprate.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ int main (int argc, char const * argv [])
break;
case 'd':
plc.timer = (unsigned)(uintspec (optarg, 1, 60));
break;
case 'e':
dup2 (STDOUT_FILENO, STDERR_FILENO);
break;
Expand Down
1 change: 1 addition & 0 deletions plc/int6krate.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ int main (int argc, char const * argv [])
break;
case 'd':
plc.timer = (unsigned)(uintspec (optarg, 1, 60));
break;
case 'e':
dup2 (STDOUT_FILENO, STDERR_FILENO);
break;
Expand Down
1 change: 1 addition & 0 deletions plc/plcrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ int main (int argc, char const * argv [])
break;
case 'd':
plc.timer = (unsigned)(uintspec (optarg, 1, 60));
break;
case 'e':
dup2 (STDOUT_FILENO, STDERR_FILENO);
break;
Expand Down
1 change: 1 addition & 0 deletions serial/int6kbaud.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ int main (int argc, char const * argv [])
case 'm':
_setbits (uart.flags, UART_ATBR);
uart.mode = (byte)(uintspec (synonym (optarg, modes, MODES), 0, UCHAR_MAX));
break;
case 'P':
_setbits (uart.flags, UART_ATBR);
uart.parity = (byte)(uintspec (synonym (optarg, paritybits, PARITYBITS), 0, UCHAR_MAX));
Expand Down

0 comments on commit 1726f91

Please sign in to comment.