From Graeme Hewson:

Use gint32 instead of guint32 for node data.

Fix up some other signed-vs-unsigned issues in the display filter
parser and lexical analyzer.

svn path=/trunk/; revision=11085
This commit is contained in:
Guy Harris 2004-06-03 07:36:25 +00:00
parent e6e3ff60f5
commit e1e690ff3a
4 changed files with 13 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $Id: grammar.lemon,v 1.9 2004/02/27 12:00:30 obiot Exp $ */
/* $Id: grammar.lemon,v 1.10 2004/06/03 07:36:24 guy Exp $ */
%include {
#ifdef HAVE_CONFIG_H
@ -76,7 +76,7 @@ any "error" symbols are shifted, if possible. */
stnode_data(TOKEN));
break;
case STTYPE_INTEGER:
dfilter_fail("The integer %u was unexpected in this context.",
dfilter_fail("The integer %d was unexpected in this context.",
stnode_value(TOKEN));
break;
case STTYPE_FIELD:

View File

@ -1,6 +1,6 @@
%{
/*
* $Id: scanner.l,v 1.19 2004/06/03 07:17:24 guy Exp $
* $Id: scanner.l,v 1.20 2004/06/03 07:36:24 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -299,7 +299,7 @@ static int
set_lval_int(int token, char *s)
{
sttype_id_t type_id = STTYPE_UNINITIALIZED;
guint32 val;
gint32 val;
if (!str_to_gint32(s, &val)) {
return SCAN_FAILED;

View File

@ -1,11 +1,10 @@
/*
* $Id: syntax-tree.c,v 1.5 2002/08/28 20:40:56 jmayer Exp $
* $Id: syntax-tree.c,v 1.6 2004/06/03 07:36:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* By Gerald Combs <gerald@ethereal.com>
* Copyright 2001 Gerald Combs
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@ -141,7 +140,7 @@ stnode_init(stnode_t *node, sttype_id_t type_id, gpointer data)
}
void
stnode_init_int(stnode_t *node, sttype_id_t type_id, guint32 value)
stnode_init_int(stnode_t *node, sttype_id_t type_id, gint32 value)
{
stnode_init(node, type_id, NULL);
node->value = value;
@ -189,7 +188,7 @@ stnode_data(stnode_t *node)
return node->data;
}
guint32
gint32
stnode_value(stnode_t *node)
{
assert_magic(node, STNODE_MAGIC);

View File

@ -1,11 +1,10 @@
/*
* $Id: syntax-tree.h,v 1.5 2003/07/25 03:44:01 gram Exp $
* $Id: syntax-tree.h,v 1.6 2004/06/03 07:36:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* By Gerald Combs <gerald@ethereal.com>
* Copyright 2001 Gerald Combs
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@ -59,7 +58,7 @@ typedef struct {
/* This could be made an enum, but I haven't
* set aside to time to do so. */
gpointer data;
guint32 value;
gint32 value;
} stnode_t;
void
@ -78,7 +77,7 @@ void
stnode_init(stnode_t *node, sttype_id_t type_id, gpointer data);
void
stnode_init_int(stnode_t *node, sttype_id_t type_id, guint32 value);
stnode_init_int(stnode_t *node, sttype_id_t type_id, gint32 value);
void
stnode_free(stnode_t *node);
@ -92,7 +91,7 @@ stnode_type_id(stnode_t *node);
gpointer
stnode_data(stnode_t *node);
guint32
gint32
stnode_value(stnode_t *node);
#define assert_magic(obj, mnum) \