Add VALS_EXT_PTR to decorate pointers to value_string_ext's in hfinfo.

This allows checkAPIs to continue checking the 'convert' field for correctness
when dissectors use value_string_ext_new() to build their value_string_ext's
(without resorting to tricks like getting the address of the dereferenced
pointer).

This will be used to resolve the checkAPIs failure in patch set 3 of
Ia5c96b1f6f1fe3a9521b3d70142889e3881fae5e .

Change-Id: I700d86b9076f077706d34000f5a6aa5c96351f69
Reviewed-on: https://code.wireshark.org/review/8162
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Jeff Morriss 2015-04-21 10:17:27 -04:00 committed by Anders Broman
parent 4461f7271d
commit 97499c1f25
2 changed files with 4 additions and 1 deletions

View File

@ -78,6 +78,9 @@ struct expert_field;
/** Make a const val64_string[] look like a _val64_string pointer, used to set header_field_info.strings */
#define VALS64(x) (const struct _val64_string*)(x)
/** Something to satisfy checkAPIs when you have a pointer to a value_string_ext (e.g., one built with value_string_ext_new()) */
#define VALS_EXT_PTR(x) (x)
/** Make a const true_false_string[] look like a _true_false_string pointer, used to set header_field_info.strings */
#define TFS(x) (const struct true_false_string*)(x)

View File

@ -1817,7 +1817,7 @@ sub check_hf_entries($$)
print STDERR "Error: $hf is passing the address of a pointer to RVALS in $filename\n";
$errorCount++;
}
if ($convert !~ m/^((0[xX]0?)?0$|NULL$|VALS|VALS64|RVALS|TFS|CF_FUNC|FRAMENUM_TYPE|&)/ && $display !~ /BASE_CUSTOM/) {
if ($convert !~ m/^((0[xX]0?)?0$|NULL$|VALS|VALS64|VALS_EXT_PTR|RVALS|TFS|CF_FUNC|FRAMENUM_TYPE|&)/ && $display !~ /BASE_CUSTOM/) {
print STDERR "Error: non-null $hf 'convert' field missing 'VALS|VALS64|RVALS|TFS|CF_FUNC|FRAMENUM_TYPE|&' in $filename ?\n";
$errorCount++;
}