summaryrefslogtreecommitdiff
path: root/optimize.c
diff options
context:
space:
mode:
authorguy <guy>2007-06-11 10:04:24 +0000
committerguy <guy>2007-06-11 10:04:24 +0000
commita6186fa56db4b6ebe0b61e303ba8c255eae0deb9 (patch)
treea3ff0ccc42c05e3a80c01d5687f414878d59f0c5 /optimize.c
parent8b2ec43589e10b5133bcb36b1399d365836f760a (diff)
downloadlibpcap-a6186fa56db4b6ebe0b61e303ba8c255eae0deb9.tar.gz
Pick up changes from NetBSD:
several files: date: 2006/02/27 15:53:24; author: drochner; state: Exp; avoid shadowing globals, for WARNS=2 date: 2006/02/27 15:55:30; author: drochner; state: Exp; minor constification, good for WARNS=3 now date: 2006/02/27 15:57:17; author: drochner; state: Exp; NetBSD adaption: ... -const pcap_strerror() for consistency gencode.c: date: 2006/04/26 09:24:33; author: tron; state: Exp; Add missing "const" keywords to match declarations in "pcap.h". date: 2006/10/15 19:27:21; author: christos; state: Exp; add a volatile variable to prevent vfork/longjmp clobbering. optimize.c: date: 2006/05/17 17:48:36; author: drochner; state: Exp; Make the optimizer use unsigned numbers as the kernel does. While it is not agreed on that purely unsigned arithmetics is nice, different behaviour of optimized and unoptimized code is less desirable. pcap-bpf.c: date: 2006/02/27 15:51:38; author: drochner; state: Exp; pull in from NetBSD's libpcap: use cloning bpf device on NetBSD Have the configure script check for paths.h, so that we can include it only if we have it, and use the cloning BPF device only if we're on NetBSD *and* _PATH_BPF is defined (hopefully this will keep us from using it on versions of NetBSD that don't have a cloning BPF device; if, in the future, other OSes with BPF get cloning BPF devices, we can make this work for them as well).
Diffstat (limited to 'optimize.c')
-rw-r--r--optimize.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/optimize.c b/optimize.c
index 40f8d1a2..98094a82 100644
--- a/optimize.c
+++ b/optimize.c
@@ -22,7 +22,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/optimize.c,v 1.86 2005-07-31 17:58:24 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/optimize.c,v 1.87 2007-06-11 10:04:25 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -624,7 +624,7 @@ fold_op(s, v0, v1)
struct stmt *s;
int v0, v1;
{
- bpf_int32 a, b;
+ bpf_u_int32 a, b;
a = vmap[v0].const_val;
b = vmap[v1].const_val;
@@ -1834,9 +1834,9 @@ intern_blocks(root)
{
struct block *p;
int i, j;
- int done;
+ int done1; /* don't shadow global */
top:
- done = 1;
+ done1 = 1;
for (i = 0; i < n_blocks; ++i)
blocks[i]->link = 0;
@@ -1860,15 +1860,15 @@ intern_blocks(root)
if (JT(p) == 0)
continue;
if (JT(p)->link) {
- done = 0;
+ done1 = 0;
JT(p) = JT(p)->link;
}
if (JF(p)->link) {
- done = 0;
+ done1 = 0;
JF(p) = JF(p)->link;
}
}
- if (!done)
+ if (!done1)
goto top;
}
@@ -2135,7 +2135,7 @@ convert_code_r(p)
{
int i;
int jt, jf;
- char *ljerr = "%s for block-local relative jump: off=%d";
+ const char *ljerr = "%s for block-local relative jump: off=%d";
#if 0
printf("code=%x off=%d %x %x\n", src->s.code,