aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-epl-profile-parser.c
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2017-06-02 06:12:31 +0200
committerGuy Harris <guy@alum.mit.edu>2017-06-02 07:42:11 +0000
commit5a06efc29d8a850571ca7cee16437900f3694fbb (patch)
tree1a4f447d7277a9acce1bbf1dcaf477555facb607 /epan/dissectors/packet-epl-profile-parser.c
parentae1aed917bc856f391bbfc8786923c31de6097b9 (diff)
packet-epl.c: Fixup missing initializer warnings
macOS Buildbot doesn't like {0} (probably because GNU C already provides {} exactly for the purpose of initializing all members to zero/NULL/0.0.. etc) Affected local type definitions now have a static intializer macro that uses the correct amount of zeroes and braces (similar to PTHREAD_MUTEX_INITIALIZER) Global type definitions have a memset to zero (Which isn't strictly correct, but as the platforms we support all have all-bits-zero-nulls and IEEE 754 floats, it should be good enough. A separate change will attempt to disable -Wmissing-field-initializers -Wmissing-braces globally and hopefully make these workarounds unnecessary. Change-Id: I30b0f679bbb8adb2dd7269c9f3bc19732e48212b Reviewed-on: https://code.wireshark.org/review/21887 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-epl-profile-parser.c')
-rw-r--r--epan/dissectors/packet-epl-profile-parser.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/epan/dissectors/packet-epl-profile-parser.c b/epan/dissectors/packet-epl-profile-parser.c
index 7ac6d2a1e3..65eadcb2cf 100644
--- a/epan/dissectors/packet-epl-profile-parser.c
+++ b/epan/dissectors/packet-epl-profile-parser.c
@@ -234,7 +234,7 @@ epl_eds_load(struct profile *profile, const char *eds_file)
const char *endptr;
guint16 idx = 0, datatype;
struct object *obj = NULL;
- struct od_entry tmpobj = {0};
+ struct od_entry tmpobj = OD_ENTRY_INITIALIZER;
gboolean is_object = TRUE;
if (!g_ascii_isxdigit(**group))
@@ -282,7 +282,10 @@ epl_eds_load(struct profile *profile, const char *eds_file)
}
else
{ /* Object already there, let's add subindices */
- struct subobject subobj = {0};
+ struct subobject subobj;
+
+ memset(&subobj, 0, sizeof subobj);
+
if (!obj->subindices)
{
obj->subindices = epl_wmem_iarray_new(
@@ -537,7 +540,7 @@ populate_object_list(xmlNodeSetPtr nodes, void *_profile)
for(i = 0; i < nodes->nodeNr; ++i)
{
xmlNodePtr cur = nodes->nodeTab[i];
- struct od_entry tmpobj = {0};
+ struct od_entry tmpobj = OD_ENTRY_INITIALIZER;
if (!nodes->nodeTab[i] || nodes->nodeTab[i]->type != XML_ELEMENT_NODE)
continue;
@@ -552,7 +555,9 @@ populate_object_list(xmlNodeSetPtr nodes, void *_profile)
if (tmpobj.type_class == OD_ENTRY_ARRAY || tmpobj.type_class == OD_ENTRY_RECORD)
{
xmlNode *subcur;
- struct subobject subobj = {0};
+ struct subobject subobj;
+
+ memset(&subobj, 0, sizeof subobj);
obj->subindices = epl_wmem_iarray_new(profile->scope, sizeof (struct subobject), subobject_equal);