Fixes to Lemon to get it to compile on platforms (such as some versions
authorGuy Harris <guy@alum.mit.edu>
Fri, 9 Mar 2001 04:35:25 +0000 (04:35 -0000)
committerGuy Harris <guy@alum.mit.edu>
Fri, 9 Mar 2001 04:35:25 +0000 (04:35 -0000)
of Tru64 UNIX) that define TRUE and FALSE.

Fixes to some Tru64 compiler warnings.

svn path=/trunk/; revision=3120

AUTHORS
doc/ethereal.pod.template
packet-nfs.c
packet-osi-options.c
packet-sip.c
packet-srvloc.c
packet-wtls.c
tools/lemon/lemon.c

diff --git a/AUTHORS b/AUTHORS
index 7ac3c36bddc937ef4221010b6c66f4190b492ad4..442cbf0ea43b79877b9e5712e9228ad008de91e7 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -526,6 +526,12 @@ Thomas Gimpel <thomas.gimpel@ferrari.de> {
        Fixes to the Q.931 dissector
 }
 
+Albert Chin <china@thewrittenword.com> {
+       Fixes to Lemon to get it to compile on platforms (such as some
+           versions of Tru64 UNIX) that define TRUE and FALSE
+       Fixes to some Tru64 compiler warninngs
+}
+
 Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to
 give his permission to use his version of snprintf.c.
 
index 504663e173fe10614bdf4eb407dd09a484c84150..5ef8ac08b0c19ac80d9d40f8c522ee50dff6603e 100644 (file)
@@ -1065,6 +1065,7 @@ B<http://www.ethereal.com>.
   James E. Flemer          <jflemer@acm.jhu.edu>
   Peter Lei                <peterlei@cisco.com>
   Thomas Gimpel            <thomas.gimpel@ferrari.de>
+  Albert Chin              <china@thewrittenword.com>
 
 Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to give his
 permission to use his version of snprintf.c.
index 4cc6592fa77bb6100f56b0b4f686c5d3aa099c44..8909085a954f7dfb1ad4651401b12225f356eaea 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
  * Copyright 2000, Mike Frisch <frisch@hummingbird.com> (NFSv4 decoding)
  *
- * $Id: packet-nfs.c,v 1.49 2001/03/06 18:27:07 gram Exp $
+ * $Id: packet-nfs.c,v 1.50 2001/03/09 04:35:22 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -4688,7 +4688,7 @@ static const value_string names_nfsv4_operation[] = {
        { 0, NULL }
 };
 
-guint *nfsv4_operation_ett[] =
+gint *nfsv4_operation_ett[] =
 {
         &ett_nfs_access4 ,
         &ett_nfs_close4 ,
index 02b089cd65b280c5f3cf37540d5b4ef28608a978..1dbf25e20bd0f1ec5bfba13a8f629ad1050b058e 100644 (file)
@@ -5,7 +5,7 @@
  * ISO 10589 ISIS (Intradomain Routeing Information Exchange Protocol)
  * ISO  9542 ESIS (End System To Intermediate System Routeing Exchange Protocol)
  *
- * $Id: packet-osi-options.c,v 1.5 2001/02/05 02:47:31 guy Exp $
+ * $Id: packet-osi-options.c,v 1.6 2001/03/09 04:35:22 guy Exp $
  * Ralf Schneider <Ralf.Schneider@t-online.de>
  *
  * Ethereal - Network traffic analyzer
@@ -217,7 +217,8 @@ dissect_option_qos( const u_char type, const u_char sub_type, int offset,
          val_to_str( tmp_type, osi_opt_qos_sub_vals, "Unknown (0x%x)") );
     }
   }
-};
+}
+
 void
 dissect_option_route( u_char parm_type, u_char offset, u_char parm_len, 
                       tvbuff_t *tvb, proto_tree *tree ) {
@@ -273,7 +274,7 @@ dissect_option_route( u_char parm_type, u_char offset, u_char parm_len,
                   print_nsap_net( tvb_get_ptr(tvb, this_hop + 1, netl), netl ) );
     this_hop += 1 + netl;
   }
-};
+}
 
 
 
@@ -328,7 +329,7 @@ dissect_option_rfd( const u_char error, const u_char field, u_char offset,
     proto_tree_add_text( tree, tvb, offset, len,
                          "Reason for discard: UNKNOWN Error Class" );
   } 
-};
+}
 
 /* ############################## Dissection Functions ###################### */
 
@@ -442,7 +443,7 @@ dissect_osi_options( u_char pdu_type, u_char opt_len, tvbuff_t *tvb,
         offset  += parm_len;
       }
    } 
-}; /* dissect-osi-options */
+} /* dissect-osi-options */
 
 
 /*
@@ -471,5 +472,4 @@ proto_register_osi_options(void) {
     &ott_osi_redirect,
   };
   proto_register_subtree_array( ott, array_length(ott));
-};
-                                                       
+}
index 2e47107ba7412e734bdd7a60faf61ebec7e91b8b..93dcc6517c7dcfc125aaeafaea7a41659e36941d 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
  *
- * $Id: packet-sip.c,v 1.13 2001/01/30 02:38:33 gerald Exp $
+ * $Id: packet-sip.c,v 1.14 2001/03/09 04:35:22 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -203,7 +203,7 @@ void proto_register_sip(void)
         /* Required function calls to register the header fields and subtrees used */
         proto_register_field_array(proto_sip, hf, array_length(hf));
         proto_register_subtree_array(ett, array_length(ett));
-};
+}
 
 void
 proto_reg_handoff_sip(void)
