diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2014-07-23 12:26:05 +0200 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2014-09-22 10:52:03 +0000 |
commit | 56a09d24dcdcaddae1cb67a18bbc2fd588c427ed (patch) | |
tree | a9961e4700a00680f7247d714709e6164f9e5d9d /wiretap/file_access.c | |
parent | c1d6a4123a2e100a77ae8ec2b3d01544f168febc (diff) |
Try to fix some buildbot warnings
Most interesting are:
warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
warning: ISO C forbids zero-size array [-Wpedantic]
warning: ISO C90 doesn't support unnamed structs/unions [-Wpedantic]
warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual
warning: initializer element is not computable at load time [enabled by default]
Change-Id: I5573c6bdca856a304877d9bef643f8c0fa93cdaf
Reviewed-on: https://code.wireshark.org/review/3174
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r-- | wiretap/file_access.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 0ce14727c9..6e216d8010 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -1510,10 +1510,8 @@ init_file_types_subtypes(void) /* if subtype is WTAP_FILE_TYPE_SUBTYPE_UNKNOWN, then create a new subtype as well as register it, else replace the existing entry in that spot */ -int -wtap_register_file_type_subtypes(const struct file_type_subtype_info* fi, const int subtype) -{ - struct file_type_subtype_info* finfo = NULL; +int wtap_register_file_type_subtypes(const struct file_type_subtype_info* fi, const int subtype) { + struct file_type_subtype_info* finfo; init_file_types_subtypes(); if (!fi || !fi->name || !fi->short_name || subtype > wtap_num_file_types_subtypes) { @@ -1560,10 +1558,8 @@ wtap_register_file_type_subtypes(const struct file_type_subtype_info* fi, const /* De-registers a file writer - they can never be removed from the GArray, but we can "clear" an entry. */ -void -wtap_deregister_file_type_subtype(const int subtype) -{ - struct file_type_subtype_info* finfo = NULL; +void wtap_deregister_file_type_subtype(const int subtype) { + struct file_type_subtype_info* finfo; if (subtype < 0 || subtype >= wtap_num_file_types_subtypes) { g_error("invalid file type to de-register"); |