Initialize s variable early to shut up GCC warnings.

Do not declare inline functions without body as this is useless in
general and generates a warning with GCC 3.4.x.

Glanced over by:	dhartmei
This commit is contained in:
Alexander Kabaev 2004-07-28 06:14:44 +00:00
parent 1c052ff9fa
commit 7e86873d5c
4 changed files with 31 additions and 14 deletions

View File

@ -1311,7 +1311,7 @@ pfsync_request_update(struct pfsync_state_upd *up, struct in_addr *src)
struct pfsync_header *h;
struct pfsync_softc *sc = ifp->if_softc;
struct pfsync_state_upd_req *rup;
int s, ret = 0; /* make the compiler happy */
int s = 0, ret = 0; /* make the compiler happy */
#ifdef __FreeBSD__
PF_ASSERT(MA_OWNED);

View File

@ -292,6 +292,7 @@ struct pf_pool_limit pf_pool_limits[PF_LIMIT_MAX] = {
((r)->rule_flag & PFRULE_GRBOUND) ? (k)->pfik_parent : \
(k)->pfik_parent->pfik_parent)
#ifndef __FreeBSD__
static __inline int pf_src_compare(struct pf_src_node *, struct pf_src_node *);
static __inline int pf_state_compare_lan_ext(struct pf_state *,
struct pf_state *);
@ -299,6 +300,15 @@ static __inline int pf_state_compare_ext_gwy(struct pf_state *,
struct pf_state *);
static __inline int pf_state_compare_id(struct pf_state *,
struct pf_state *);
#else
static int pf_src_compare(struct pf_src_node *, struct pf_src_node *);
static int pf_state_compare_lan_ext(struct pf_state *,
struct pf_state *);
static int pf_state_compare_ext_gwy(struct pf_state *,
struct pf_state *);
static int pf_state_compare_id(struct pf_state *,
struct pf_state *);
#endif
struct pf_src_tree tree_src_tracking;

View File

@ -155,8 +155,13 @@ struct pf_fragment {
TAILQ_HEAD(pf_fragqueue, pf_fragment) pf_fragqueue;
TAILQ_HEAD(pf_cachequeue, pf_fragment) pf_cachequeue;
#ifndef __FreeBSD__
static __inline int pf_frag_compare(struct pf_fragment *,
struct pf_fragment *);
#else
static int pf_frag_compare(struct pf_fragment *,
struct pf_fragment *);
#endif
RB_HEAD(pf_frag_tree, pf_fragment) pf_frag_tree, pf_cache_tree;
RB_PROTOTYPE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare);
RB_GENERATE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare);

View File

