Commit 05f7a27e authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

Code cleanup: remove obsolete PROTO, KandR, INLINE and ANSI_DECL macros

[ISC-Bugs #13151]
parent 80cef0fd
......@@ -160,6 +160,9 @@ work on other platforms. Please report any problems and suggested fixes to
[ISC-Bugs #22695] - Close a file descriptor in an error path.
[ISC-Bugs #19368] - Tidy up variable types in validate_port.
- Code cleanup
[ISC-Bugs #13151] remove obsolete PROTO, KandR, INLINE and ANSI_DECL macros
Changes since 4.1-ESV-R1
! In dhclient check the data for some string options for
......
......@@ -1360,7 +1360,7 @@ void dhcp (packet)
struct packet *packet;
{
struct iaddrmatchlist *ap;
void (*handler) PROTO ((struct packet *));
void (*handler) (struct packet *);
const char *type;
char addrbuf[4*16];
char maskbuf[4*16];
......
......@@ -3,7 +3,7 @@
Lexical scanner for dhcpd config file... */
/*
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2009,2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
......@@ -35,14 +35,14 @@
#include "dhcpd.h"
#include <ctype.h>
static int get_char PROTO ((struct parse *));
static int get_char (struct parse *);
static void unget_char(struct parse *, int);
static void skip_to_eol PROTO ((struct parse *));
static void skip_to_eol (struct parse *);
static enum dhcp_token read_whitespace(int c, struct parse *cfile);
static enum dhcp_token read_string PROTO ((struct parse *));
static enum dhcp_token read_number PROTO ((int, struct parse *));
static enum dhcp_token read_num_or_name PROTO ((int, struct parse *));
static enum dhcp_token intern PROTO ((char *, enum dhcp_token));
static enum dhcp_token read_string (struct parse *);
static enum dhcp_token read_number (int, struct parse *);
static enum dhcp_token read_num_or_name (int, struct parse *);
static enum dhcp_token intern (char *, enum dhcp_token);
isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
struct parse **cfile;
......
......@@ -3,7 +3,7 @@
Find and identify the network interfaces. */
/*
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2009,2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
......@@ -61,10 +61,10 @@ struct in_addr local_address;
struct in6_addr local_address6;
#endif /* DHCPv6 */
void (*bootp_packet_handler) PROTO ((struct interface_info *,
struct dhcp_packet *, unsigned,
unsigned int,
struct iaddr, struct hardware *));
void (*bootp_packet_handler) (struct interface_info *,
struct dhcp_packet *, unsigned,
unsigned int,
struct iaddr, struct hardware *);
#ifdef DHCPv6
void (*dhcpv6_packet_handler)(struct interface_info *,
......
......@@ -3,7 +3,7 @@
Network input dispatcher... */
/*
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2009,2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
......@@ -97,7 +97,7 @@ void dispatch ()
void add_timeout (when, where, what, ref, unref)
struct timeval *when;
void (*where) PROTO ((void *));
void (*where) (void *);
void *what;
tvref_t ref;
tvunref_t unref;
......@@ -171,7 +171,7 @@ void add_timeout (when, where, what, ref, unref)
}
void cancel_timeout (where, what)
void (*where) PROTO ((void *));
void (*where) (void *);
void *what;
{
struct timeout *t, *q;
......
......@@ -125,7 +125,7 @@
# endif
#if defined(USE_DLPI_PFMOD) || defined(USE_DLPI_RAW)
static int strioctl PROTO ((int fd, int cmd, int timeout, int len, char *dp));
static int strioctl (int fd, int cmd, int timeout, int len, char *dp);
#endif
#define DLPI_MAXDLBUF 8192 /* Buffer size */
......@@ -133,46 +133,44 @@ static int strioctl PROTO ((int fd, int cmd, int timeout, int len, char *dp));
#define DLPI_DEVDIR "/dev/" /* Device directory */
static int dlpiopen(const char *ifname);
static int dlpiunit PROTO ((char *ifname));
static int dlpiinforeq PROTO ((int fd));
static int dlpiphysaddrreq PROTO ((int fd, unsigned long addrtype));
static int dlpiattachreq PROTO ((int fd, unsigned long ppa));
static int dlpibindreq PROTO ((int fd, unsigned long sap, unsigned long max_conind,
unsigned long service_mode, unsigned long conn_mgmt,
unsigned long xidtest));
static int dlpiunit (char *ifname);
static int dlpiinforeq (int fd);
static int dlpiphysaddrreq (int fd, unsigned long addrtype);
static int dlpiattachreq (int fd, unsigned long ppa);
static int dlpibindreq (int fd, unsigned long sap, unsigned long max_conind,
unsigned long service_mode, unsigned long conn_mgmt,
unsigned long xidtest);
#if defined(UNUSED_DLPI_INTERFACE)
/* These functions are unused at present, but may be used at a later date.
* defined out to avoid compiler warnings about unused static functions.
*/
static int dlpidetachreq PROTO ((int fd));
static int dlpiunbindreq PROTO ((int fd));
static int dlpidetachreq (int fd);
static int dlpiunbindreq (int fd);
#endif
static int dlpiokack PROTO ((int fd, char *bufp));
static int dlpiinfoack PROTO ((int fd, char *bufp));
static int dlpiphysaddrack PROTO ((int fd, char *bufp));
static int dlpibindack PROTO ((int fd, char *bufp));
static int dlpiokack (int fd, char *bufp);
static int dlpiinfoack (int fd, char *bufp);
static int dlpiphysaddrack (int fd, char *bufp);
static int dlpibindack (int fd, char *bufp);
#if defined(USE_DLPI_SEND) || defined(USE_DLPI_RECEIVE)
/* These functions are not used if we're only sourcing the get_hw_addr()
* function (for USE_SOCKETS).
*/
static int dlpiunitdatareq PROTO ((int fd, unsigned char *addr,
int addrlen, unsigned long minpri,
unsigned long maxpri, unsigned char *data,
int datalen));
static int dlpiunitdataind PROTO ((int fd,
unsigned char *dstaddr,
unsigned long *dstaddrlen,
unsigned char *srcaddr,
unsigned long *srcaddrlen,
unsigned long *grpaddr,
unsigned char *data,
int datalen));
static int dlpiunitdatareq (int fd, unsigned char *addr, int addrlen,
unsigned long minpri, unsigned long maxpri,
unsigned char *data, int datalen);
static int dlpiunitdataind (int fd,
unsigned char *dstaddr,
unsigned long *dstaddrlen,
unsigned char *srcaddr,
unsigned long *srcaddrlen,
unsigned long *grpaddr,
unsigned char *data,
int datalen);
#endif /* !USE_DLPI_HWADDR: USE_DLPI_SEND || USE_DLPI_RECEIVE */
static int expected PROTO ((unsigned long prim, union DL_primitives *dlp,
int msgflags));
static int strgetmsg PROTO ((int fd, struct strbuf *ctlp,
struct strbuf *datap, int *flagsp,
char *caller));
static int expected (unsigned long prim, union DL_primitives *dlp,
int msgflags);
static int strgetmsg (int fd, struct strbuf *ctlp, struct strbuf *datap,
int *flagsp, char *caller);
/* Reinitializes the specified interface after an address change. This
is not required for packet-filter APIs. */
......
......@@ -4,6 +4,7 @@
responses. */
/*
* Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
......@@ -52,7 +53,7 @@ trace_type_t *trace_icmp_output;
void icmp_startup (routep, handler)
int routep;
void (*handler) PROTO ((struct iaddr, u_int8_t *, int));
void (*handler) (struct iaddr, u_int8_t *, int);
{
struct protoent *proto;
int protocol = 1;
......
......@@ -3,7 +3,7 @@
Turn data structures into printable text. */
/*
* Copyright (c) 2009-2010 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2009-2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
......@@ -521,8 +521,7 @@ char *print_dec_2 (val)
return vbuf;
}
static unsigned print_subexpression PROTO ((struct expression *,
char *, unsigned));
static unsigned print_subexpression (struct expression *, char *, unsigned);
static unsigned print_subexpression (expr, buf, len)
struct expression *expr;
......
......@@ -4,6 +4,7 @@
Contributed in May of 1999 by Andrew Chittenden */
/*
* Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
......@@ -42,9 +43,9 @@
* source routing
*/
static int insert_source_routing PROTO ((struct trh_hdr *trh, struct interface_info* interface));
static void save_source_routing PROTO ((struct trh_hdr *trh, struct interface_info* interface));
static void expire_routes PROTO ((void));
static int insert_source_routing (struct trh_hdr *trh, struct interface_info* interface);
static void save_source_routing (struct trh_hdr *trh, struct interface_info* interface);
static void expire_routes (void);
/*
* As we keep a list of interesting routing information only, a singly
......
......@@ -3,6 +3,7 @@
Routines for manipulating parse trees... */
/*
* Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
......@@ -43,8 +44,8 @@
struct binding_scope *global_scope;
static int do_host_lookup PROTO ((struct data_string *,
struct dns_host_entry *));
static int do_host_lookup (struct data_string *,
struct dns_host_entry *);
#ifdef NSUPDATE
struct __res_state resolver_state;
......@@ -3308,7 +3309,7 @@ int is_compound_expression (expr)
expr -> op == expr_dns_transaction);
}
static int op_val PROTO ((enum expr_op));
static int op_val (enum expr_op);
static int op_val (op)
enum expr_op op;
......
......@@ -40,22 +40,6 @@
#define __attribute__(x)
#endif
#if (defined (__GNUC__) || defined (__STDC__)) && !defined (BROKEN_ANSI)
#define PROTO(x) x
#define KandR(x)
#define ANSI_DECL(x) x
#if defined (__GNUC__)
#define INLINE inline
#else
#define INLINE
#endif /* __GNUC__ */
#else
#define PROTO(x) ()
#define KandR(x) x
#define ANSI_DECL(x)
#define INLINE
#endif /* __GNUC__ || __STDC__ */
/* The following macro handles the case of unwanted return values. In
* GCC one can specify an attribute for a function to generate a warning
* if the return value of the function is ignored and one can't dispose of
......
......@@ -9,6 +9,7 @@
probably worth looking at the config files for working ports as well. */
/*
* Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
......@@ -195,7 +196,7 @@ extern int h_errno;
#if 0
#define NO_STRERROR
char *strerror PROTO ((int));
char *strerror (int);
#endif
/* Porting::
......
......@@ -3,6 +3,7 @@
System dependencies for SunOS 4 (tested on 4.1.4)... */
/*
* Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
......@@ -130,7 +131,7 @@ extern int h_errno;
/* SunOS doesn't supply strerror... */
#define NO_STRERROR
char *strerror PROTO ((int));
char *strerror (int);
#define NEED_INET_ATON
......
This diff is collapsed.
......@@ -3,6 +3,7 @@
Definitions for address trees... */
/*
* Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2007-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
......@@ -330,9 +331,9 @@ struct universe {
struct binding_scope **,
struct universe *);
u_int32_t (*get_tag) (const unsigned char *);
void (*store_tag) PROTO ((unsigned char *, u_int32_t));
void (*store_tag) (unsigned char *, u_int32_t);
u_int32_t (*get_length) (const unsigned char *);
void (*store_length) PROTO ((unsigned char *, u_int32_t));
void (*store_length) (unsigned char *, u_int32_t);
int tag_size, length_size;
unsigned site_code_min, end;
option_name_hash_t *name_hash;
......
......@@ -3,6 +3,7 @@
Failover protocol support code... */
/*
* Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999-2003 by Internet Software Consortium
*
......@@ -51,7 +52,7 @@ static void dhcp_failover_pool_balance(dhcp_failover_state_t *state);
static void dhcp_failover_pool_reqbalance(dhcp_failover_state_t *state);
static int dhcp_failover_pool_dobalance(dhcp_failover_state_t *state,
isc_boolean_t *sendreq);
static INLINE int secondary_not_hoarding(dhcp_failover_state_t *state,
static inline int secondary_not_hoarding(dhcp_failover_state_t *state,
struct pool *p);
......@@ -5297,7 +5298,7 @@ isc_result_t dhcp_failover_process_bind_update (dhcp_failover_state_t *state,
* Returns: Truth is the secondary is allowed to get more leases based upon
* MAC address affinity. False otherwise.
*/
static INLINE int
static inline int
secondary_not_hoarding(dhcp_failover_state_t *state, struct pool *p) {
int total;
int hold;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment