summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2015-09-20 20:24:28 +0000
committerrodrigc <rodrigc@FreeBSD.org>2015-09-20 20:24:28 +0000
commit5919af45fe0fdd5a425228bbc8383aa5b0798c61 (patch)
treebe0fcdcc2e09e35233a813ebe7bb4842caab3e62 /lib/libc
parent74c1506b3359ee725c9031331908b717460830dc (diff)
downloadFreeBSD-src-5919af45fe0fdd5a425228bbc8383aa5b0798c61.zip
FreeBSD-src-5919af45fe0fdd5a425228bbc8383aa5b0798c61.tar.gz
Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/abort.c2
-rw-r--r--lib/libc/stdlib/abs.c3
-rw-r--r--lib/libc/stdlib/atof.c7
-rw-r--r--lib/libc/stdlib/atoi.c7
-rw-r--r--lib/libc/stdlib/atol.c7
-rw-r--r--lib/libc/stdlib/atoll.c7
-rw-r--r--lib/libc/stdlib/bsearch.c16
-rw-r--r--lib/libc/stdlib/exit.c3
-rw-r--r--lib/libc/stdlib/labs.c3
-rw-r--r--lib/libc/stdlib/qsort.c4
-rw-r--r--lib/libc/stdlib/rand.c7
-rw-r--r--lib/libc/stdlib/tfind.c13
12 files changed, 28 insertions, 51 deletions
diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c
index 022c6aa..2335c40 100644
--- a/lib/libc/stdlib/abort.c
+++ b/lib/libc/stdlib/abort.c
@@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
void
-abort()
+abort(void)
{
struct sigaction act;
diff --git a/lib/libc/stdlib/abs.c b/lib/libc/stdlib/abs.c
index 8758947..367b114 100644
--- a/lib/libc/stdlib/abs.c
+++ b/lib/libc/stdlib/abs.c
@@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
int
-abs(j)
- int j;
+abs(int j)
{
return(j < 0 ? -j : j);
}
diff --git a/lib/libc/stdlib/atof.c b/lib/libc/stdlib/atof.c
index 3514ae3..0458eb9 100644
--- a/lib/libc/stdlib/atof.c
+++ b/lib/libc/stdlib/atof.c
@@ -42,16 +42,13 @@ __FBSDID("$FreeBSD$");
#include <xlocale.h>
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);
}
diff --git a/lib/libc/stdlib/atoi.c b/lib/libc/stdlib/atoi.c
index 564273e..9f92fcd 100644
--- a/lib/libc/stdlib/atoi.c
+++ b/lib/libc/stdlib/atoi.c
@@ -42,16 +42,13 @@ __FBSDID("$FreeBSD$");
#include <xlocale.h>
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);
}
diff --git a/lib/libc/stdlib/atol.c b/lib/libc/stdlib/atol.c
index d30aa18..bd8ef07 100644
--- a/lib/libc/stdlib/atol.c
+++ b/lib/libc/stdlib/atol.c
@@ -42,16 +42,13 @@ __FBSDID("$FreeBSD$");
#include <xlocale.h>
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);
}
diff --git a/lib/libc/stdlib/atoll.c b/lib/libc/stdlib/atoll.c
index af52838..093fde5 100644
--- a/lib/libc/stdlib/atoll.c
+++ b/lib/libc/stdlib/atoll.c
@@ -39,16 +39,13 @@ __FBSDID("$FreeBSD$");
#include <xlocale.h>
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);
}
diff --git a/lib/libc/stdlib/bsearch.c b/lib/libc/stdlib/bsearch.c
index 4a1dd52..8303f97 100644
--- a/lib/libc/stdlib/bsearch.c
+++ b/lib/libc/stdlib/bsearch.c
@@ -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;
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c
index 145eb9d..a656e04 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -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;
diff --git a/lib/libc/stdlib/labs.c b/lib/libc/stdlib/labs.c
index 816370e..ef06882 100644
--- a/lib/libc/stdlib/labs.c
+++ b/lib/libc/stdlib/labs.c
@@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
long
-labs(j)
- long j;
+labs(long j)
{
return(j < 0 ? -j : j);
}
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
index e97ea92..0881688 100644
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -64,9 +64,7 @@ static inline void swapfunc(char *, char *, int, int, int);
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)
diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c
index 4f4aa8d..b8871a2 100644
--- a/lib/libc/stdlib/rand.c
+++ b/lib/libc/stdlib/rand.c
@@ -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;
diff --git a/lib/libc/stdlib/tfind.c b/lib/libc/stdlib/tfind.c
index c5d66cf..0ad391e 100644
--- a/lib/libc/stdlib/tfind.c
+++ b/lib/libc/stdlib/tfind.c
@@ -23,12 +23,15 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <search.h>
-/* 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;
OpenPOWER on IntegriCloud