Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib Use C89 function definition
details: https://anonhg.NetBSD.org/src/rev/af1543e1470d
branches: trunk
changeset: 778288:af1543e1470d
user: matt <matt%NetBSD.org@localhost>
date: Wed Mar 21 10:10:36 2012 +0000
description:
Use C89 function definition
diffstat:
lib/libc/stdlib/jemalloc.c | 7 +-
lib/libintl/gettext.c | 14 +-
lib/libintl/textdomain.c | 7 +-
lib/libkvm/kvm_getloadavg.c | 10 +-
lib/libperfuse/debug.c | 26 +-
lib/libperfuse/ops.c | 416 +++++++++++-----------------------------
lib/libperfuse/perfuse.c | 45 +---
lib/libperfuse/perfuse_priv.h | 4 +-
lib/libperfuse/subr.c | 38 +--
lib/librmt/rmtlib.c | 12 +-
lib/librumpclient/rumpclient.c | 10 +-
lib/libskey/skeysubr.c | 8 +-
lib/libwrap/clean_exit.c | 8 +-
lib/libwrap/diag.c | 32 +-
lib/libwrap/eval.c | 28 +-
lib/libwrap/fix_options.c | 7 +-
lib/libwrap/hosts_access.c | 108 ++++-----
lib/libwrap/hosts_ctl.c | 11 +-
lib/libwrap/misc.c | 20 +-
lib/libwrap/options.c | 143 ++++++-------
lib/libwrap/percent_x.c | 23 +-
lib/libwrap/refuse.c | 8 +-
lib/libwrap/rfc931.c | 30 +-
lib/libwrap/shell_cmd.c | 12 +-
lib/libwrap/socket.c | 20 +-
lib/libwrap/tcpd.h | 72 +++---
lib/libwrap/update.c | 11 +-
lib/liby/yyerror.c | 7 +-
28 files changed, 431 insertions(+), 706 deletions(-)
diffs (truncated from 2792 to 300 lines):
diff -r 2efbf5338ba5 -r af1543e1470d lib/libc/stdlib/jemalloc.c
--- a/lib/libc/stdlib/jemalloc.c Wed Mar 21 10:09:20 2012 +0000
+++ b/lib/libc/stdlib/jemalloc.c Wed Mar 21 10:10:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: jemalloc.c,v 1.26 2012/03/21 09:49:02 he Exp $ */
+/* $NetBSD: jemalloc.c,v 1.27 2012/03/21 10:10:36 matt Exp $ */
/*-
* Copyright (C) 2006,2007 Jason Evans <jasone%FreeBSD.org@localhost>.
@@ -118,7 +118,7 @@
#include <sys/cdefs.h>
/* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */
-__RCSID("$NetBSD: jemalloc.c,v 1.26 2012/03/21 09:49:02 he Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.27 2012/03/21 10:10:36 matt Exp $");
#ifdef __FreeBSD__
#include "libc_private.h"
@@ -3227,7 +3227,8 @@
"");
_malloc_message("Chunk size: ", umax2s(chunksize, s), "", "");
- _malloc_message(" (2^", umax2s((size_t) opt_chunk_2pow, s), ")\n", "");
+ _malloc_message(" (2^", umax2s((size_t)opt_chunk_2pow, s),
+ ")\n", "");
#ifdef MALLOC_STATS
{
diff -r 2efbf5338ba5 -r af1543e1470d lib/libintl/gettext.c
--- a/lib/libintl/gettext.c Wed Mar 21 10:09:20 2012 +0000
+++ b/lib/libintl/gettext.c Wed Mar 21 10:10:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gettext.c,v 1.26 2012/01/21 13:35:49 tnozaki Exp $ */
+/* $NetBSD: gettext.c,v 1.27 2012/03/21 10:10:36 matt Exp $ */
/*-
* Copyright (c) 2000, 2001 Citrus Project,
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: gettext.c,v 1.26 2012/01/21 13:35:49 tnozaki Exp $");
+__RCSID("$NetBSD: gettext.c,v 1.27 2012/03/21 10:10:36 matt Exp $");
#include <sys/param.h>
#include <sys/stat.h>
@@ -303,8 +303,8 @@
get_sysdep_string_table(struct mosysdepstr_h **table_h, uint32_t *ofstable,
uint32_t nstrings, uint32_t magic, char *base)
{
- int i, j;
- int count;
+ unsigned int i;
+ int j, count;
size_t l;
struct mosysdepstr *table;
@@ -398,7 +398,7 @@
uint32_t magic;
struct moentry *stable;
size_t l;
- int i;
+ unsigned int i;
char *v;
uint32_t *ofstable;
@@ -480,7 +480,7 @@
struct moentry_h *p;
struct mo *mo;
size_t l, headerlen;
- int i;
+ unsigned int i;
char *v;
struct mohandle *mohandle = &db->mohandle;
@@ -772,7 +772,7 @@
/* avoid possible infinite loop, when the data is not sorted */
if (omiddle == middle)
break;
- if (middle < 0 || middle >= mohandle->mo.mo_nstring)
+ if ((size_t)middle >= mohandle->mo.mo_nstring)
break;
n = strcmp(msgid, mohandle->mo.mo_otable[middle].off);
diff -r 2efbf5338ba5 -r af1543e1470d lib/libintl/textdomain.c
--- a/lib/libintl/textdomain.c Wed Mar 21 10:09:20 2012 +0000
+++ b/lib/libintl/textdomain.c Wed Mar 21 10:10:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: textdomain.c,v 1.12 2007/09/25 08:19:09 junyoung Exp $ */
+/* $NetBSD: textdomain.c,v 1.13 2012/03/21 10:10:36 matt Exp $ */
/*-
* Copyright (c) 2000, 2001 Citrus Project,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: textdomain.c,v 1.12 2007/09/25 08:19:09 junyoung Exp $");
+__RCSID("$NetBSD: textdomain.c,v 1.13 2012/03/21 10:10:36 matt Exp $");
#include <sys/param.h>
@@ -39,7 +39,8 @@
#include "pathnames.h"
static struct domainbinding __default_binding = {
- NULL, DEFAULT_DOMAINNAME, _PATH_TEXTDOMAIN,
+ .path = { _PATH_TEXTDOMAIN },
+ .domainname = { DEFAULT_DOMAINNAME },
};
struct domainbinding *__bindings = &__default_binding;
char __current_domainname[PATH_MAX] = DEFAULT_DOMAINNAME;
diff -r 2efbf5338ba5 -r af1543e1470d lib/libkvm/kvm_getloadavg.c
--- a/lib/libkvm/kvm_getloadavg.c Wed Mar 21 10:09:20 2012 +0000
+++ b/lib/libkvm/kvm_getloadavg.c Wed Mar 21 10:10:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kvm_getloadavg.c,v 1.10 2010/09/26 22:28:05 jym Exp $ */
+/* $NetBSD: kvm_getloadavg.c,v 1.11 2012/03/21 10:10:36 matt Exp $ */
/*-
* Copyright (c) 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)kvm_getloadavg.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: kvm_getloadavg.c,v 1.10 2010/09/26 22:28:05 jym Exp $");
+__RCSID("$NetBSD: kvm_getloadavg.c,v 1.11 2012/03/21 10:10:36 matt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -56,11 +56,11 @@
#include "kvm_private.h"
static struct nlist nl[] = {
- { "_averunnable" },
+ { .n_name = "_averunnable" },
#define X_AVERUNNABLE 0
- { "_fscale" },
+ { .n_name = "_fscale" },
#define X_FSCALE 1
- { "" },
+ { .n_name = "" },
};
/*
diff -r 2efbf5338ba5 -r af1543e1470d lib/libperfuse/debug.c
--- a/lib/libperfuse/debug.c Wed Mar 21 10:09:20 2012 +0000
+++ b/lib/libperfuse/debug.c Wed Mar 21 10:10:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.10 2012/01/29 09:01:31 dholland Exp $ */
+/* $NetBSD: debug.c,v 1.11 2012/03/21 10:10:36 matt Exp $ */
/*-
* Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -84,7 +84,7 @@
{ 0, "UNKNOWN" },
};
-const char *perfuse_qtypestr[] = {
+const char * const perfuse_qtypestr[] = {
"READDIR",
"READ",
"WRITE",
@@ -94,8 +94,7 @@
};
const char *
-perfuse_opname(opcode)
- int opcode;
+perfuse_opname(int opcode)
{
const struct perfuse_opcode *po;
@@ -108,9 +107,7 @@
}
char *
-perfuse_opdump_in(ps, pm)
- struct perfuse_state *ps;
- perfuse_msg_t *pm;
+perfuse_opdump_in(struct perfuse_state *ps, perfuse_msg_t *pm)
{
struct fuse_in_header *fih;
static char buf[BUFSIZ] = "";
@@ -131,10 +128,8 @@
}
struct perfuse_trace *
-perfuse_trace_begin(ps, opc, pm)
- struct perfuse_state *ps;
- puffs_cookie_t opc;
- perfuse_msg_t *pm;
+perfuse_trace_begin(struct perfuse_state *ps, puffs_cookie_t opc,
+ perfuse_msg_t *pm)
{
struct perfuse_trace *pt;
@@ -165,10 +160,7 @@
}
void
-perfuse_trace_end(ps, pt, error)
- struct perfuse_state *ps;
- struct perfuse_trace *pt;
- int error;
+perfuse_trace_end(struct perfuse_state *ps, struct perfuse_trace *pt, int error)
{
if (clock_gettime(CLOCK_REALTIME, &pt->pt_end) != 0)
DERR(EX_OSERR, "clock_gettime failed");
@@ -189,9 +181,7 @@
}
void
-perfuse_trace_dump(pu, fp)
- struct puffs_usermount *pu;
- FILE *fp;
+perfuse_trace_dump(struct puffs_usermount *pu, FILE *fp)
{
struct perfuse_state *ps;
struct perfuse_trace *pt;
diff -r 2efbf5338ba5 -r af1543e1470d lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c Wed Mar 21 10:09:20 2012 +0000
+++ b/lib/libperfuse/ops.c Wed Mar 21 10:10:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ops.c,v 1.51 2012/03/08 14:58:57 manu Exp $ */
+/* $NetBSD: ops.c,v 1.52 2012/03/21 10:10:36 matt Exp $ */
/*-
* Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -108,9 +108,7 @@
#if 0
static void
-print_node(func, opc)
- const char *func;
- puffs_cookie_t opc;
+print_node(const char *func, puffs_cookie_t opc)
{
struct puffs_node *pn;
struct perfuse_node_data *pnd;
@@ -128,10 +126,8 @@
#endif /* PERFUSE_DEBUG */
int
-perfuse_node_close_common(pu, opc, mode)
- struct puffs_usermount *pu;
- puffs_cookie_t opc;
- int mode;
+perfuse_node_close_common(struct puffs_usermount *pu, puffs_cookie_t opc,
+ int mode)
{
struct perfuse_state *ps;
perfuse_msg_t *pm;
@@ -197,12 +193,8 @@
}
static int
-xchg_msg(pu, opc, pm, len, wait)
- struct puffs_usermount *pu;
- puffs_cookie_t opc;
- perfuse_msg_t *pm;
- size_t len;
- enum perfuse_xchg_pb_reply wait;
+xchg_msg(struct puffs_usermount *pu, puffs_cookie_t opc, perfuse_msg_t *pm,
+ size_t len, enum perfuse_xchg_pb_reply wait)
{
struct perfuse_state *ps;
struct perfuse_node_data *pnd;
@@ -251,10 +243,7 @@
}
static int
-mode_access(opc, pcr, mode)
- puffs_cookie_t opc;
- const struct puffs_cred *pcr;
- mode_t mode;
+mode_access(puffs_cookie_t opc, const struct puffs_cred *pcr, mode_t mode)
{
struct puffs_node *pn;
struct vattr *va;
@@ -275,9 +264,7 @@
}
static int
-sticky_access(targ, pcr)
- struct puffs_node *targ;
- const struct puffs_cred *pcr;
+sticky_access(struct puffs_node *targ, const struct puffs_cred *pcr)
{
uid_t uid;
struct puffs_node *tdir;
@@ -311,10 +298,8 @@
static void
-fuse_attr_to_vap(ps, vap, fa)
- struct perfuse_state *ps;
- struct vattr *vap;
- struct fuse_attr *fa;
+fuse_attr_to_vap(struct perfuse_state *ps, struct vattr *vap,
Home |
Main Index |
Thread Index |
Old Index