summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-20 16:53:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-20 16:53:49 +0000
commit7e954e14dccf4295a38d4e1a8e49d817c10f3e19 (patch)
tree46d2ac6e401bf47eb9a3705129e452de02395cc3
parentf3c0a21852426e6df9e294a4544977603cb897d1 (diff)
some cleanings recommended by lint; dhartmei ok
-rw-r--r--sbin/pfctl/pf_print_state.c4
-rw-r--r--sbin/pfctl/pfctl_altq.c12
-rw-r--r--sbin/pfctl/pfctl_qstats.c4
3 files changed, 11 insertions, 9 deletions
diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c
index 59609e0902e..a61bc422213 100644
--- a/sbin/pfctl/pf_print_state.c
+++ b/sbin/pfctl/pf_print_state.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_print_state.c,v 1.29 2003/06/07 21:10:47 henning Exp $ */
+/* $OpenBSD: pf_print_state.c,v 1.30 2003/06/20 16:53:48 deraadt Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -227,11 +227,13 @@ print_state(struct pf_state *s, int opts)
} else if (s->proto == IPPROTO_UDP && src->state < PFUDPS_NSTATES &&
dst->state < PFUDPS_NSTATES) {
const char *states[] = PFUDPS_NAMES;
+
printf(" %s:%s\n", states[src->state], states[dst->state]);
} else if (s->proto != IPPROTO_ICMP && src->state < PFOTHERS_NSTATES &&
dst->state < PFOTHERS_NSTATES) {
/* XXX ICMP doesn't really have state levels */
const char *states[] = PFOTHERS_NAMES;
+
printf(" %s:%s\n", states[src->state], states[dst->state]);
} else {
printf(" %u:%u\n", src->state, dst->state);
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index 1c3b7c3f584..764fba79d4b 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_altq.c,v 1.74 2003/06/06 17:53:05 henning Exp $ */
+/* $OpenBSD: pfctl_altq.c,v 1.75 2003/06/20 16:53:48 deraadt Exp $ */
/*
* Copyright (c) 2002
@@ -480,9 +480,9 @@ cbq_compute_idletime(struct pfctl *pf, struct pf_altq *pa)
minidle = -((double)opts->maxpktsize * (double)nsPerByte);
/* scale parameters */
- maxidle = ((maxidle * 8.0) / nsPerByte) * pow(2, RM_FILTER_GAIN);
- offtime = (offtime * 8.0) / nsPerByte * pow(2, RM_FILTER_GAIN);
- minidle = ((minidle * 8.0) / nsPerByte) * pow(2, RM_FILTER_GAIN);
+ maxidle = ((maxidle * 8.0) / nsPerByte) * pow(2.0, (double)RM_FILTER_GAIN);
+ offtime = (offtime * 8.0) / nsPerByte * pow(2.0, (double)RM_FILTER_GAIN);
+ minidle = ((minidle * 8.0) / nsPerByte) * pow(2.0, (double)RM_FILTER_GAIN);
maxidle = maxidle / 1000.0;
offtime = offtime / 1000.0;
@@ -873,8 +873,8 @@ gsc_add_sc(struct gen_sc *gsc, struct service_curve *sc)
if (is_sc_null(sc))
return;
if (sc->d != 0)
- gsc_add_seg(gsc, 0, 0, (double)sc->d, (double)sc->m1);
- gsc_add_seg(gsc, (double)sc->d, 0, INFINITY, (double)sc->m2);
+ gsc_add_seg(gsc, 0.0, 0.0, (double)sc->d, (double)sc->m1);
+ gsc_add_seg(gsc, (double)sc->d, 0.0, INFINITY, (double)sc->m2);
}
/*
diff --git a/sbin/pfctl/pfctl_qstats.c b/sbin/pfctl/pfctl_qstats.c
index ed1c0830cfa..3c47a095f95 100644
--- a/sbin/pfctl/pfctl_qstats.c
+++ b/sbin/pfctl/pfctl_qstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_qstats.c,v 1.21 2003/06/06 17:53:05 henning Exp $ */
+/* $OpenBSD: pfctl_qstats.c,v 1.22 2003/06/20 16:53:48 deraadt Exp $ */
/*
* Copyright (c) Henning Brauer <henning@openbsd.org>
@@ -236,7 +236,7 @@ pfctl_print_altq_node(int dev, const struct pf_altq_node *node, unsigned level,
if (opts & PF_OPT_DEBUG)
printf(" [ qid=%u ifname=%s ifbandwidth=%s ]\n", node->altq.qid,
- node->altq.ifname, rate2str(node->altq.ifbandwidth));
+ node->altq.ifname, rate2str((double)(node->altq.ifbandwidth)));
for (child = node->children; child != NULL;
child = child->next)