]> The Tcpdump Group git mirrors - libpcap/commitdiff
Get rid of the qualval type.
authorGuy Harris <[email protected]>
Wed, 21 Mar 2018 04:12:48 +0000 (21:12 -0700)
committerGuy Harris <[email protected]>
Wed, 21 Mar 2018 04:12:48 +0000 (21:12 -0700)
It didn't work.

gencode.h
grammar.y

index 41dcdf603c3321f4885ee930abc56410775f346e..58828ecd5854b3f43eb28b4fed251a83278e0f33 100644 (file)
--- a/gencode.h
+++ b/gencode.h
@@ -55,9 +55,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* Type of a qualifier. */
-typedef unsigned char qualval;
-
 /* Address qualifiers. */
 
 #define Q_HOST         1
@@ -281,9 +278,9 @@ struct arth {
 };
 
 struct qual {
-       qualval addr;
-       qualval proto;
-       qualval dir;
+       unsigned char addr;
+       unsigned char proto;
+       unsigned char dir;
        unsigned char pad;
 };
 
index ed7a90c1a8ef9da92fc1dc4bbad32b5c4ea85928..28bc0376b6507c655df3e28d5717da2c0a5486dc 100644 (file)
--- a/grammar.y
+++ b/grammar.y
@@ -90,9 +90,9 @@ DIAG_ON_BISON_BYACC
 #include "os-proto.h"
 #endif
 
-#define QSET(q, p, d, a) (q).proto = (p),\
-                        (q).dir = (d),\
-                        (q).addr = (a)
+#define QSET(q, p, d, a) (q).proto = (unsigned char)(p),\
+                        (q).dir = (unsigned char)(d),\
+                        (q).addr = (unsigned char)(a)
 
 struct tok {
        int v;                  /* value */
@@ -272,7 +272,6 @@ DIAG_OFF_BISON_BYACC
 
 %union {
        int i;
-       qualval q;
        bpf_u_int32 h;
        u_char *e;
        char *s;
@@ -289,7 +288,7 @@ DIAG_OFF_BISON_BYACC
 
 %type  <blk>   expr id nid pid term rterm qid
 %type  <blk>   head
-%type  <q>     pqual dqual aqual ndaqual
+%type  <i>     pqual dqual aqual ndaqual
 %type  <a>     arth narth
 %type  <i>     byteop pname pnum relop irelop
 %type  <blk>   and or paren not null prog