aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-xmpp-utils.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
committerGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
commit8ed7a73e22c049a2e013bb436e599bff41fc5b9b (patch)
treead4a4cc6fb4ff4d3e3ffe3a3f8e3d056e441ae46 /epan/dissectors/packet-xmpp-utils.h
parent8ede6b7dc09aa636f87147ab432a137c209e8aca (diff)
Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
Diffstat (limited to 'epan/dissectors/packet-xmpp-utils.h')
-rw-r--r--epan/dissectors/packet-xmpp-utils.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-xmpp-utils.h b/epan/dissectors/packet-xmpp-utils.h
index 99e8079692..2addfe4509 100644
--- a/epan/dissectors/packet-xmpp-utils.h
+++ b/epan/dissectors/packet-xmpp-utils.h
@@ -36,8 +36,8 @@ typedef struct _xmpp_array_t
} xmpp_array_t;
typedef struct _xmpp_attr_t{
- gchar *value;
- gchar *name;
+ const gchar *value;
+ const gchar *name;
gint offset;
gint length;
@@ -72,19 +72,19 @@ typedef struct _xmpp_element_t{
/*informations about attributes that are displayed in proto tree*/
typedef struct _xmpp_attr_info{
- gchar *name;
+ const gchar *name;
gint hf;
gboolean is_required;
gboolean in_short_list;
/*function validates this attribute
it may impose other restrictions (e.g. validating atribut's name, ...)*/
- void (*val_func)(packet_info *pinfo, proto_item *item, gchar *name, gchar *value, gpointer data);
+ void (*val_func)(packet_info *pinfo, proto_item *item, const gchar *name, const gchar *value, gconstpointer data);
gpointer data;
} xmpp_attr_info;
typedef struct _xmpp_attr_info_ext{
- gchar* ns;
+ const gchar* ns;
xmpp_attr_info info;
} xmpp_attr_info_ext;
@@ -103,7 +103,7 @@ typedef enum _xmpp_elem_info_occurrence
/*informations about elements that are displayed in proto tree*/
typedef struct _xmpp_elem_info{
xmpp_elem_info_type type;
- gpointer data;
+ gconstpointer data;
/*function that displays element in tree*/
void (*elem_func)(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
xmpp_elem_info_occurrence occurrence;
@@ -181,7 +181,7 @@ extern void xmpp_element_t_tree_free(xmpp_element_t *root);
extern xmpp_array_t* xmpp_ep_init_array_t(const gchar** array, gint len);
/*Allocs ephemeral memory for xmpp_attr_t struct*/
-extern xmpp_attr_t* xmpp_ep_init_attr_t(gchar *value, gint offset, gint length);
+extern xmpp_attr_t* xmpp_ep_init_attr_t(const gchar *value, gint offset, gint length);
/*Allocs ephemeral memory for upcased string*/
extern gchar* xmpp_ep_string_upcase(const gchar* string);
@@ -224,7 +224,7 @@ extern void xmpp_proto_tree_show_first_child(proto_tree *tree);
extern gchar* proto_item_get_text(proto_item *item);
/*Function returns struct that contains 3 strings. It is used to build xmpp_attr_info struct.*/
-extern gpointer xmpp_name_attr_struct(gchar *name, gchar *attr_name, gchar *attr_value);
+extern gpointer xmpp_name_attr_struct(const gchar *name, const gchar *attr_name, const gchar *attr_value);
/** Function displays attributes from element in way described in attrs.
* Elements that doesn't exist in attrs are displayed as text.
@@ -258,7 +258,7 @@ extern void xmpp_display_elems(proto_tree *tree, xmpp_element_t *parent, packet_
/* Validates attribute value. Takes string array(gchar**) in parameter data.
* Is used in XMPP_ATTR_INFO struct.
*/
-extern void xmpp_val_enum_list(packet_info *pinfo, proto_item *item, gchar *name, gchar *value, gpointer data);
+extern void xmpp_val_enum_list(packet_info *pinfo, proto_item *item, const gchar *name, const gchar *value, gconstpointer data);
/** Function changes element to attribute. It searches element by name in parent element,
* next it create attribute using transform_func and inserts it to parent attributes hash table