From owner-svn-src-all@freebsd.org Sat Jul 30 01:04:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D1FCBA7557; Sat, 30 Jul 2016 01:04:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA6CC1B03; Sat, 30 Jul 2016 01:04:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6U14JTL060466; Sat, 30 Jul 2016 01:04:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U14IIl060463; Sat, 30 Jul 2016 01:04:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607300104.u6U14IIl060463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Jul 2016 01:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303525 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2016 01:04:20 -0000 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++;