Make various "value_string" tables "const"; this allows the compiler to
authorGuy Harris <guy@alum.mit.edu>
Fri, 19 Nov 1999 23:23:41 +0000 (23:23 -0000)
committerGuy Harris <guy@alum.mit.edu>
Fri, 19 Nov 1999 23:23:41 +0000 (23:23 -0000)
stuff them into shared read-only space.

Put the "VALS()" cast macro into the initialization of an
"hf_register_info" array.

svn path=/trunk/; revision=1072

packet-mount.c
packet-rpc.c
packet-rpc.h

index d1051c844415e0eeacdfd4b761f72e17064e91ca..26e99433e03e7f55673a67a3c4e8da14a1b837f0 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-mount.c
  * Routines for mount dissection
  *
- * $Id: packet-mount.c,v 1.5 1999/11/19 13:09:55 gram Exp $
+ * $Id: packet-mount.c,v 1.6 1999/11/19 23:23:41 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@unicom.net>
@@ -80,7 +80,7 @@ const vsff mount1_proc[] = {
 
 
 /* RFC 1813, Page 107 */
-const value_string mount3_mountstat3[] = 
+static const value_string mount3_mountstat3[] = 
 {
        {       0,      "OK" },
        {       1,      "ERR_PERM" },
@@ -177,13 +177,13 @@ proto_register_mount(void)
                        NULL, 0, "Path" }},
                { &hf_mount_status, {
                        "Status", "mount.status", FT_UINT32, BASE_DEC,
-                       mount3_mountstat3, 0, "Status" }},
+                       VALS(mount3_mountstat3), 0, "Status" }},
                { &hf_mount_flavors, {
                        "Flavors", "mount.flavors", FT_UINT32, BASE_DEC,
                        NULL, 0, "Flavors" }},
                { &hf_mount_flavor, {
                        "Flavor", "mount.flavor", FT_UINT32, BASE_DEC,
-                       rpc_auth_flavor, 0, "Flavor" }},
+                       VALS(rpc_auth_flavor), 0, "Flavor" }},
        };
        static gint *ett[] = {
                &ett_mount,
@@ -199,4 +199,3 @@ proto_register_mount(void)
        rpc_init_proc_table(MOUNT_PROGRAM, 1, mount1_proc);
        rpc_init_proc_table(MOUNT_PROGRAM, 3, mount3_proc);
 }
-
index b97eca666abbdfcb21b895bf34891d36ac52f370..91f4b1cf87c688e7f91e6c2250e2edc1fe0c2f32 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for rpc dissection
  * Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
  * 
- * $Id: packet-rpc.c,v 1.18 1999/11/19 13:09:56 gram Exp $
+ * $Id: packet-rpc.c,v 1.19 1999/11/19 23:23:40 guy Exp $
  * 
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@unicom.net>
@@ -59,7 +59,7 @@ static const value_string rpc_reply_state[3] = {
        { 0, NULL }
 };
 
-value_string rpc_auth_flavor[] = {
+const value_string rpc_auth_flavor[] = {
        { AUTH_NULL, "AUTH_NULL" },
        { AUTH_UNIX, "AUTH_UNIX" },
        { AUTH_SHORT, "AUTH_SHORT" },
index 0f8521c897720f8ebbd2ca0dc356481c53a456cb..40d90f5cada6110fe46f853f2faf40d87d5e2e63 100644 (file)
@@ -1,5 +1,5 @@
 /* packet-rpc.h (c) 1999 Uwe Girlich */
-/* $Id: packet-rpc.h,v 1.8 1999/11/19 13:09:56 gram Exp $ */
+/* $Id: packet-rpc.h,v 1.9 1999/11/19 23:23:41 guy Exp $ */
 
 #ifndef __PACKET_RPC_H__
 #define __PACKET_RPC_H__
@@ -84,7 +84,7 @@ typedef struct _rpc_call_info {
 
 #define RPC_CALL_TABLE_LENGTH 1000
 
-extern value_string rpc_auth_flavor[];
+extern const value_string rpc_auth_flavor[];
 
 extern void rpc_call_insert(rpc_call_info *call);
 extern rpc_call_info* rpc_call_lookup(rpc_call_info *call);