diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-03-20 11:43:56 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-03-20 11:43:56 -0700 |
commit | d6a0991279f0341f94ea7a76df5c8c178c93d08c (patch) | |
tree | df56e0b6823fc5134d7813ff40f52a3b70e8cda2 | |
parent | e0c66c587d2ebf40f0e8086087fdb7956b091b85 (diff) |
Use for (;;) rather than while (1).
That squelches "conditional expression is constant" warnings from MSVC.
-rw-r--r-- | bpf/net/bpf_filter.c | 2 | ||||
-rw-r--r-- | nametoaddr.c | 2 | ||||
-rw-r--r-- | optimize.c | 12 | ||||
-rw-r--r-- | pcap-npf.c | 2 | ||||
-rw-r--r-- | pcap-rpcap.c | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/bpf/net/bpf_filter.c b/bpf/net/bpf_filter.c index 330dacc4..ae1b950b 100644 --- a/bpf/net/bpf_filter.c +++ b/bpf/net/bpf_filter.c @@ -236,7 +236,7 @@ bpf_filter_with_aux_data(const struct bpf_insn *pc, const u_char *p, A = 0; X = 0; --pc; - while (1) { + for (;;) { ++pc; switch (pc->code) { diff --git a/nametoaddr.c b/nametoaddr.c index c69c36dd..e7b7134e 100644 --- a/nametoaddr.c +++ b/nametoaddr.c @@ -632,7 +632,7 @@ __pcap_atoin(const char *s, bpf_u_int32 *addr) *addr = 0; len = 0; - while (1) { + for (;;) { n = 0; while (*s && *s != '.') n = n * 10 + *s++ - '0'; @@ -1480,7 +1480,7 @@ or_pullup(opt_state_t *opt_state, struct block *b) diffp = &JF(b->in_edges->pred); at_top = 1; - while (1) { + for (;;) { if (*diffp == 0) return; @@ -1497,7 +1497,7 @@ or_pullup(opt_state_t *opt_state, struct block *b) at_top = 0; } samep = &JF(*diffp); - while (1) { + for (;;) { if (*samep == 0) return; @@ -1571,7 +1571,7 @@ and_pullup(opt_state_t *opt_state, struct block *b) diffp = &JF(b->in_edges->pred); at_top = 1; - while (1) { + for (;;) { if (*diffp == 0) return; @@ -1588,7 +1588,7 @@ and_pullup(opt_state_t *opt_state, struct block *b) at_top = 0; } samep = &JT(*diffp); - while (1) { + for (;;) { if (*samep == 0) return; @@ -1812,7 +1812,7 @@ mark_code(struct icode *ic) static int eq_slist(struct slist *x, struct slist *y) { - while (1) { + for (;;) { while (x && x->s.code == NOP) x = x->next; while (y && y->s.code == NOP) @@ -2256,7 +2256,7 @@ icode_to_fcode(compiler_state_t *cstate, struct icode *ic, * Loop doing convert_code_r() until no branches remain * with too-large offsets. */ - while (1) { + for (;;) { unMarkAll(ic); n = *lenp = count_stmts(ic, root); @@ -527,7 +527,7 @@ pcap_read_win32_npf(pcap_t *p, int cnt, pcap_handler callback, u_char *user) */ #define bhp ((struct bpf_hdr *)bp) ep = bp + cc; - while (1) { + for (;;) { register int caplen, hdrlen; /* diff --git a/pcap-rpcap.c b/pcap-rpcap.c index 42a59ebc..94a3834c 100644 --- a/pcap-rpcap.c +++ b/pcap-rpcap.c @@ -1272,7 +1272,7 @@ static int pcap_startcapture_remote(pcap_t *fp) * Loop until the buffer size is OK or the original * socket buffer size is larger than this one. */ - while (1) + for (;;) { res = setsockopt(sockdata, SOL_SOCKET, SO_RCVBUF, (char *)&(server_sockbufsize), |