svn commit: r303525 - head/usr.bin/indent

Pedro F. Giffuni pfg at FreeBSD.org
Sat Jul 30 01:04:20 UTC 2016


Author: pfg
Date: Sat Jul 30 01:04:18 2016
New Revision: 303525
URL: https://svnweb.freebsd.org/changeset/base/303525

Log:
  indent(1): Yet more style issues.
  
  strchr(3) returns a pointer not a boolean.
  Attempt to make the style somewhat more ocnsistent with what indent
  had before recent changes.
  
  Pointed out by:	bde

Modified:
  head/usr.bin/indent/indent.c
  head/usr.bin/indent/io.c
  head/usr.bin/indent/lexi.c

Modified: head/usr.bin/indent/indent.c
==============================================================================
--- head/usr.bin/indent/indent.c	Sat Jul 30 01:00:16 2016	(r303524)
+++ head/usr.bin/indent/indent.c	Sat Jul 30 01:04:18 2016	(r303525)
@@ -342,8 +342,8 @@ main(int argc, char **argv)
 	    case comment:	/* we have a comment, so we must copy it into
 				 * the buffer */
 		if (!flushed_nl || sc_end != NULL) {
-		    if (sc_end == NULL) {	/* if this is the first comment, we
-					 * must set up the buffer */
+		    if (sc_end == NULL) { /* if this is the first comment, we
+					   * must set up the buffer */
 			save_com[0] = save_com[1] = ' ';
 			sc_end = &(save_com[2]);
 		    }
@@ -1100,8 +1100,8 @@ check_type:
 
 		while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t'))
 		    e_lab--;
-		/* comment on preprocessor line */
 		if (e_lab - s_lab == com_end && bp_save == NULL) {
+		    /* comment on preprocessor line */
 		    if (sc_end == NULL)	/* if this is the first comment, we
 					 * must set up the buffer */
 			sc_end = &(save_com[0]);

Modified: head/usr.bin/indent/io.c
==============================================================================
--- head/usr.bin/indent/io.c	Sat Jul 30 01:00:16 2016	(r303524)
+++ head/usr.bin/indent/io.c	Sat Jul 30 01:04:18 2016	(r303525)
@@ -348,8 +348,8 @@ fill_buffer(void)
     int i;
     FILE *f = input;
 
-    if (bp_save != NULL) {		/* there is a partly filled input buffer left */
-	buf_ptr = bp_save;	/* dont read anything, just switch buffers */
+    if (bp_save != NULL) {	/* there is a partly filled input buffer left */
+	buf_ptr = bp_save;	/* do not read anything, just switch buffers */
 	buf_end = be_save;
 	bp_save = be_save = NULL;
 	if (buf_ptr < buf_end)

Modified: head/usr.bin/indent/lexi.c
==============================================================================
--- head/usr.bin/indent/lexi.c	Sat Jul 30 01:00:16 2016	(r303524)
+++ head/usr.bin/indent/lexi.c	Sat Jul 30 01:04:18 2016	(r303525)
@@ -197,7 +197,7 @@ lexi(void)
 		    seensfx |= 1;
 		    continue;
 		}
-		if (!(seensfx & 2) && strchr("fFlL", *buf_ptr)) {
+		if (!(seensfx & 2) && (strchr("fFlL", *buf_ptr) != NULL)) {
 		    CHECK_SIZE_TOKEN;
 		    if (buf_ptr[1] == buf_ptr[0])
 		        *e_token++ = *buf_ptr++;


More information about the svn-src-head mailing list