diff options
author | Michael Mann <mmann78@netscape.net> | 2015-03-24 19:52:29 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-03-25 01:05:02 +0000 |
commit | 004cafd82bcad074dceb4f9a569897b71f7e913d (patch) | |
tree | 790a58582195a569e823aec0ca33c5d6b0d02465 | |
parent | b8b172cc342b07a5792e5cb0096f7f2f826aaa5d (diff) |
Replace HF_EMPTY and ETT_EMPTY with -1
Change-Id: If3e89f8e46edd4eef82037b6b348fd70a9a3033d
Reviewed-on: https://code.wireshark.org/review/7811
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | epan/dissectors/packet-wap.h | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-wtls.c | 152 | ||||
-rw-r--r-- | epan/dissectors/packet-wtp.c | 92 | ||||
-rwxr-xr-x | tools/checkhf.pl | 5 |
4 files changed, 124 insertions, 128 deletions
diff --git a/epan/dissectors/packet-wap.h b/epan/dissectors/packet-wap.h index ccdc9726e6..4d4c32720f 100644 --- a/epan/dissectors/packet-wap.h +++ b/epan/dissectors/packet-wap.h @@ -68,9 +68,6 @@ * the WTP and WSP dissectors are not called. */ -#define HF_EMPTY ( -1 ) -#define ETT_EMPTY ( -1 ) - /* Utility function for reading Uintvar encoded values */ guint tvb_get_guintvar (tvbuff_t *, guint , guint *); diff --git a/epan/dissectors/packet-wtls.c b/epan/dissectors/packet-wtls.c index 3907edbdc7..f558621f63 100644 --- a/epan/dissectors/packet-wtls.c +++ b/epan/dissectors/packet-wtls.c @@ -39,86 +39,86 @@ void proto_register_wtls(void); void proto_reg_handoff_wtls(void); /* File scoped variables for the protocol and registered fields */ -static int proto_wtls = HF_EMPTY; +static int proto_wtls = -1; /* These fields used by fixed part of header */ -static int hf_wtls_record = HF_EMPTY; -static int hf_wtls_record_type = HF_EMPTY; -static int hf_wtls_record_length = HF_EMPTY; -static int hf_wtls_record_sequence = HF_EMPTY; -static int hf_wtls_record_ciphered = HF_EMPTY; -static int hf_wtls_hands = HF_EMPTY; -static int hf_wtls_hands_type = HF_EMPTY; -static int hf_wtls_hands_length = HF_EMPTY; -static int hf_wtls_hands_cli_hello = HF_EMPTY; -static int hf_wtls_hands_cli_hello_version = HF_EMPTY; -static int hf_wtls_hands_cli_hello_gmt = HF_EMPTY; -static int hf_wtls_hands_cli_hello_random = HF_EMPTY; -static int hf_wtls_hands_cli_hello_session = HF_EMPTY; -static int hf_wtls_hands_cli_hello_session_str = HF_EMPTY; -static int hf_wtls_hands_cli_hello_cli_key_id = HF_EMPTY; -static int hf_wtls_hands_cli_hello_cli_key_len = HF_EMPTY; -static int hf_wtls_hands_cli_hello_trust_key_id = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_exchange = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_exchange_suite = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_parameter_index = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_parameter_set = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_identifier_type = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_identifier_charset = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_identifier_size = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_identifier = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_identifier_str = HF_EMPTY; -static int hf_wtls_hands_cli_hello_cipher_suite = HF_EMPTY; -static int hf_wtls_hands_cli_hello_cipher_suite_item = HF_EMPTY; -static int hf_wtls_hands_cli_hello_compression_methods = HF_EMPTY; -static int hf_wtls_hands_cli_hello_compression = HF_EMPTY; -static int hf_wtls_hands_cli_hello_sequence_mode = HF_EMPTY; -static int hf_wtls_hands_cli_hello_key_refresh = HF_EMPTY; -static int hf_wtls_hands_serv_hello = HF_EMPTY; -static int hf_wtls_hands_serv_hello_version = HF_EMPTY; -static int hf_wtls_hands_serv_hello_gmt = HF_EMPTY; -static int hf_wtls_hands_serv_hello_random = HF_EMPTY; -static int hf_wtls_hands_serv_hello_session = HF_EMPTY; -static int hf_wtls_hands_serv_hello_session_str = HF_EMPTY; -static int hf_wtls_hands_serv_hello_cli_key_id = HF_EMPTY; -static int hf_wtls_hands_serv_hello_cipher_suite_item = HF_EMPTY; -static int hf_wtls_hands_serv_hello_cipher_bulk = HF_EMPTY; -static int hf_wtls_hands_serv_hello_cipher_mac = HF_EMPTY; -static int hf_wtls_hands_serv_hello_compression = HF_EMPTY; -static int hf_wtls_hands_serv_hello_sequence_mode = HF_EMPTY; -static int hf_wtls_hands_serv_hello_key_refresh = HF_EMPTY; -static int hf_wtls_hands_certificates = HF_EMPTY; -static int hf_wtls_hands_certificate = HF_EMPTY; -static int hf_wtls_hands_certificate_type = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_version = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_signature_type = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_issuer_type = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_issuer_charset = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_issuer_size = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_issuer_name = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_valid_not_before = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_valid_not_after = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_subject_type = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_subject_charset = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_subject_size = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_subject_name = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_public_key_type = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_key_parameter_index = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_key_parameter_set = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_rsa_exponent = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_rsa_modules = HF_EMPTY; -static int hf_wtls_hands_certificate_wtls_signature = HF_EMPTY; -static int hf_wtls_alert = HF_EMPTY; -static int hf_wtls_alert_level = HF_EMPTY; -static int hf_wtls_alert_description = HF_EMPTY; +static int hf_wtls_record = -1; +static int hf_wtls_record_type = -1; +static int hf_wtls_record_length = -1; +static int hf_wtls_record_sequence = -1; +static int hf_wtls_record_ciphered = -1; +static int hf_wtls_hands = -1; +static int hf_wtls_hands_type = -1; +static int hf_wtls_hands_length = -1; +static int hf_wtls_hands_cli_hello = -1; +static int hf_wtls_hands_cli_hello_version = -1; +static int hf_wtls_hands_cli_hello_gmt = -1; +static int hf_wtls_hands_cli_hello_random = -1; +static int hf_wtls_hands_cli_hello_session = -1; +static int hf_wtls_hands_cli_hello_session_str = -1; +static int hf_wtls_hands_cli_hello_cli_key_id = -1; +static int hf_wtls_hands_cli_hello_cli_key_len = -1; +static int hf_wtls_hands_cli_hello_trust_key_id = -1; +static int hf_wtls_hands_cli_hello_key_exchange = -1; +static int hf_wtls_hands_cli_hello_key_exchange_suite = -1; +static int hf_wtls_hands_cli_hello_key_parameter_index = -1; +static int hf_wtls_hands_cli_hello_key_parameter_set = -1; +static int hf_wtls_hands_cli_hello_key_identifier_type = -1; +static int hf_wtls_hands_cli_hello_key_identifier_charset = -1; +static int hf_wtls_hands_cli_hello_key_identifier_size = -1; +static int hf_wtls_hands_cli_hello_key_identifier = -1; +static int hf_wtls_hands_cli_hello_key_identifier_str = -1; +static int hf_wtls_hands_cli_hello_cipher_suite = -1; +static int hf_wtls_hands_cli_hello_cipher_suite_item = -1; +static int hf_wtls_hands_cli_hello_compression_methods = -1; +static int hf_wtls_hands_cli_hello_compression = -1; +static int hf_wtls_hands_cli_hello_sequence_mode = -1; +static int hf_wtls_hands_cli_hello_key_refresh = -1; +static int hf_wtls_hands_serv_hello = -1; +static int hf_wtls_hands_serv_hello_version = -1; +static int hf_wtls_hands_serv_hello_gmt = -1; +static int hf_wtls_hands_serv_hello_random = -1; +static int hf_wtls_hands_serv_hello_session = -1; +static int hf_wtls_hands_serv_hello_session_str = -1; +static int hf_wtls_hands_serv_hello_cli_key_id = -1; +static int hf_wtls_hands_serv_hello_cipher_suite_item = -1; +static int hf_wtls_hands_serv_hello_cipher_bulk = -1; +static int hf_wtls_hands_serv_hello_cipher_mac = -1; +static int hf_wtls_hands_serv_hello_compression = -1; +static int hf_wtls_hands_serv_hello_sequence_mode = -1; +static int hf_wtls_hands_serv_hello_key_refresh = -1; +static int hf_wtls_hands_certificates = -1; +static int hf_wtls_hands_certificate = -1; +static int hf_wtls_hands_certificate_type = -1; +static int hf_wtls_hands_certificate_wtls_version = -1; +static int hf_wtls_hands_certificate_wtls_signature_type = -1; +static int hf_wtls_hands_certificate_wtls_issuer_type = -1; +static int hf_wtls_hands_certificate_wtls_issuer_charset = -1; +static int hf_wtls_hands_certificate_wtls_issuer_size = -1; +static int hf_wtls_hands_certificate_wtls_issuer_name = -1; +static int hf_wtls_hands_certificate_wtls_valid_not_before = -1; +static int hf_wtls_hands_certificate_wtls_valid_not_after = -1; +static int hf_wtls_hands_certificate_wtls_subject_type = -1; +static int hf_wtls_hands_certificate_wtls_subject_charset = -1; +static int hf_wtls_hands_certificate_wtls_subject_size = -1; +static int hf_wtls_hands_certificate_wtls_subject_name = -1; +static int hf_wtls_hands_certificate_wtls_public_key_type = -1; +static int hf_wtls_hands_certificate_wtls_key_parameter_index = -1; +static int hf_wtls_hands_certificate_wtls_key_parameter_set = -1; +static int hf_wtls_hands_certificate_wtls_rsa_exponent = -1; +static int hf_wtls_hands_certificate_wtls_rsa_modules = -1; +static int hf_wtls_hands_certificate_wtls_signature = -1; +static int hf_wtls_alert = -1; +static int hf_wtls_alert_level = -1; +static int hf_wtls_alert_description = -1; /* Initialize the subtree pointers */ -static gint ett_wtls = ETT_EMPTY; -static gint ett_wtls_rec = ETT_EMPTY; -static gint ett_wtls_msg_type = ETT_EMPTY; -static gint ett_wtls_msg_type_item = ETT_EMPTY; -static gint ett_wtls_msg_type_item_sub = ETT_EMPTY; -static gint ett_wtls_msg_type_item_sub_sub = ETT_EMPTY; +static gint ett_wtls = -1; +static gint ett_wtls_rec = -1; +static gint ett_wtls_msg_type = -1; +static gint ett_wtls_msg_type_item = -1; +static gint ett_wtls_msg_type_item_sub = -1; +static gint ett_wtls_msg_type_item_sub_sub = -1; static const value_string wtls_vals_record_type[] = { { 1, "change_cipher_data" }, diff --git a/epan/dissectors/packet-wtp.c b/epan/dissectors/packet-wtp.c index 498371a27d..4ca431b9d4 100644 --- a/epan/dissectors/packet-wtp.c +++ b/epan/dissectors/packet-wtp.c @@ -146,60 +146,60 @@ static const value_string vals_tpi_opt[] = { }; /* File scoped variables for the protocol and registered fields */ -static int proto_wtp = HF_EMPTY; +static int proto_wtp = -1; /* These fields used by fixed part of header */ -static int hf_wtp_header_sub_pdu_size = HF_EMPTY; -static int hf_wtp_header_flag_continue = HF_EMPTY; -static int hf_wtp_header_pdu_type = HF_EMPTY; -static int hf_wtp_header_flag_Trailer = HF_EMPTY; -static int hf_wtp_header_flag_RID = HF_EMPTY; -static int hf_wtp_header_flag_TID = HF_EMPTY; -static int hf_wtp_header_flag_TID_response = HF_EMPTY; +static int hf_wtp_header_sub_pdu_size = -1; +static int hf_wtp_header_flag_continue = -1; +static int hf_wtp_header_pdu_type = -1; +static int hf_wtp_header_flag_Trailer = -1; +static int hf_wtp_header_flag_RID = -1; +static int hf_wtp_header_flag_TID = -1; +static int hf_wtp_header_flag_TID_response = -1; /* These fields used by Invoke packets */ -static int hf_wtp_header_Inv_version = HF_EMPTY; -static int hf_wtp_header_Inv_flag_TIDNew = HF_EMPTY; -static int hf_wtp_header_Inv_flag_UP = HF_EMPTY; -static int hf_wtp_header_Inv_Reserved = HF_EMPTY; -static int hf_wtp_header_Inv_TransactionClass = HF_EMPTY; - -/* static int hf_wtp_header_variable_part = HF_EMPTY; */ -/* static int hf_wtp_data = HF_EMPTY; */ - -static int hf_wtp_tpi_type = HF_EMPTY; -static int hf_wtp_tpi_psn = HF_EMPTY; -static int hf_wtp_tpi_opt = HF_EMPTY; -static int hf_wtp_tpi_optval = HF_EMPTY; -static int hf_wtp_tpi_info = HF_EMPTY; - -static int hf_wtp_header_Ack_flag_TVETOK = HF_EMPTY; -static int hf_wtp_header_Abort_type = HF_EMPTY; -static int hf_wtp_header_Abort_reason_provider = HF_EMPTY; -static int hf_wtp_header_Abort_reason_user = HF_EMPTY; -static int hf_wtp_header_sequence_number = HF_EMPTY; -static int hf_wtp_header_missing_packets = HF_EMPTY; -static int hf_wtp_payload = HF_EMPTY; +static int hf_wtp_header_Inv_version = -1; +static int hf_wtp_header_Inv_flag_TIDNew = -1; +static int hf_wtp_header_Inv_flag_UP = -1; +static int hf_wtp_header_Inv_Reserved = -1; +static int hf_wtp_header_Inv_TransactionClass = -1; + +/* static int hf_wtp_header_variable_part = -1; */ +/* static int hf_wtp_data = -1; */ + +static int hf_wtp_tpi_type = -1; +static int hf_wtp_tpi_psn = -1; +static int hf_wtp_tpi_opt = -1; +static int hf_wtp_tpi_optval = -1; +static int hf_wtp_tpi_info = -1; + +static int hf_wtp_header_Ack_flag_TVETOK = -1; +static int hf_wtp_header_Abort_type = -1; +static int hf_wtp_header_Abort_reason_provider = -1; +static int hf_wtp_header_Abort_reason_user = -1; +static int hf_wtp_header_sequence_number = -1; +static int hf_wtp_header_missing_packets = -1; +static int hf_wtp_payload = -1; /* These fields used when reassembling WTP fragments */ -static int hf_wtp_fragments = HF_EMPTY; -static int hf_wtp_fragment = HF_EMPTY; -static int hf_wtp_fragment_overlap = HF_EMPTY; -static int hf_wtp_fragment_overlap_conflict = HF_EMPTY; -static int hf_wtp_fragment_multiple_tails = HF_EMPTY; -static int hf_wtp_fragment_too_long_fragment = HF_EMPTY; -static int hf_wtp_fragment_error = HF_EMPTY; -static int hf_wtp_fragment_count = HF_EMPTY; -static int hf_wtp_reassembled_in = HF_EMPTY; -static int hf_wtp_reassembled_length = HF_EMPTY; +static int hf_wtp_fragments = -1; +static int hf_wtp_fragment = -1; +static int hf_wtp_fragment_overlap = -1; +static int hf_wtp_fragment_overlap_conflict = -1; +static int hf_wtp_fragment_multiple_tails = -1; +static int hf_wtp_fragment_too_long_fragment = -1; +static int hf_wtp_fragment_error = -1; +static int hf_wtp_fragment_count = -1; +static int hf_wtp_reassembled_in = -1; +static int hf_wtp_reassembled_length = -1; /* Initialize the subtree pointers */ -static gint ett_wtp = ETT_EMPTY; -static gint ett_wtp_sub_pdu_tree = ETT_EMPTY; -static gint ett_header = ETT_EMPTY; -static gint ett_tpilist = ETT_EMPTY; -static gint ett_wsp_fragments = ETT_EMPTY; -static gint ett_wtp_fragment = ETT_EMPTY; +static gint ett_wtp = -1; +static gint ett_wtp_sub_pdu_tree = -1; +static gint ett_header = -1; +static gint ett_tpilist = -1; +static gint ett_wsp_fragments = -1; +static gint ett_wtp_fragment = -1; static const fragment_items wtp_frag_items = { &ett_wtp_fragment, diff --git a/tools/checkhf.pl b/tools/checkhf.pl index aeec1982bc..21e4e2fb30 100755 --- a/tools/checkhf.pl +++ b/tools/checkhf.pl @@ -362,7 +362,6 @@ sub find_remove_hf_defs { # Build pattern to match any of the following # static? g?int hf_foo = -1; - # static? g?int hf_foo = HF_EMPTY; # static? g?int hf_foo[xxx]; # static? g?int hf_foo[xxx] = { @@ -376,11 +375,11 @@ sub find_remove_hf_defs { (hf_[a-zA-Z0-9_]+) # hf_.. }xmso; - # p2a: ' = -1;' or ' = HF_EMPTY;' + # p2a: ' = -1;' my $p2a_regex = qr{ \s* = \s* (?: - - \s* 1 | HF_EMPTY + - \s* 1 ) \s* ; }xmso; |