]> The Tcpdump Group git mirrors - libpcap/commitdiff
optimize: use BITS_PER_WORD rather than calculating it.
authorGuy Harris <[email protected]>
Mon, 18 May 2020 04:22:40 +0000 (21:22 -0700)
committerGuy Harris <[email protected]>
Mon, 18 May 2020 04:22:40 +0000 (21:22 -0700)
It's used elsewhere for that purpose.

optimize.c

index 5b3bc98996f10aaa623d2e8d9da7acc5861cd182..57eec62c7b92a30a7d3c673163ea4821e5261993 100644 (file)
@@ -2364,8 +2364,8 @@ opt_init(opt_state_t *opt_state, struct icode *ic)
                opt_error(opt_state, "malloc");
        }
 
-       opt_state->edgewords = opt_state->n_edges / (8 * sizeof(bpf_u_int32)) + 1;
-       opt_state->nodewords = opt_state->n_blocks / (8 * sizeof(bpf_u_int32)) + 1;
+       opt_state->edgewords = opt_state->n_edges / BITS_PER_WORD + 1;
+       opt_state->nodewords = opt_state->n_blocks / BITS_PER_WORD + 1;
 
        /* XXX */
        opt_state->space = (bpf_u_int32 *)malloc(2 * opt_state->n_blocks * opt_state->nodewords * sizeof(*opt_state->space)