From owner-svn-src-all@FreeBSD.ORG Mon May 4 22:05:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46B29917; Mon, 4 May 2015 22:05:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 283FC1CD5; Mon, 4 May 2015 22:05:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44M5Dtj072293; Mon, 4 May 2015 22:05:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44M5DPZ072292; Mon, 4 May 2015 22:05:13 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505042205.t44M5DPZ072292@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 22:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282437 - head/usr.bin/checknr 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.20 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: Mon, 04 May 2015 22:05:13 -0000 Author: bapt Date: Mon May 4 22:05:12 2015 New Revision: 282437 URL: https://svnweb.freebsd.org/changeset/base/282437 Log: Take from heirloom's doctools version of checknr(1) some cosmetic fixes This helps working on synchronising both tools Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Mon May 4 21:44:51 2015 (r282436) +++ head/usr.bin/checknr/checknr.c Mon May 4 22:05:12 2015 (r282437) @@ -250,7 +250,7 @@ main(int argc, char **argv) nfiles = argc - 1; if (nfiles > 0) { - for (i=1; i=0; i--) { + for (i = stktop; i >= 0; i--) { complain(i); } } @@ -386,7 +386,7 @@ prop(int i) { if (stk[i].pl == 0) printf(".%s", br[stk[i].opno].opbr); - else switch(stk[i].opno) { + else switch (stk[i].opno) { case SZ: printf("\\s%c%d", stk[i].pl, stk[i].parm); break; @@ -395,7 +395,8 @@ prop(int i) break; default: printf("Bug: stk[%d].opno = %d = .%s, .%s", - i, stk[i].opno, br[stk[i].opno].opbr, br[stk[i].opno].clbr); + i, stk[i].opno, br[stk[i].opno].opbr, + br[stk[i].opno].clbr); } } @@ -567,7 +568,9 @@ printf("binsrch(%s) -> %d\n", mac, slot) *loc = strcpy(malloc(3), mac); ncmds++; #ifdef DEBUG -printf("after: %s %s %s %s %s, %d cmds\n", knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], knowncmds[slot+1], knowncmds[slot+2], ncmds); + printf("after: %s %s %s %s %s, %d cmds\n", + knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], + knowncmds[slot+1], knowncmds[slot+2], ncmds); #endif } @@ -592,12 +595,12 @@ binsrch(const char *mac) if (d == 0) d = p[1] - mac[1]; if (d == 0) - return mid; + return (mid); if (d < 0) bot = mid + 1; else top = mid - 1; } slot = bot; /* place it would have gone */ - return -1; + return (-1); }