@ -275,6 +275,7 @@ pfr_clr_addrs(struct pfr_table *tbl, int *ndel, int flags)
pfr_enqueue_addrs(kt, &workq, ndel, 0);
if (!(flags & PFR_FLAG_DUMMY)) {
s = 0;
if (flags & PFR_FLAG_ATOMIC)
s = splsoftnet();
pfr_remove_kentries(kt, &workq);
@ -297,7 +298,7 @@ pfr_add_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size,
struct pfr_kentryworkq workq;
struct pfr_kentry *p, *q;
struct pfr_addr ad;
int i, rv, s, xadd = 0;
int i, rv, s = 0, xadd = 0;
#ifdef __FreeBSD__
/*
* XXX Is it OK under LP64 environments?
@ -383,7 +384,7 @@ pfr_del_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size,
struct pfr_kentryworkq workq;
struct pfr_kentry *p;
struct pfr_addr ad;
int i, rv, s, xdel = 0;
int i, rv, s = 0, xdel = 0;
ACCEPT_FLAGS(PFR_FLAG_ATOMIC+PFR_FLAG_DUMMY+PFR_FLAG_FEEDBACK);
if (pfr_validate_table(tbl, 0, flags & PFR_FLAG_USERIOCTL))
@ -445,7 +446,7 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size,
struct pfr_kentryworkq addq, delq, changeq;
struct pfr_kentry *p, *q;
struct pfr_addr ad;
int i, rv, s, xadd = 0, xdel = 0, xchange = 0;
int i, rv, s = 0, xadd = 0, xdel = 0, xchange = 0;
#ifdef __FreeBSD__
/*
* XXX Is it OK under LP64 environments?
@ -649,7 +650,7 @@ pfr_get_astats(struct pfr_table *tbl, struct pfr_astats *addr, int *size,
struct pfr_ktable *kt;
struct pfr_walktree w;
struct pfr_kentryworkq workq;
int rv, s;
int rv, s = 0;
#ifdef __FreeBSD__
/*
* XXX Is it OK under LP64 environments?
@ -715,7 +716,7 @@ pfr_clr_astats(struct pfr_table *tbl, struct pfr_addr *addr, int size,
struct pfr_kentryworkq workq;
struct pfr_kentry *p;
struct pfr_addr ad;
int i, rv, s, xzero = 0;
int i, rv, s = 0, xzero = 0;
ACCEPT_FLAGS(PFR_FLAG_ATOMIC+PFR_FLAG_DUMMY+PFR_FLAG_FEEDBACK);
if (pfr_validate_table(tbl, 0, 0))
@ -1182,7 +1183,7 @@ pfr_clr_tables(struct pfr_table *filter, int *ndel, int flags)
{
struct pfr_ktableworkq workq;
struct pfr_ktable *p;
int s, xdel = 0;
int s = 0, xdel = 0;
ACCEPT_FLAGS(PFR_FLAG_ATOMIC+PFR_FLAG_DUMMY+PFR_FLAG_ALLRSETS);
if (pfr_table_count(filter, flags) < 0)
@ -1217,7 +1218,7 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *nadd, int flags)
{
struct pfr_ktableworkq addq, changeq;
struct pfr_ktable *p, *q, *r, key;
int i, rv, s, xadd = 0;
int i, rv, s = 0, xadd = 0;
#ifdef __FreeBSD__
/*
* XXX Is it OK under LP64 environments?
@ -1305,7 +1306,7 @@ pfr_del_tables(struct pfr_table *tbl, int size, int *ndel, int flags)
{
struct pfr_ktableworkq workq;
struct pfr_ktable *p, *q, key;
int i, s, xdel = 0;
int i, s = 0, xdel = 0;
ACCEPT_FLAGS(PFR_FLAG_ATOMIC+PFR_FLAG_DUMMY);
SLIST_INIT(&workq);
@ -1377,7 +1378,7 @@ pfr_get_tstats(struct pfr_table *filter, struct pfr_tstats *tbl, int *size,
{
struct pfr_ktable *p;
struct pfr_ktableworkq workq;
int s, n, nn;
int s = 0, n, nn;
#ifdef __FreeBSD__
/*
* XXX Is it OK under LP64 environments?
@ -1407,7 +1408,8 @@ pfr_get_tstats(struct pfr_table *filter, struct pfr_tstats *tbl, int *size,
if (!(flags & PFR_FLAG_ATOMIC))
s = splsoftnet();
if (COPYOUT(&p->pfrkt_ts, tbl++, sizeof(*tbl))) {
splx(s);
if (!(flags & PFR_FLAG_ATOMIC))
splx(s);
return (EFAULT);
}
if (!(flags & PFR_FLAG_ATOMIC))
@ -1432,7 +1434,7 @@ pfr_clr_tstats(struct pfr_table *tbl, int size, int *nzero, int flags)
{
struct pfr_ktableworkq workq;
struct pfr_ktable *p, key;
int i, s, xzero = 0;
int i, s = 0, xzero = 0;
#ifdef __FreeBSD__
/*
* XXX Is it OK under LP64 environments?
@ -1473,7 +1475,7 @@ pfr_set_tflags(struct pfr_table *tbl, int size, int setflag, int clrflag,
{
struct pfr_ktableworkq workq;
struct pfr_ktable *p, *q, key;
int i, s, xchange = 0, xdel = 0;
int i, s = 0, xchange = 0, xdel = 0;
ACCEPT_FLAGS(PFR_FLAG_ATOMIC+PFR_FLAG_DUMMY);
if ((setflag & ~PFR_TFLAG_USRMASK) ||
@ -1692,7 +1694,7 @@ pfr_ina_commit(struct pfr_table *trs, u_int32_t ticket, int *nadd,
struct pfr_ktable *p;
struct pfr_ktableworkq workq;
struct pf_ruleset *rs;
int s, xadd = 0, xchange = 0;
int s = 0, xadd = 0, xchange = 0;
#ifdef __FreeBSD__
/*
* XXX Is it OK under LP64 environments?