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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6684
f5534014-38df-0310-8fa8-
9805f1628bb7
/*
- * $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>
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) {
/* 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>
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);
/* 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>
/* 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) { \
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. */