summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2012-07-17 13:12:50 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2012-07-17 13:12:50 +0000
commitbabe6229874376888afd728250e389c855d761a4 (patch)
tree1963676cb222265edccef8b3928aabb53b459e17
parenta8016f6a57056e5af2304d8216b97841f945bef7 (diff)
downloadwireshark-babe6229874376888afd728250e389c855d761a4.tar.gz
Use G_MININT32 instead of -2^31 so as to get rid of 'this decimal constant is unsigned only in ISO C90' warning
svn path=/trunk/; revision=43764
-rw-r--r--epan/dissectors/packet-lpp.c2
-rw-r--r--epan/dissectors/packet-lppe.c2
-rw-r--r--epan/dissectors/packet-mpeg-audio.c4
-rw-r--r--epan/dissectors/packet-nbap.c2
-rw-r--r--epan/dissectors/packet-pcap.c2
-rw-r--r--epan/dissectors/packet-rnsap.c2
-rw-r--r--epan/dissectors/packet-ros.c4
-rw-r--r--epan/dissectors/packet-rrc.c2
-rw-r--r--epan/dissectors/packet-rrlp.c16
-rw-r--r--epan/dissectors/packet-rtse.c4
-rw-r--r--epan/dissectors/packet-sabp.c9
-rw-r--r--epan/dissectors/packet-sv.c4
-rwxr-xr-xtools/asn2wrs.py4
13 files changed, 30 insertions, 27 deletions
diff --git a/epan/dissectors/packet-lpp.c b/epan/dissectors/packet-lpp.c
index 4b162afd43..14d21cccfa 100644
--- a/epan/dissectors/packet-lpp.c
+++ b/epan/dissectors/packet-lpp.c
@@ -4338,7 +4338,7 @@ dissect_lpp_GNSS_ClockModel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
static int
dissect_lpp_INTEGER_M2147483648_2147483647(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
diff --git a/epan/dissectors/packet-lppe.c b/epan/dissectors/packet-lppe.c
index 7ababad168..db7f69abc3 100644
--- a/epan/dissectors/packet-lppe.c
+++ b/epan/dissectors/packet-lppe.c
@@ -4496,7 +4496,7 @@ dissect_lppe_OMA_LPPe_AGNSS_SolarRadiationReq(tvbuff_t *tvb _U_, int offset _U_,
static int
dissect_lppe_INTEGER_M2147483648_2147483647(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
diff --git a/epan/dissectors/packet-mpeg-audio.c b/epan/dissectors/packet-mpeg-audio.c
index a1f959f566..28bc8e754e 100644
--- a/epan/dissectors/packet-mpeg-audio.c
+++ b/epan/dissectors/packet-mpeg-audio.c
@@ -659,7 +659,7 @@ proto_register_mpeg_audio(void)
NULL, HFILL }},
/*--- End of included file: packet-mpeg-audio-hfarr.c ---*/
-#line 159 "../../asn1/mpeg-audio/packet-mpeg-audio-template.c"
+#line 158 "../../asn1/mpeg-audio/packet-mpeg-audio-template.c"
{ &hf_mpeg_audio_data,
{ "Data", "mpeg.audio.data",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
@@ -683,7 +683,7 @@ proto_register_mpeg_audio(void)
&ett_mpeg_audio_ID3v1,
/*--- End of included file: packet-mpeg-audio-ettarr.c ---*/
-#line 176 "../../asn1/mpeg-audio/packet-mpeg-audio-template.c"
+#line 175 "../../asn1/mpeg-audio/packet-mpeg-audio-template.c"
};
proto_mpeg_audio = proto_register_protocol(
diff --git a/epan/dissectors/packet-nbap.c b/epan/dissectors/packet-nbap.c
index 8805fd4ad3..57b2250bc7 100644
--- a/epan/dissectors/packet-nbap.c
+++ b/epan/dissectors/packet-nbap.c
@@ -20626,7 +20626,7 @@ dissect_nbap_INTEGER_0_37799(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
static int
dissect_nbap_INTEGER_M2147483648_2147483647(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
diff --git a/epan/dissectors/packet-pcap.c b/epan/dissectors/packet-pcap.c
index bad5b5d71a..e315514ec0 100644
--- a/epan/dissectors/packet-pcap.c
+++ b/epan/dissectors/packet-pcap.c
@@ -4945,7 +4945,7 @@ dissect_pcap_INTEGER_0_37799(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
static int
dissect_pcap_INTEGER_M2147483648_2147483647(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
diff --git a/epan/dissectors/packet-rnsap.c b/epan/dissectors/packet-rnsap.c
index 752a8baa09..8ccfcad52f 100644
--- a/epan/dissectors/packet-rnsap.c
+++ b/epan/dissectors/packet-rnsap.c
@@ -18245,7 +18245,7 @@ dissect_rnsap_INTEGER_0_37799(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act
static int
dissect_rnsap_INTEGER_M2147483648_2147483647(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
diff --git a/epan/dissectors/packet-ros.c b/epan/dissectors/packet-ros.c
index 2780f6f62b..1f1a58876f 100644
--- a/epan/dissectors/packet-ros.c
+++ b/epan/dissectors/packet-ros.c
@@ -1243,7 +1243,7 @@ void proto_register_ros(void) {
"OBJECT_IDENTIFIER", HFILL }},
/*--- End of included file: packet-ros-hfarr.c ---*/
-#line 490 "../../asn1/ros/packet-ros-template.c"
+#line 489 "../../asn1/ros/packet-ros-template.c"
};
/* List of subtrees */
@@ -1264,7 +1264,7 @@ void proto_register_ros(void) {
&ett_ros_Code,
/*--- End of included file: packet-ros-ettarr.c ---*/
-#line 497 "../../asn1/ros/packet-ros-template.c"
+#line 496 "../../asn1/ros/packet-ros-template.c"
};
/* Register protocol */
diff --git a/epan/dissectors/packet-rrc.c b/epan/dissectors/packet-rrc.c
index 8cf92b2311..b60e67b5d0 100644
--- a/epan/dissectors/packet-rrc.c
+++ b/epan/dissectors/packet-rrc.c
@@ -28340,7 +28340,7 @@ dissect_rrc_INTEGER_0_37799(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
static int
dissect_rrc_INTEGER_M2147483648_2147483647(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
diff --git a/epan/dissectors/packet-rrlp.c b/epan/dissectors/packet-rrlp.c
index ccc4b60185..4e1e316774 100644
--- a/epan/dissectors/packet-rrlp.c
+++ b/epan/dissectors/packet-rrlp.c
@@ -2092,7 +2092,7 @@ dissect_rrlp_INTEGER_M2097152_2097151(tvbuff_t *tvb _U_, int offset _U_, asn1_ct
static int
dissect_rrlp_INTEGER_M2147483648_2147483647(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
@@ -3027,7 +3027,7 @@ dissect_rrlp_GANSSCommonAssistData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
static int
dissect_rrlp_TA0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
@@ -4424,7 +4424,7 @@ dissect_rrlp_GANSSEphemerisExtensionHeader(tvbuff_t *tvb _U_, int offset _U_, as
static int
dissect_rrlp_T_keplerW(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
@@ -4434,7 +4434,7 @@ dissect_rrlp_T_keplerW(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
static int
dissect_rrlp_T_keplerM0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
@@ -4444,7 +4444,7 @@ dissect_rrlp_T_keplerM0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
static int
dissect_rrlp_T_keplerI0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
@@ -4454,7 +4454,7 @@ dissect_rrlp_T_keplerI0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
static int
dissect_rrlp_T_keplerOmega0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
@@ -4771,7 +4771,7 @@ dissect_rrlp_UTCmodelSet2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
static int
dissect_rrlp_T_tauC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
@@ -4799,7 +4799,7 @@ dissect_rrlp_UTCmodelSet3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
static int
dissect_rrlp_T_utcA0wnt(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- -2147483648, 2147483647U, NULL, FALSE);
+ G_MININT32, 2147483647U, NULL, FALSE);
return offset;
}
diff --git a/epan/dissectors/packet-rtse.c b/epan/dissectors/packet-rtse.c
index 464d24ea82..c7ed0db1cb 100644
--- a/epan/dissectors/packet-rtse.c
+++ b/epan/dissectors/packet-rtse.c
@@ -1003,7 +1003,7 @@ void proto_register_rtse(void) {
NULL, HFILL }},
/*--- End of included file: packet-rtse-hfarr.c ---*/
-#line 356 "../../asn1/rtse/packet-rtse-template.c"
+#line 355 "../../asn1/rtse/packet-rtse-template.c"
};
/* List of subtrees */
@@ -1025,7 +1025,7 @@ void proto_register_rtse(void) {
&ett_rtse_CallingSSuserReference,
/*--- End of included file: packet-rtse-ettarr.c ---*/
-#line 365 "../../asn1/rtse/packet-rtse-template.c"
+#line 364 "../../asn1/rtse/packet-rtse-template.c"
};
module_t *rtse_module;
diff --git a/epan/dissectors/packet-sabp.c b/epan/dissectors/packet-sabp.c
index 0152b7bb4d..7a3618a1de 100644
--- a/epan/dissectors/packet-sabp.c
+++ b/epan/dissectors/packet-sabp.c
@@ -480,7 +480,7 @@ dissect_sabp_Available_Bandwidth(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *
static int
dissect_sabp_Broadcast_Message_Content(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 211 "../../asn1/sabp/sabp.cnf"
+#line 212 "../../asn1/sabp/sabp.cnf"
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
@@ -671,6 +671,7 @@ dissect_sabp_Data_Coding_Scheme(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
8, 8, FALSE, &parameter_tvb);
+
if (!parameter_tvb)
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_sabp_cbs_data_coding);
@@ -762,7 +763,7 @@ dissect_sabp_Failure_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
static int
dissect_sabp_Message_Identifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 183 "../../asn1/sabp/sabp.cnf"
+#line 184 "../../asn1/sabp/sabp.cnf"
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
@@ -781,7 +782,7 @@ dissect_sabp_Message_Identifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
static int
dissect_sabp_Serial_Number(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 191 "../../asn1/sabp/sabp.cnf"
+#line 192 "../../asn1/sabp/sabp.cnf"
tvbuff_t *parameter_tvb=NULL;
proto_tree *subtree;
@@ -802,7 +803,7 @@ dissect_sabp_Serial_Number(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
static int
dissect_sabp_New_Serial_Number(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 201 "../../asn1/sabp/sabp.cnf"
+#line 202 "../../asn1/sabp/sabp.cnf"
tvbuff_t *parameter_tvb=NULL;
proto_tree *subtree;
diff --git a/epan/dissectors/packet-sv.c b/epan/dissectors/packet-sv.c
index 61aded305f..9716441a0c 100644
--- a/epan/dissectors/packet-sv.c
+++ b/epan/dissectors/packet-sv.c
@@ -519,7 +519,7 @@ void proto_register_sv(void) {
"Data", HFILL }},
/*--- End of included file: packet-sv-hfarr.c ---*/
-#line 306 "../../asn1/sv/packet-sv-template.c"
+#line 305 "../../asn1/sv/packet-sv-template.c"
};
/* List of subtrees */
@@ -536,7 +536,7 @@ void proto_register_sv(void) {
&ett_sv_ASDU,
/*--- End of included file: packet-sv-ettarr.c ---*/
-#line 314 "../../asn1/sv/packet-sv-template.c"
+#line 313 "../../asn1/sv/packet-sv-template.c"
};
/* Register protocol */
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py
index 18fe4d12bf..797dc1cb0e 100755
--- a/tools/asn2wrs.py
+++ b/tools/asn2wrs.py
@@ -3225,7 +3225,9 @@ class Type (Node):
if str(minv).isdigit():
minv += 'U'
elif (str(minv)[0] == "-") and str(minv)[1:].isdigit():
- if (long(minv) < -(2**31)):
+ if (long(minv) == -(2**31)):
+ minv = "G_MININT32"
+ elif (long(minv) < -(2**31)):
minv = "G_GINT64_CONSTANT(%s)" % (str(minv))
if str(maxv).isdigit():
if (long(maxv) >= 2**32):