Wireshark-dev: Re: [Wireshark-dev] UAT_FLD_VS and const value_string

From: "Maynard, Chris" <Christopher.Maynard@xxxxxxxxx>
Date: Mon, 20 Apr 2009 12:51:14 -0400
Either of the attached patches to epan/uat.h seem to work.  I'm thinking
that the 1st one is probably the better one to use though, but it's your
call.

- Chris

> -----Original Message-----
> From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-
> bounces@xxxxxxxxxxxxx] On Behalf Of Jaap Keuter
> Sent: Monday, April 20, 2009 6:35 AM
> To: Developer support list for Wireshark
> Subject: [Wireshark-dev] UAT_FLD_VS and const value_string
> 
> Hi,
> 
> I wonder why for UAT_FLD_VS entries of a UAT there can not contain
> 'const value_string*', just 'value_string*'  ?
> This now breaks the Win buildbots, and I want to be sure which way the
> fix should go.
> 
> Thanx,
> Jaap
> 
> Sent from my iPhone
>
_______________________________________________________________________
> ____
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>              mailto:wireshark-dev-
> request@xxxxxxxxxxxxx?subject=unsubscribe
CONFIDENTIALITY NOTICE: The contents of this email are confidential
and for the exclusive use of the intended recipient. If you receive this
email in error, please delete it from your system immediately and 
notify us either by email, telephone or fax. You should not copy,
forward, or otherwise disclose the content of the email.
--- svn/epan/uat.h	2009-03-19 21:01:40.896058900 -0400
+++ vs2008ee/epan/uat.h	2009-04-20 12:44:38.813313600 -0400
@@ -444,7 +444,7 @@
 
 
 #define UAT_FLD_VS(basename,field_name,title,enum,desc) \
-	{#field_name, title, PT_TXTMOD_ENUM,{uat_fld_chk_enum,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{&(enum),&(enum),&(enum)},&(enum),desc,FLDFILL}
+	{#field_name, title, PT_TXTMOD_ENUM,{uat_fld_chk_enum,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{(void *)&(enum),(void *)&(enum),(void *)&(enum)},(void *)&(enum),desc,FLDFILL}
 
 
 /*
--- svn/epan/uat.h	2009-03-19 21:01:40.896058900 -0400
+++ vs2008ee/epan/uat.h	2009-04-20 12:38:14.340468800 -0400
@@ -188,12 +188,12 @@
 	} cb;
 
 	struct {
-		void* chk;
-		void* set;
-		void* tostr;
+		const void* chk;
+		const void* set;
+		const void* tostr;
 	} cbdata;
 
-	void* fld_data;
+	const void* fld_data;
 
 	const char* desc;
 	struct _fld_data_t* priv;