aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-10-04 16:27:02 +0200
committerGuy Harris <guy@alum.mit.edu>2015-10-05 07:57:14 +0000
commit6d7b29592aa9cac3f10823ea8f33b18893707e83 (patch)
treeed599a42e0ead9d89bf8942e0d32c976272d7036 /asn1
parent5b1d142f52ab8f89f558ab18788637d3eefdd2bb (diff)
Allow use of variadic macros
Remove variadic macros restriction (c99, c++11 feature) from README.developer. GCC, Clang, MSVC 2005 all support it. Enable -Wno-variadic-macros in configure.ac and CMakeLists.txt when -Wpedantic is enabled (which would enable -Wvariadic-macros). For all files matching 'define\s*\w+[0-9]\(', replace "FOO[0-9]" by "FOO" and adjust the macro definition accordingly. The nbap dissector was regenerated after adjusting its template and .cnf file. The generated code is the same since all files disabled the debug macros. Discussed at: https://www.wireshark.org/lists/wireshark-dev/201209/msg00142.html https://www.wireshark.org/lists/wireshark-dev/201510/msg00012.html Change-Id: I3b2e22487db817cbbaac774a592669a4f44314b2 Reviewed-on: https://code.wireshark.org/review/10781 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'asn1')
-rw-r--r--asn1/nbap/nbap.cnf48
-rw-r--r--asn1/nbap/packet-nbap-template.c12
2 files changed, 26 insertions, 34 deletions
diff --git a/asn1/nbap/nbap.cnf b/asn1/nbap/nbap.cnf
index 0edba8646d..f7b62c22c9 100644
--- a/asn1/nbap/nbap.cnf
+++ b/asn1/nbap/nbap.cnf
@@ -867,14 +867,14 @@ num_items = 1;
/* Set data for First or single channel */
umts_fp_conversation_info->fp_dch_channel_info[0].num_ul_chans = num_tf = nbap_dch_chnl_info[commontransportchannelid].num_ul_chans;
- nbap_debug2("Frame %%u PCH-ParametersItem-CTCH-SetupRqstFDD Start: num_tf %%u",
+ nbap_debug("Frame %%u PCH-ParametersItem-CTCH-SetupRqstFDD Start: num_tf %%u",
actx->pinfo->fd->num,
num_tf);
for (j = 0; j < num_tf; j++) {
umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_tf_size[j] = nbap_dch_chnl_info[commontransportchannelid].ul_chan_tf_size[j];
umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_num_tbs[j] = nbap_dch_chnl_info[commontransportchannelid].ul_chan_num_tbs[j];
- nbap_debug2(" UL tf %%u ul_chan_tf_size %%u",j, nbap_dch_chnl_info[commontransportchannelid].ul_chan_tf_size[j]);
+ nbap_debug(" UL tf %%u ul_chan_tf_size %%u",j, nbap_dch_chnl_info[commontransportchannelid].ul_chan_tf_size[j]);
}
/* Traffic flows per DCH(DL) */
@@ -882,13 +882,13 @@ num_items = 1;
for (j = 0; j < num_tf; j++) {
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[j] = nbap_dch_chnl_info[commontransportchannelid].dl_chan_tf_size[j];
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_num_tbs[j] = nbap_dch_chnl_info[commontransportchannelid].dl_chan_num_tbs[j];
- nbap_debug2(" DL tf %%u ul_chan_tf_size %%u",j, nbap_dch_chnl_info[commontransportchannelid].dl_chan_tf_size[j]);
+ nbap_debug(" DL tf %%u ul_chan_tf_size %%u",j, nbap_dch_chnl_info[commontransportchannelid].dl_chan_tf_size[j]);
}
/* Set data for associated DCH's if we have any */
i = commontransportchannelid;
- nbap_debug2(" commontransportchannelid %%u next ch %%u",commontransportchannelid, nbap_dch_chnl_info[i].next_dch);
+ nbap_debug(" commontransportchannelid %%u next ch %%u",commontransportchannelid, nbap_dch_chnl_info[i].next_dch);
umts_fp_conversation_info->dchs_in_flow_list[0] = commontransportchannelid;
while(nbap_dch_chnl_info[i].next_dch != 0){
@@ -911,12 +911,12 @@ num_items = 1;
}
umts_fp_conversation_info->num_dch_in_flow++;
- nbap_debug1(" num_dch_in_flow %%u", umts_fp_conversation_info->num_dch_in_flow);
+ nbap_debug(" num_dch_in_flow %%u", umts_fp_conversation_info->num_dch_in_flow);
umts_fp_conversation_info->dchs_in_flow_list[umts_fp_conversation_info->num_dch_in_flow] = i;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
- nbap_debug1("Frame %%u PCH-ParametersItem-CTCH-SetupRqstFDD End",
+ nbap_debug("Frame %%u PCH-ParametersItem-CTCH-SetupRqstFDD End",
actx->pinfo->fd->num);
}
@@ -1229,9 +1229,9 @@ dch_id = 0xFFFFFFFF;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
}
- nbap_debug1("Frame %%u RL-Specific-DCH-Info-Item Start", actx->pinfo->fd->num);
- nbap_debug1(" Total no of ch in flow will be: %%d", umts_fp_conversation_info->num_dch_in_flow);
- nbap_debug1("Frame %%u RL-Specific-DCH-Info-Item End", actx->pinfo->fd->num);
+ nbap_debug("Frame %%u RL-Specific-DCH-Info-Item Start", actx->pinfo->fd->num);
+ nbap_debug(" Total no of ch in flow will be: %%d", umts_fp_conversation_info->num_dch_in_flow);
+ nbap_debug("Frame %%u RL-Specific-DCH-Info-Item End", actx->pinfo->fd->num);
}
@@ -1316,10 +1316,10 @@ BindingID_port = 0;
/*Ip address might be useful as well*/
nbap_edch_port_info->crnc_address = transportLayerAddress_ipv4;
- nbap_debug1("Frame %%u RL-Specific-E-DCH-Information-Item Start",
+ nbap_debug("Frame %%u RL-Specific-E-DCH-Information-Item Start",
actx->pinfo->fd->num);
- nbap_debug4(" g_tree_insert(edch_flow_port_map) com_context_id %%u e_dch_macdflow_id %%u IP %%s Port %%u",
+ nbap_debug(" g_tree_insert(edch_flow_port_map) com_context_id %%u e_dch_macdflow_id %%u IP %%s Port %%u",
umts_fp_conversation_info->com_context_id,
e_dch_macdflow_id,
address_to_str(wmem_packet_scope(), &dst_addr),
@@ -1328,7 +1328,7 @@ BindingID_port = 0;
g_tree_insert(edch_flow_port_map, GINT_TO_POINTER((gint)umts_fp_conversation_info->com_context_id), nbap_edch_port_info);
}else{
- nbap_debug4(" Insert in existing edch_flow_port_map com_context_id %%u e_dch_macdflow_id %%u IP %%s Port %%u",
+ nbap_debug(" Insert in existing edch_flow_port_map com_context_id %%u e_dch_macdflow_id %%u IP %%s Port %%u",
umts_fp_conversation_info->com_context_id,
e_dch_macdflow_id,
address_to_str(wmem_packet_scope(), &dst_addr),
@@ -1344,7 +1344,7 @@ BindingID_port = 0;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
- nbap_debug1("Frame %%u RL-Specific-E-DCH-Information-Item End", actx->pinfo->fd->num);
+ nbap_debug("Frame %%u RL-Specific-E-DCH-Information-Item End", actx->pinfo->fd->num);
}
}
@@ -1430,12 +1430,12 @@ BindingID_port = 0;
0, NO_ADDR_B|NO_PORT_B);
if(old_conversation){
- nbap_debug3("Frame %%u E-DCH-FDD-Information-to-Modify: found old conv on IP %%s Port %%u",
+ nbap_debug("Frame %%u E-DCH-FDD-Information-to-Modify: found old conv on IP %%s Port %%u",
actx->pinfo->fd->num,
address_to_str(wmem_packet_scope(), &dst_addr),
BindingID_port);
}else{
- nbap_debug3("Frame %%u E-DCH-FDD-Information-to-Modify: Did not find old conv on IP %%s Port %%u",
+ nbap_debug("Frame %%u E-DCH-FDD-Information-to-Modify: Did not find old conv on IP %%s Port %%u",
actx->pinfo->fd->num,
address_to_str(wmem_packet_scope(), &dst_addr),
BindingID_port);
@@ -1505,7 +1505,7 @@ num_items = 1;
return offset;
}
- nbap_debug1("Frame %%u E-DCH-MACdFlow-Specific-InfoItem-to-Modify",
+ nbap_debug("Frame %%u E-DCH-MACdFlow-Specific-InfoItem-to-Modify",
actx->pinfo->fd->num);
/****** Look up old port and ip information since this is not included in this message ******/
@@ -1526,12 +1526,12 @@ num_items = 1;
expert_add_info(actx->pinfo, NULL, &ei_nbap_no_find_port_info);
return offset;
}
- nbap_debug1(" Found com_context_id %%u", com_context_id);
+ nbap_debug(" Found com_context_id %%u", com_context_id);
/*Set the appropriate port, cheat and use same variable.*/
BindingID_port = old_info->crnc_port[e_dch_macdflow_id];
- nbap_debug2(" Port %%u loaded from old_info->crnc_port[e_dch_macdflow_id %%u]",
+ nbap_debug(" Port %%u loaded from old_info->crnc_port[e_dch_macdflow_id %%u]",
BindingID_port,
e_dch_macdflow_id);
@@ -1778,7 +1778,7 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
for (i = 0; i < maxNrOfMACdFlows; i++) {
if (nbap_hsdsch_channel_info[i].crnc_port != 0){
- nbap_debug4("Frame %%u HSDSCH-MACdFlows-Information:hsdsch_macdflow_id %%u Look for conv on IP %%s Port %%u",
+ nbap_debug("Frame %%u HSDSCH-MACdFlows-Information:hsdsch_macdflow_id %%u Look for conv on IP %%s Port %%u",
actx->pinfo->fd->num,
i,
address_to_str (wmem_packet_scope(), &(nbap_hsdsch_channel_info[i].crnc_address)),
@@ -1790,7 +1790,7 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
if (conversation == NULL) {
/* It's not part of any conversation - create a new one. */
- nbap_debug2("Frame %%u HSDSCH-MACdFlows-Information: Set up conv on Port %%u", actx->pinfo->fd->num, nbap_hsdsch_channel_info[i].crnc_port);
+ nbap_debug("Frame %%u HSDSCH-MACdFlows-Information: Set up conv on Port %%u", actx->pinfo->fd->num, nbap_hsdsch_channel_info[i].crnc_port);
conversation = conversation_new(actx->pinfo->fd->num, &(nbap_hsdsch_channel_info[i].crnc_address),
&null_addr, PT_UDP, nbap_hsdsch_channel_info[i].crnc_port,
0, NO_ADDR2|NO_PORT2);
@@ -1890,12 +1890,12 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
/* Set port to zero use that as an indication of whether we have data or not */
SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
- nbap_debug1("Frame %%u HSDSCH-MACdFlows-Information Start",
+ nbap_debug("Frame %%u HSDSCH-MACdFlows-Information Start",
actx->pinfo->fd->num);
for (i = 0; i < maxNrOfMACdFlows; i++) {
if (nbap_hsdsch_channel_info[i].crnc_port != 0){
- nbap_debug3(" hsdsch_macdflow_id %%u Look for conv on IP %%s Port %%u",
+ nbap_debug(" hsdsch_macdflow_id %%u Look for conv on IP %%s Port %%u",
i,
address_to_str (wmem_packet_scope(), &(nbap_hsdsch_channel_info[i].crnc_address)),
nbap_hsdsch_channel_info[i].crnc_port);
@@ -1906,7 +1906,7 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
if (conversation == NULL) {
/* It's not part of any conversation - create a new one. */
- nbap_debug1(" Set up conv on Port %%u", nbap_hsdsch_channel_info[i].crnc_port);
+ nbap_debug(" Set up conv on Port %%u", nbap_hsdsch_channel_info[i].crnc_port);
conversation = conversation_new(actx->pinfo->fd->num, &(nbap_hsdsch_channel_info[i].crnc_address),
&null_addr, PT_UDP, nbap_hsdsch_channel_info[i].crnc_port,
@@ -1958,7 +1958,7 @@ nbap_edch_channel_info[e_dch_macdflow_id].no_ddi_entries = num_items;
}
}
}
- nbap_debug1("Frame %%u HSDSCH-MACdFlows-Information End",
+ nbap_debug("Frame %%u HSDSCH-MACdFlows-Information End",
actx->pinfo->fd->num);
}
diff --git a/asn1/nbap/packet-nbap-template.c b/asn1/nbap/packet-nbap-template.c
index 8c34e80269..29ae5e718c 100644
--- a/asn1/nbap/packet-nbap-template.c
+++ b/asn1/nbap/packet-nbap-template.c
@@ -55,17 +55,9 @@
/* Debug */
#if 0
-#define nbap_debug0(str) g_warning(str)
-#define nbap_debug1(str,p1) g_warning(str,p1)
-#define nbap_debug2(str,p1,p2) g_warning(str,p1,p2)
-#define nbap_debug3(str,p1,p2,p3) g_warning(str,p1,p2,p3)
-#define nbap_debug4(str,p1,p2,p3,p4) g_warning(str,p1,p2,p3,p4)
+#define nbap_debug(...) g_warning(__VA_ARGS__)
#else
-#define nbap_debug0(str)
-#define nbap_debug1(str,p1)
-#define nbap_debug2(str,p1,p2)
-#define nbap_debug3(str,p1,p2,p3)
-#define nbap_debug4(str,p1,p2,p3,p4)
+#define nbap_debug(...)
#endif
void proto_register_nbap(void);