No, we leave out the default: That allows compilers to warn when cases are missing.
Any time you see a default: in a WebCore switch, it's sub-optimal in my opinion. -eric On Wed, Jan 20, 2010 at 2:19 PM, Yong Li <[email protected]> wrote: > As everyone may know, current webkit style (at least for most source code) > for a switch statement is like this: > > switch (var) { > case valueFirst: > ... > break; > ... > case valueLast: > ... > break; > default: > ASSERT_NOT_REACHED() > } > > This looks good. But some compilers may give a warning like: "statement is > unreachable". Disabling this warning is a solution. But this warning can > be helpful in some cases. > > So, how about changing the webkit style to this? > > switch (var) { > case valueFirst: > ... > break; > ... > default: > ASSERT(var == valueLast); > ... > break; > } > > > -Yong > _______________________________________________ > webkit-dev mailing list > [email protected] > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev > > _______________________________________________ webkit-dev mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

