Re: [dev] [st patch queue 07/12] Remove unnecessary break;s
noname wrote:
> _AT_@ -1897,7 +1896,6 @@ tsetmode(bool priv, bool set, int *args, int narg) {
> fprintf(stderr,
> "erresc: unknown set/reset mode %d\n",
> *args);
> - break;
> }
> }
> }
Heyho,
although a break statement in the last case is unnecessary, I think it should be
left there. If someone appends a new case, he could forget to break this one and
get an unwanted fallthrough. The style in st.c is not consistent, there are
multiple places without the break in the last case and multiples with it. For a
switch(pid = fork())
it is pretty unlikely, that someone legitimately adds a new case other than -1,
0 or default, but it would not harm and help a more consistent style. If we can
agree on it, I'll write the patch to add break;s for the last switch-cases,
where they are missing.
--Markus
Received on Fri Apr 25 2014 - 18:19:09 CEST
This archive was generated by hypermail 2.3.0
: Fri Apr 25 2014 - 18:24:09 CEST