From owner-svn-src-all@FreeBSD.ORG Sat Jul 5 03:49:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 441F23A3; Sat, 5 Jul 2014 03:49:21 +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 253E12047; Sat, 5 Jul 2014 03:49:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s653nL8O076241; Sat, 5 Jul 2014 03:49:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s653nLdY076240; Sat, 5 Jul 2014 03:49:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201407050349.s653nLdY076240@svn.freebsd.org> From: Eitan Adler Date: Sat, 5 Jul 2014 03:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268282 - head/usr.bin/units 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.18 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, 05 Jul 2014 03:49:21 -0000 Author: eadler Date: Sat Jul 5 03:49:20 2014 New Revision: 268282 URL: http://svnweb.freebsd.org/changeset/base/268282 Log: units(1): Clean up Remove unused constant. Add 'static' where able. Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Sat Jul 5 03:48:22 2014 (r268281) +++ head/usr.bin/units/units.c Sat Jul 5 03:49:20 2014 (r268282) @@ -69,11 +69,7 @@ static struct { static char NULLUNIT[] = ""; -#ifdef MSDOS -#define SEPARATOR ";" -#else #define SEPARATOR ":" -#endif static int unitcount; static int prefixcount; @@ -107,7 +103,7 @@ static const char * prompt(EditLine *e _ return promptstr; } -char * +static char * dupstr(const char *str) { char *ret; @@ -119,7 +115,7 @@ dupstr(const char *str) } -void +static void readunits(const char *userfile) { FILE *unitfile; @@ -224,7 +220,7 @@ readunits(const char *userfile) fclose(unitfile); } -void +static void initializeunit(struct unittype * theunit) { theunit->numerator[0] = theunit->denominator[0] = NULL; @@ -234,7 +230,7 @@ initializeunit(struct unittype * theunit } -int +static int addsubunit(char *product[], char *toadd) { char **ptr; @@ -251,7 +247,7 @@ addsubunit(char *product[], char *toadd) } -void +static void showunit(struct unittype * theunit) { char **ptr; @@ -313,7 +309,7 @@ zeroerror(void) Returns 0 for successful addition, nonzero on error. */ -int +static int addunit(struct unittype * theunit, const char *toadd, int flip, int quantity) { char *scratch, *savescr; @@ -421,14 +417,14 @@ addunit(struct unittype * theunit, const } -int +static int compare(const void *item1, const void *item2) { return strcmp(*(const char * const *)item1, *(const char * const *)item2); } -void +static void sortunit(struct unittype * theunit) { char **ptr; @@ -549,7 +545,7 @@ lookupunit(const char *unit) #define ERROR 4 -int +static int reduceproduct(struct unittype * theunit, int flip) { @@ -592,7 +588,7 @@ reduceproduct(struct unittype * theunit, Returns 0 on success, or 1 on unknown unit error. */ -int +static int reduceunit(struct unittype * theunit) { int ret; @@ -607,7 +603,7 @@ reduceunit(struct unittype * theunit) } -int +static int compareproducts(char **one, char **two) { while (*one || *two) { @@ -630,7 +626,7 @@ compareproducts(char **one, char **two) /* Return zero if units are compatible, nonzero otherwise */ -int +static int compareunits(struct unittype * first, struct unittype * second) { return @@ -639,7 +635,7 @@ compareunits(struct unittype * first, st } -int +static int completereduce(struct unittype * unit) { if (reduceunit(unit)) @@ -649,7 +645,7 @@ completereduce(struct unittype * unit) return 0; } -void +static void showanswer(struct unittype * have, struct unittype * want) { double ans;