Date: Tue, 23 Aug 2016 01:58:03 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304651 - head/usr.bin/indent Message-ID: <201608230158.u7N1w3Tw025158@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Tue Aug 23 01:58:02 2016 New Revision: 304651 URL: https://svnweb.freebsd.org/changeset/base/304651 Log: indent(1): add some comments to quiet down Coverity. Hopefully adding comments should help explain the code to both static checkers and humans. CID: 976543, 976544, 976545 Obtained from: Piotr Stephaniak Modified: head/usr.bin/indent/io.c head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Tue Aug 23 01:40:45 2016 (r304650) +++ head/usr.bin/indent/io.c Tue Aug 23 01:58:02 2016 (r304651) @@ -200,6 +200,7 @@ dump_line(void) break; case '\\': putc('\\', output); + /* add a backslash to escape the '\' */ default: putc(*follow, output); } Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Tue Aug 23 01:40:45 2016 (r304650) +++ head/usr.bin/indent/parse.c Tue Aug 23 01:58:02 2016 (r304651) @@ -95,6 +95,7 @@ parse(int tk) /* tk: the code for the co case ifstmt: /* scanned if (...) */ if (ps.p_stack[ps.tos] == elsehead && ps.else_if) /* "else if ..." */ ps.i_l_follow = ps.il[ps.tos]; + /* the rest is the same as for dolit and forstmt */ case dolit: /* 'do' */ case forstmt: /* for (...) */ ps.p_stack[++ps.tos] = tk; @@ -301,7 +302,7 @@ reduce(void) case swstmt: /* <switch> <stmt> */ case_ind = ps.cstk[ps.tos - 1]; - + /* FALLTHROUGH */ case decl: /* finish of a declaration */ case elsehead: /* <<if> <stmt> else> <stmt> */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608230158.u7N1w3Tw025158>