From owner-svn-src-head@freebsd.org Sun Sep 20 20:24:33 2015 Return-Path: Delivered-To: svn-src-head@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 7800AA05C7E; Sun, 20 Sep 2015 20:24:33 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.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 5D0851CAE; Sun, 20 Sep 2015 20:24:33 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8KKOXpP082237; Sun, 20 Sep 2015 20:24:33 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8KKOTnV082111; Sun, 20 Sep 2015 20:24:29 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201509202024.t8KKOTnV082111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sun, 20 Sep 2015 20:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288030 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2015 20:24:33 -0000 Author: rodrigc Date: Sun Sep 20 20:24:28 2015 New Revision: 288030 URL: https://svnweb.freebsd.org/changeset/base/288030 Log: Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. Modified: head/lib/libc/stdlib/abort.c head/lib/libc/stdlib/abs.c head/lib/libc/stdlib/atof.c head/lib/libc/stdlib/atoi.c head/lib/libc/stdlib/atol.c head/lib/libc/stdlib/atoll.c head/lib/libc/stdlib/bsearch.c head/lib/libc/stdlib/exit.c head/lib/libc/stdlib/labs.c head/lib/libc/stdlib/qsort.c head/lib/libc/stdlib/rand.c head/lib/libc/stdlib/tfind.c Modified: head/lib/libc/stdlib/abort.c ============================================================================== --- head/lib/libc/stdlib/abort.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/abort.c Sun Sep 20 20:24:28 2015 (r288030) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" void -abort() +abort(void) { struct sigaction act; Modified: head/lib/libc/stdlib/abs.c ============================================================================== --- head/lib/libc/stdlib/abs.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/abs.c Sun Sep 20 20:24:28 2015 (r288030) @@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$"); #include int -abs(j) - int j; +abs(int j) { return(j < 0 ? -j : j); } Modified: head/lib/libc/stdlib/atof.c ============================================================================== --- head/lib/libc/stdlib/atof.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/atof.c Sun Sep 20 20:24:28 2015 (r288030) @@ -42,16 +42,13 @@ __FBSDID("$FreeBSD$"); #include double -atof(ascii) - const char *ascii; +atof(const char *ascii) { return strtod(ascii, (char **)NULL); } double -atof_l(ascii, locale) - const char *ascii; - locale_t locale; +atof_l(const char *ascii, locale_t locale) { return strtod_l(ascii, (char **)NULL, locale); } Modified: head/lib/libc/stdlib/atoi.c ============================================================================== --- head/lib/libc/stdlib/atoi.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/atoi.c Sun Sep 20 20:24:28 2015 (r288030) @@ -42,16 +42,13 @@ __FBSDID("$FreeBSD$"); #include int -atoi(str) - const char *str; +atoi(const char *str) { return (int)strtol(str, (char **)NULL, 10); } int -atoi_l(str, locale) - const char *str; - locale_t locale; +atoi_l(const char *str, locale_t locale) { return (int)strtol_l(str, (char **)NULL, 10, locale); } Modified: head/lib/libc/stdlib/atol.c ============================================================================== --- head/lib/libc/stdlib/atol.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/atol.c Sun Sep 20 20:24:28 2015 (r288030) @@ -42,16 +42,13 @@ __FBSDID("$FreeBSD$"); #include long -atol(str) - const char *str; +atol(const char *str) { return strtol(str, (char **)NULL, 10); } long -atol_l(str, locale) - const char *str; - locale_t locale; +atol_l(const char *str, locale_t locale) { return strtol_l(str, (char **)NULL, 10, locale); } Modified: head/lib/libc/stdlib/atoll.c ============================================================================== --- head/lib/libc/stdlib/atoll.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/atoll.c Sun Sep 20 20:24:28 2015 (r288030) @@ -39,16 +39,13 @@ __FBSDID("$FreeBSD$"); #include long long -atoll(str) - const char *str; +atoll(const char *str) { return strtoll(str, (char **)NULL, 10); } long long -atoll_l(str, locale) - const char *str; - locale_t locale; +atoll_l(const char *str, locale_t locale) { return strtoll_l(str, (char **)NULL, 10, locale); } Modified: head/lib/libc/stdlib/bsearch.c ============================================================================== --- head/lib/libc/stdlib/bsearch.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/bsearch.c Sun Sep 20 20:24:28 2015 (r288030) @@ -61,20 +61,12 @@ __FBSDID("$FreeBSD$"); */ #ifdef I_AM_BSEARCH_B void * -bsearch_b(key, base0, nmemb, size, compar) - const void *key; - const void *base0; - size_t nmemb; - size_t size; - DECLARE_BLOCK(int, compar, const void *, const void *); +bsearch_b(const void *key, const void *base0, size_t nmemb, size_t size, + DECLARE_BLOCK(int, compar, const void *, const void *)) #else void * -bsearch(key, base0, nmemb, size, compar) - const void *key; - const void *base0; - size_t nmemb; - size_t size; - int (*compar)(const void *, const void *); +bsearch(const void *key, const void *base0, size_t nmemb, size_t size, + int (*compar)(const void *, const void *)) #endif { const char *base = base0; Modified: head/lib/libc/stdlib/exit.c ============================================================================== --- head/lib/libc/stdlib/exit.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/exit.c Sun Sep 20 20:24:28 2015 (r288030) @@ -56,8 +56,7 @@ int __isthreaded = 0; * Exit, flushing stdio buffers if necessary. */ void -exit(status) - int status; +exit(int status) { /* Ensure that the auto-initialization routine is linked in: */ extern int _thread_autoinit_dummy_decl; Modified: head/lib/libc/stdlib/labs.c ============================================================================== --- head/lib/libc/stdlib/labs.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/labs.c Sun Sep 20 20:24:28 2015 (r288030) @@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$"); #include long -labs(j) - long j; +labs(long j) { return(j < 0 ? -j : j); } Modified: head/lib/libc/stdlib/qsort.c ============================================================================== --- head/lib/libc/stdlib/qsort.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/qsort.c Sun Sep 20 20:24:28 2015 (r288030) @@ -64,9 +64,7 @@ static inline void swapfunc(char *, cha es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1; static inline void -swapfunc(a, b, n, swaptype_long, swaptype_int) - char *a, *b; - int n, swaptype_long, swaptype_int; +swapfunc( char *a, char *b, int n, int swaptype_long, int swaptype_int) { if (swaptype_long <= 1) swapcode(long, a, b, n) Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/rand.c Sun Sep 20 20:24:28 2015 (r288030) @@ -111,14 +111,13 @@ static u_long next = #endif int -rand() +rand(void) { return (do_rand(&next)); } void -srand(seed) -u_int seed; +srand(u_int seed) { next = seed; #ifndef USE_WEAK_SEEDING @@ -136,7 +135,7 @@ u_int seed; * data from the kernel. */ void -sranddev() +sranddev(void) { int mib[2]; size_t len; Modified: head/lib/libc/stdlib/tfind.c ============================================================================== --- head/lib/libc/stdlib/tfind.c Sun Sep 20 20:23:16 2015 (r288029) +++ head/lib/libc/stdlib/tfind.c Sun Sep 20 20:24:28 2015 (r288030) @@ -23,12 +23,15 @@ __FBSDID("$FreeBSD$"); #include #include -/* find a node, or return 0 */ +/* + * find a node, or return 0 + * + * vkey - key to be found + * vrootp - address of the tree root + */ void * -tfind(vkey, vrootp, compar) - const void *vkey; /* key to be found */ - void * const *vrootp; /* address of the tree root */ - int (*compar)(const void *, const void *); +tfind(const void *vkey, void * const *vrootp, + int (*compar)(const void *, const void *)) { node_t **rootp = (node_t **)vrootp;