Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc Remove use of __P
details: https://anonhg.NetBSD.org/src/rev/b2781b8623e0
branches: trunk
changeset: 778246:b2781b8623e0
user: matt <matt%NetBSD.org@localhost>
date: Tue Mar 20 16:38:44 2012 +0000
description:
Remove use of __P
Switch to using C89 definitions.
diffstat:
lib/libc/stdlib/lsearch.c | 10 +++-------
lib/libc/stdlib/twalk.c | 17 ++++++-----------
lib/libc/time/difftime.c | 8 +++-----
lib/libc/time/localtime.c | 13 ++++---------
lib/libc/time/strftime.c | 25 +++++++------------------
5 files changed, 23 insertions(+), 50 deletions(-)
diffs (205 lines):
diff -r 652e3988cfa1 -r b2781b8623e0 lib/libc/stdlib/lsearch.c
--- a/lib/libc/stdlib/lsearch.c Tue Mar 20 16:36:04 2012 +0000
+++ b/lib/libc/stdlib/lsearch.c Tue Mar 20 16:38:44 2012 +0000
@@ -35,7 +35,7 @@
#if 0
static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: lsearch.c,v 1.5 2011/05/18 19:36:36 dsl Exp $");
+__RCSID("$NetBSD: lsearch.c,v 1.6 2012/03/20 16:38:44 matt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -80,12 +80,8 @@
}
static void *
-linear_base(key, base, nelp, width, compar, add_flag)
- const void *key;
- void *base;
- size_t *nelp, width;
- cmp_fn_t compar;
- int add_flag;
+linear_base(const void *key, void *base, size_t *nelp, size_t width,
+ cmp_fn_t compar, int add_flag)
{
char *element, *end;
diff -r 652e3988cfa1 -r b2781b8623e0 lib/libc/stdlib/twalk.c
--- a/lib/libc/stdlib/twalk.c Tue Mar 20 16:36:04 2012 +0000
+++ b/lib/libc/stdlib/twalk.c Tue Mar 20 16:38:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: twalk.c,v 1.3 2011/05/18 19:36:36 dsl Exp $ */
+/* $NetBSD: twalk.c,v 1.4 2012/03/20 16:38:45 matt Exp $ */
/*
* Tree search generalized from Knuth (6.2.2) Algorithm T just like
@@ -13,7 +13,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: twalk.c,v 1.3 2011/05/18 19:36:36 dsl Exp $");
+__RCSID("$NetBSD: twalk.c,v 1.4 2012/03/20 16:38:45 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
@@ -21,15 +21,12 @@
#include <search.h>
#include <stdlib.h>
-static void trecurse(const node_t *,
- void (*action)(const void *, VISIT, int), int level);
+typedef void (*cmp_fn_t)(const void *, VISIT, int);
/* Walk the nodes of a tree */
static void
-trecurse(root, action, level)
- const node_t *root; /* Root of the tree to be walked */
- void (*action)(const void *, VISIT, int);
- int level;
+trecurse(const node_t *root, /* Root of the tree to be walked */
+ cmp_fn_t action, int level)
{
_DIAGASSERT(root != NULL);
_DIAGASSERT(action != NULL);
@@ -49,9 +46,7 @@
/* Walk the nodes of a tree */
void
-twalk(vroot, action)
- const void *vroot; /* Root of the tree to be walked */
- void (*action)(const void *, VISIT, int);
+twalk(const void *vroot, cmp_fn_t action) /* Root of the tree to be walked */
{
if (vroot != NULL && action != NULL)
trecurse(vroot, action, 0);
diff -r 652e3988cfa1 -r b2781b8623e0 lib/libc/time/difftime.c
--- a/lib/libc/time/difftime.c Tue Mar 20 16:36:04 2012 +0000
+++ b/lib/libc/time/difftime.c Tue Mar 20 16:38:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: difftime.c,v 1.10 2009/12/31 22:49:16 mlelstv Exp $ */
+/* $NetBSD: difftime.c,v 1.11 2012/03/20 16:39:08 matt Exp $ */
/*
** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
#if 0
static char elsieid[] = "@(#)difftime.c 8.1";
#else
-__RCSID("$NetBSD: difftime.c,v 1.10 2009/12/31 22:49:16 mlelstv Exp $");
+__RCSID("$NetBSD: difftime.c,v 1.11 2012/03/20 16:39:08 matt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -19,9 +19,7 @@
#include "private.h" /* for time_t, TYPE_INTEGRAL, and TYPE_SIGNED */
double
-difftime(time1, time0)
-const time_t time1;
-const time_t time0;
+difftime(const time_t time1, const time_t time0)
{
/*
** If (sizeof (double) > sizeof (time_t)) simply convert and subtract
diff -r 652e3988cfa1 -r b2781b8623e0 lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Tue Mar 20 16:36:04 2012 +0000
+++ b/lib/libc/time/localtime.c Tue Mar 20 16:38:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: localtime.c,v 1.66 2012/03/13 21:13:48 christos Exp $ */
+/* $NetBSD: localtime.c,v 1.67 2012/03/20 16:39:08 matt Exp $ */
/*
** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
#if 0
static char elsieid[] = "@(#)localtime.c 8.17";
#else
-__RCSID("$NetBSD: localtime.c,v 1.66 2012/03/13 21:13:48 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.67 2012/03/20 16:39:08 matt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -659,8 +659,7 @@
*/
static const char *
-getzname(strp)
-const char * strp;
+getzname(const char *strp)
{
char c;
@@ -697,11 +696,7 @@
*/
static const char *
-getnum(strp, nump, min, max)
-const char * strp;
-int * const nump;
-const int min;
-const int max;
+getnum(const char *strp, int * const nump, const int min, const int max)
{
char c;
int num;
diff -r 652e3988cfa1 -r b2781b8623e0 lib/libc/time/strftime.c
--- a/lib/libc/time/strftime.c Tue Mar 20 16:36:04 2012 +0000
+++ b/lib/libc/time/strftime.c Tue Mar 20 16:38:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: strftime.c,v 1.21 2010/12/16 18:38:07 christos Exp $ */
+/* $NetBSD: strftime.c,v 1.22 2012/03/20 16:39:08 matt Exp $ */
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
@@ -6,7 +6,7 @@
static char elsieid[] = "@(#)strftime.c 7.64";
static char elsieid[] = "@(#)strftime.c 8.3";
#else
-__RCSID("$NetBSD: strftime.c,v 1.21 2010/12/16 18:38:07 christos Exp $");
+__RCSID("$NetBSD: strftime.c,v 1.22 2012/03/20 16:39:08 matt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -585,11 +585,8 @@
}
static char *
-_conv(n, format, pt, ptlim)
-const int n;
-const char * const format;
-char * const pt;
-const char * const ptlim;
+_conv(const int n, const char * const format, char * const pt,
+ const char * const ptlim)
{
char buf[INT_STRLEN_MAXIMUM(int) + 1];
@@ -598,10 +595,7 @@
}
static char *
-_add(str, pt, ptlim)
-const char * str;
-char * pt;
-const char * const ptlim;
+_add(const char *str, char *pt, const char * const ptlim)
{
while (pt < ptlim && (*pt = *str++) != '\0')
++pt;
@@ -617,13 +611,8 @@
*/
static char *
-_yconv(a, b, convert_top, convert_yy, pt, ptlim)
-const int a;
-const int b;
-const int convert_top;
-const int convert_yy;
-char * pt;
-const char * const ptlim;
+_yconv(const int a, const int b, const int convert_top, const int convert_yy,
+ char *pt, const char * const ptlim)
{
register int lead;
register int trail;
Home |
Main Index |
Thread Index |
Old Index