static + __dead

This commit is contained in:
joerg 2011-08-27 18:37:41 +00:00
parent a919271017
commit c6d7b0bb59
3 changed files with 44 additions and 46 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mknod.c,v 1.39 2009/02/13 01:37:23 lukem Exp $ */
/* $NetBSD: mknod.c,v 1.40 2011/08/27 18:37:41 joerg Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1998\
The NetBSD Foundation, Inc. All rights reserved.");
__RCSID("$NetBSD: mknod.c,v 1.39 2009/02/13 01:37:23 lukem Exp $");
__RCSID("$NetBSD: mknod.c,v 1.40 2011/08/27 18:37:41 joerg Exp $");
#endif /* not lint */
#include <sys/types.h>
@ -63,8 +63,7 @@ __RCSID("$NetBSD: mknod.c,v 1.39 2009/02/13 01:37:23 lukem Exp $");
static int gid_name(const char *, gid_t *);
static portdev_t callPack(pack_t *, int, u_long *);
int main(int, char *[]);
static void usage(void);
__dead static void usage(void);
#ifdef KERN_DRIVERS
static struct kinfo_drivers *kern_drivers;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pack_dev.c,v 1.10 2009/02/13 01:37:23 lukem Exp $ */
/* $NetBSD: pack_dev.c,v 1.11 2011/08/27 18:37:41 joerg Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
__RCSID("$NetBSD: pack_dev.c,v 1.10 2009/02/13 01:37:23 lukem Exp $");
__RCSID("$NetBSD: pack_dev.c,v 1.11 2011/08/27 18:37:41 joerg Exp $");
#endif /* not lint */
#include <sys/types.h>
@ -241,7 +241,7 @@ pack_bsdos(int n, u_long numbers[], const char **error)
/* list of formats and pack functions */
/* this list must be sorted lexically */
struct format {
static struct format {
const char *name;
pack_t *pack;
} formats[] = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: ping.c,v 1.97 2011/08/21 06:39:09 christos Exp $ */
/* $NetBSD: ping.c,v 1.98 2011/08/27 18:40:18 joerg Exp $ */
/*
* Copyright (c) 1989, 1993
@ -58,7 +58,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: ping.c,v 1.97 2011/08/21 06:39:09 christos Exp $");
__RCSID("$NetBSD: ping.c,v 1.98 2011/08/27 18:40:18 joerg Exp $");
#endif
#include <stdio.h>
@ -128,8 +128,8 @@ __RCSID("$NetBSD: ping.c,v 1.97 2011/08/21 06:39:09 christos Exp $");
* for duplicates.
*/
#define MAX_DUP_CHK (8 * 2048)
u_char rcvd_tbl[MAX_DUP_CHK/8];
int nrepeats = 0;
static u_char rcvd_tbl[MAX_DUP_CHK/8];
static int nrepeats = 0;
#define A(seq) rcvd_tbl[(seq/8)%sizeof(rcvd_tbl)] /* byte in array */
#define B(seq) (1 << (seq & 0x07)) /* bit in byte */
#define SET(seq) (A(seq) |= B(seq))
@ -142,20 +142,20 @@ struct tv32 {
};
u_char *packet;
int packlen;
int pingflags = 0, options;
int pongflags = 0;
char *fill_pat;
static u_char *packet;
static int packlen;
static int pingflags = 0, options;
static int pongflags = 0;
static char *fill_pat;
int s; /* Socket file descriptor */
int sloop; /* Socket file descriptor/loopback */
static int s; /* Socket file descriptor */
static int sloop; /* Socket file descriptor/loopback */
#define PHDR_LEN sizeof(struct tv32) /* size of timestamp header */
struct sockaddr_in whereto, send_addr; /* Who to ping */
struct sockaddr_in src_addr; /* from where */
struct sockaddr_in loc_addr; /* 127.1 */
int datalen = 64 - PHDR_LEN; /* How much data */
static struct sockaddr_in whereto, send_addr; /* Who to ping */
static struct sockaddr_in src_addr; /* from where */
static struct sockaddr_in loc_addr; /* 127.1 */
static int datalen = 64 - PHDR_LEN; /* How much data */
#ifndef __NetBSD__
static char *progname;
@ -163,7 +163,7 @@ static char *progname;
#define setprogname(name) ((void)(progname = (name)))
#endif
char hostname[MAXHOSTNAMELEN];
static char hostname[MAXHOSTNAMELEN];
static struct {
struct ip o_ip;
@ -174,40 +174,39 @@ static struct {
} o_u;
} out_pack;
#define opack_icmp out_pack.o_u.u_icmp
struct ip *opack_ip;
static struct ip *opack_ip;
char optspace[MAX_IPOPTLEN]; /* record route space */
int optlen;
static char optspace[MAX_IPOPTLEN]; /* record route space */
static int optlen;
static int npackets; /* total packets to send */
static int preload; /* number of packets to "preload" */
static int ntransmitted; /* output sequence # = #sent */
static int ident; /* our ID, in network byte order */
int npackets; /* total packets to send */
int preload; /* number of packets to "preload" */
int ntransmitted; /* output sequence # = #sent */
int ident; /* our ID, in network byte order */
static int nreceived; /* # of packets we got back */
int nreceived; /* # of packets we got back */
static double interval; /* interval between packets */
static struct timeval interval_tv;
static double tmin = 999999999.0;
static double tmax = 0.0;
static double tsum = 0.0; /* sum of all times */
static double tsumsq = 0.0;
static double maxwait = 0.0;
double interval; /* interval between packets */
struct timeval interval_tv;
double tmin = 999999999.0;
double tmax = 0.0;
double tsum = 0.0; /* sum of all times */
double tsumsq = 0.0;
double maxwait = 0.0;
static int bufspace = IP_MAXPACKET;
int bufspace = IP_MAXPACKET;
struct timeval now, clear_cache, last_tx, next_tx, first_tx;
struct timeval last_rx, first_rx;
int lastrcvd = 1; /* last ping sent has been received */
static struct timeval now, clear_cache, last_tx, next_tx, first_tx;
static struct timeval last_rx, first_rx;
static int lastrcvd = 1; /* last ping sent has been received */
static struct timeval jiggle_time;
static int jiggle_cnt, total_jiggled, jiggle_direction = -1;
static void doit(void);
__dead static void doit(void);
static void prefinish(int);
static void prtsig(int);
static void finish(int);
__dead static void finish(int);
static void summary(int);
static void pinger(void);
static void fill(void);
@ -226,7 +225,7 @@ static int pr_icmph(struct icmp *, struct sockaddr_in *, int);
static void jiggle(int), jiggle_flush(int);
static void gethost(const char *, const char *,
struct sockaddr_in *, char *, int);
static void usage(void);
__dead static void usage(void);
int
main(int argc, char *argv[])