diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-04-12 13:25:26 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-04-22 04:42:46 +0000 |
commit | 63202728696faa6c2e7ecb88f49947d54709d5a2 (patch) | |
tree | 229b0f9f24aa6cef7d5275bb68f9aff229bf78be /epan/dissectors/packet-ansi_a.c | |
parent | 493f6e223b8b554c96922b6f8c47f8b45992bf28 (diff) |
ansi: make ett array static.
Change-Id: I1ba044feb581cd00c928269c02555d31970e9a42
Reviewed-on: https://code.wireshark.org/review/14891
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ansi_a.c')
-rw-r--r-- | epan/dissectors/packet-ansi_a.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c index ee02a99708..59079c73a1 100644 --- a/epan/dissectors/packet-ansi_a.c +++ b/epan/dissectors/packet-ansi_a.c @@ -12749,8 +12749,7 @@ proto_register_ansi_a(void) #define MAX_NUM_BSMAP_MSG MAX(ANSI_A_IOS401_BSMAP_NUM_MSG, ANSI_A_IOS501_BSMAP_NUM_MSG) #define MAX_NUM_ELEM_1 MAX(MAX_IOS401_NUM_ELEM_1, MAX_IOS501_NUM_ELEM_1) #define NUM_INDIVIDUAL_ELEMS 24 - gint **ett; - gint ett_len = (NUM_INDIVIDUAL_ELEMS+MAX_NUM_DTAP_MSG+MAX_NUM_BSMAP_MSG+MAX_NUM_ELEM_1+NUM_FWD_MS_INFO_REC+NUM_REV_MS_INFO_REC) * sizeof(gint *); + gint *ett[NUM_INDIVIDUAL_ELEMS+MAX_NUM_DTAP_MSG+MAX_NUM_BSMAP_MSG+MAX_NUM_ELEM_1+NUM_FWD_MS_INFO_REC+NUM_REV_MS_INFO_REC]; static stat_tap_table_ui dtap_stat_table = { REGISTER_STAT_GROUP_TELEPHONY_ANSI, @@ -12782,15 +12781,6 @@ proto_register_ansi_a(void) NULL }; - /* - * XXX - at least one version of the HP C compiler apparently doesn't - * recognize constant expressions using the "?" operator as being - * constant expressions, so you can't use the expression that - * initializes "ett_let" as an array size. Therefore, we dynamically - * allocate the array instead. - */ - ett = (gint **) g_malloc(ett_len); - memset((void *) ett_dtap_msg, -1, sizeof(ett_dtap_msg)); memset((void *) ett_bsmap_msg, -1, sizeof(ett_bsmap_msg)); memset((void *) ett_ansi_elem_1, -1, sizeof(ett_ansi_elem_1)); @@ -12874,7 +12864,7 @@ proto_register_ansi_a(void) register_dissector_table("ansi_a.pld", "IS-801 (PLD)", proto_a_bsmap, FT_UINT8, BASE_DEC, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE); - proto_register_subtree_array(ett, ett_len / (int) sizeof(gint *)); + proto_register_subtree_array(ett, array_length(ett)); ansi_a_tap = register_tap("ansi_a"); @@ -12897,8 +12887,6 @@ proto_register_ansi_a(void) "Whether the mobile ID and service options are displayed in the INFO column", &global_a_info_display); - g_free(ett); - register_stat_tap_table_ui(&dtap_stat_table); register_stat_tap_table_ui(&bsmap_stat_table); } |