aboutsummaryrefslogtreecommitdiff
path: root/tools/tools/netmap/nmreplay.c
diff options
context:
space:
mode:
authorVincenzo Maffione <vmaffione@FreeBSD.org>2020-10-03 13:19:48 +0000
committerVincenzo Maffione <vmaffione@FreeBSD.org>2020-10-03 13:19:48 +0000
commit7eb32dc8f003402de96c63dfe6609c57df74342f (patch)
treeca4edccc1f5585c9a1192ae845d31b98e9dad8bd /tools/tools/netmap/nmreplay.c
parentf7265157586a1fa983fb959824d5e701dcf4e4b5 (diff)
downloadsrc-7eb32dc8f003402de96c63dfe6609c57df74342f.tar.gz
src-7eb32dc8f003402de96c63dfe6609c57df74342f.zip
netmap: tools: fix several compiler warnings
MFC after: 1 week
Notes
Notes: svn path=/head/; revision=366393
Diffstat (limited to 'tools/tools/netmap/nmreplay.c')
-rw-r--r--tools/tools/netmap/nmreplay.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/tools/tools/netmap/nmreplay.c b/tools/tools/netmap/nmreplay.c
index d4857a3f7273..9736f8910612 100644
--- a/tools/tools/netmap/nmreplay.c
+++ b/tools/tools/netmap/nmreplay.c
@@ -431,7 +431,7 @@ readpcap(const char *fn)
enum my_pcap_mode { PM_NONE, PM_FAST, PM_FIXED, PM_REAL };
-int verbose = 0;
+static int verbose = 0;
static int do_abort = 0;
@@ -988,7 +988,8 @@ usage(void)
static char **
split_arg(const char *src, int *_ac)
{
- char *my = NULL, **av = NULL, *seps = " \t\r\n,";
+ char *my = NULL, **av = NULL;
+ const char *seps = " \t\r\n,";
int l, i, ac; /* number of entries */
if (!src)
@@ -1127,15 +1128,15 @@ main(int argc, char **argv)
/* set default values */
for (i = 0; i < N_OPTS; i++) {
- struct _qs *q = &bp[i].q;
-
- q->burst = 128;
- q->c_delay.optarg = "0";
- q->c_delay.run = null_run_fn;
- q->c_loss.optarg = "0";
- q->c_loss.run = null_run_fn;
- q->c_bw.optarg = "0";
- q->c_bw.run = null_run_fn;
+ struct _qs *qs = &bp[i].q;
+
+ qs->burst = 128;
+ qs->c_delay.optarg = "0";
+ qs->c_delay.run = null_run_fn;
+ qs->c_loss.optarg = "0";
+ qs->c_loss.run = null_run_fn;
+ qs->c_bw.optarg = "0";
+ qs->c_bw.run = null_run_fn;
}
// Options:
@@ -1250,10 +1251,10 @@ main(int argc, char **argv)
/* apply commands */
for (i = 0; i < N_OPTS; i++) { /* once per queue */
- struct _qs *q = &bp[i].q;
- err += cmd_apply(delay_cfg, d[i], q, &q->c_delay);
- err += cmd_apply(bw_cfg, b[i], q, &q->c_bw);
- err += cmd_apply(loss_cfg, l[i], q, &q->c_loss);
+ struct _qs *qs = &bp[i].q;
+ err += cmd_apply(delay_cfg, d[i], qs, &qs->c_delay);
+ err += cmd_apply(bw_cfg, b[i], qs, &qs->c_bw);
+ err += cmd_apply(loss_cfg, l[i], qs, &qs->c_loss);
}
pthread_create(&bp[0].cons_tid, NULL, nmreplay_main, (void*)&bp[0]);
@@ -1287,7 +1288,7 @@ main(int argc, char **argv)
* the final entry has s = NULL.
*/
struct _sm { /* string and multiplier */
- char *s;
+ const char *s;
double m;
};