index 685f75caea213a667d1898cc9a67d913f7159c7e..a0af89d177389872442345950ba7d6cc5609b88d 100644 (file)
@@ -6,7 +6,7 @@
  *       In particular I have not had an opportunity to see how it 
  *       responds to SRVLOC over TCP.
  *
- * $Id: packet-srvloc.c,v 1.21 2001/01/22 08:54:06 guy Exp $
+ * $Id: packet-srvloc.c,v 1.22 2001/03/09 04:35:22 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -210,7 +210,7 @@ dissect_authblk(tvbuff_t *tvb, int offset, proto_tree *tree)
                        tvb_format_text(tvb, offset, length));
     offset += length;
     return offset;
-};
+}
 
 /* Packet dissection routine called by tcp & udp when port 427 detected */
 
@@ -486,7 +486,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                 proto_tree_add_text(srvloc_tree, tvb, offset, tvb_length_remaining(tvb, offset), "Unknown Function Type");
         };
     };
-};
+}
 
 /* Register protocol with Ethereal. */
 
index 10e4b74f8dbb4d80114862022391488f9eb66891..8a4194754c62eff29378d8b60583b5043c81078a 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Routines to dissect WTLS component of WAP traffic.
  * 
- * $Id: packet-wtls.c,v 1.3 2001/02/19 21:02:33 guy Exp $
+ * $Id: packet-wtls.c,v 1.4 2001/03/09 04:35:22 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -1328,7 +1328,7 @@ proto_register_wtls(void)
        proto_register_subtree_array(ett, array_length(ett));
 
        register_dissector("wtls", dissect_wtls, proto_wtls);
-};
+}
 
 void
 proto_reg_handoff_wtls(void)
index bb230b884e76218477e4521e9d36695040d5cd82..5672d8af82fd6b775f4860211e6724e99d306231 100644 (file)
@@ -25,7 +25,7 @@
 **   drh@acm.org
 **   http://www.hwaci.com/drh/
 **
-** $Id: lemon.c,v 1.5 2001/02/15 09:25:38 guy Exp $
+** $Id: lemon.c,v 1.6 2001/03/09 04:35:25 guy Exp $
 */
 #include <stdio.h>
 #include <stdarg.h>
@@ -69,7 +69,7 @@ char *msort(char *, char **, int (*)(const void *, const void *));
 ** Principal data structures for the LEMON parser generator.
 */
 
-typedef enum {FALSE=0, TRUE} Boolean;
+typedef enum {BOOL_FALSE=0, BOOL_TRUE} Boolean;
 
 /* Symbols (terminals and nonterminals) of the grammar are stored
 ** in the following: */
@@ -472,7 +472,7 @@ void FindFirstSets(struct lemon *lemp)
   int progress;
 
   for(i=0; i<lemp->nsymbol; i++){
-    lemp->symbols[i]->lambda = FALSE;
+    lemp->symbols[i]->lambda = BOOL_FALSE;
   }
   for(i=lemp->nterminal; i<lemp->nsymbol; i++){
     lemp->symbols[i]->firstset = SetNew();
@@ -484,10 +484,10 @@ void FindFirstSets(struct lemon *lemp)
     for(rp=lemp->rule; rp; rp=rp->next){
       if( rp->lhs->lambda ) continue;
       for(i=0; i<rp->nrhs; i++){
-         if( rp->rhs[i]->lambda==FALSE ) break;
+         if( rp->rhs[i]->lambda==BOOL_FALSE ) break;
       }
       if( i==rp->nrhs ){
-        rp->lhs->lambda = TRUE;
+        rp->lhs->lambda = BOOL_TRUE;
         progress = 1;
       }
     }
@@ -505,10 +505,10 @@ void FindFirstSets(struct lemon *lemp)
           progress += SetAdd(s1->firstset,s2->index);
           break;
        }else if( s1==s2 ){
-          if( s1->lambda==FALSE ) break;
+          if( s1->lambda==BOOL_FALSE ) break;
        }else{
           progress += SetUnion(s1->firstset,s2->firstset);
-          if( s2->lambda==FALSE ) break;
+          if( s2->lambda==BOOL_FALSE ) break;
        }
       }
     }
@@ -799,11 +799,11 @@ void FindActions(struct lemon *lemp)
   }
 
   /* Report an error for each rule that can never be reduced. */
-  for(rp=lemp->rule; rp; rp=rp->next) rp->canReduce = FALSE;
+  for(rp=lemp->rule; rp; rp=rp->next) rp->canReduce = BOOL_FALSE;
   for(i=0; i<lemp->nstate; i++){
     struct action *ap;
     for(ap=lemp->sorted[i]->ap; ap; ap=ap->next){
-      if( ap->type==REDUCE ) ap->x.rp->canReduce = TRUE;
+      if( ap->type==REDUCE ) ap->x.rp->canReduce = BOOL_TRUE;
     }
   }
   for(rp=lemp->rule; rp; rp=rp->next){
@@ -1015,7 +1015,7 @@ void Configlist_closure(struct lemon *lemp)
             break;
          }else{
             SetUnion(newcfp->fws,xsp->firstset);
-            if( xsp->lambda==FALSE ) break;
+            if( xsp->lambda==BOOL_FALSE ) break;
          }
        }
         if( i==rp->nrhs ) Plink_add(&cfp->fplp,newcfp);
@@ -3517,7 +3517,7 @@ struct symbol *Symbol_new(char *x)
     sp->prec = -1;
     sp->assoc = UNK;
     sp->firstset = 0;
-    sp->lambda = FALSE;
+    sp->lambda = BOOL_FALSE;
     sp->destructor = 0;
     sp->datatype = 0;
     Symbol_insert(sp,sp->name);