Make the "strings" pointer in a "header_field_info" structure a const
pointer, and put "const" into the casts in "VALS()" and "TFS()" macros, so we don't un-constify pointers to "value_string" arrays and "true_false_string" structures. Make some things "const" to keep the compiler happy with the previous change. svn path=/trunk/; revision=6684
This commit is contained in:
parent
acaf3c90b3
commit
7b743f7d7d
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: semcheck.c,v 1.13 2002/08/28 20:40:55 jmayer Exp $
|
||||
* $Id: semcheck.c,v 1.14 2002/11/28 01:46:14 guy Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@ethereal.com>
|
||||
|
@ -126,9 +126,9 @@ mk_uint32_fvalue(guint32 val)
|
|||
static fvalue_t*
|
||||
mk_fvalue_from_val_string(header_field_info *hfinfo, char *s)
|
||||
{
|
||||
static true_false_string default_tf = { "True", "False" };
|
||||
true_false_string *tf = &default_tf;
|
||||
value_string *vals;
|
||||
static const true_false_string default_tf = { "True", "False" };
|
||||
const true_false_string *tf = &default_tf;
|
||||
const value_string *vals;
|
||||
|
||||
/* Early return? */
|
||||
switch(hfinfo->type) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* proto.c
|
||||
* Routines for protocol tree
|
||||
*
|
||||
* $Id: proto.c,v 1.76 2002/10/15 05:29:48 guy Exp $
|
||||
* $Id: proto.c,v 1.77 2002/11/28 01:46:12 guy Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@ethereal.com>
|
||||
|
@ -2528,11 +2528,11 @@ fill_label_boolean(field_info *fi, gchar *label_str)
|
|||
guint32 value;
|
||||
|
||||
header_field_info *hfinfo = fi->hfinfo;
|
||||
static true_false_string default_tf = { "True", "False" };
|
||||
true_false_string *tfstring = &default_tf;
|
||||
static const true_false_string default_tf = { "True", "False" };
|
||||
const true_false_string *tfstring = &default_tf;
|
||||
|
||||
if (hfinfo->strings) {
|
||||
tfstring = (struct true_false_string*) hfinfo->strings;
|
||||
tfstring = (const struct true_false_string*) hfinfo->strings;
|
||||
}
|
||||
|
||||
value = fvalue_get_integer(fi->value);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* proto.h
|
||||
* Definitions for protocol display
|
||||
*
|
||||
* $Id: proto.h,v 1.36 2002/08/28 20:40:44 jmayer Exp $
|
||||
* $Id: proto.h,v 1.37 2002/11/28 01:46:12 guy Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@ethereal.com>
|
||||
|
@ -44,10 +44,10 @@ struct _value_string;
|
|||
|
||||
/* In order to make a const value_string[] look like a value_string*, I
|
||||
* need this macro */
|
||||
#define VALS(x) (struct _value_string*)(x)
|
||||
#define VALS(x) (const struct _value_string*)(x)
|
||||
|
||||
/* ... and similarly, */
|
||||
#define TFS(x) (struct true_false_string*)(x)
|
||||
#define TFS(x) (const struct true_false_string*)(x)
|
||||
|
||||
/* check protocol activation */
|
||||
#define CHECK_DISPLAY_AS_X(x_handle,index, tvb, pinfo, tree) { \
|
||||
|
@ -74,7 +74,7 @@ struct _header_field_info {
|
|||
char *abbrev;
|
||||
enum ftenum type;
|
||||
int display; /* for integers only, so far. Base */
|
||||
void *strings; /* val_string or true_false_string */
|
||||
const void *strings; /* val_string or true_false_string */
|
||||
guint32 bitmask;
|
||||
char *blurb; /* Brief description of field. */
|
||||
|
||||
|
|
Loading…
Reference in New Issue