From 857456b7bae6511f9c7ed97fb441c4b87c0dec24 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Tue, 25 Nov 2014 08:24:16 +0000 Subject: [PATCH] mpegts: fix some compiler warnings i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 "warning: comparison is always true due to limited range of data type" https://bugzilla.gnome.org/show_bug.cgi?id=740674 --- gst-libs/gst/mpegts/gst-dvb-descriptor.c | 15 ++++++++------- gst-libs/gst/mpegts/gstmpegtsdescriptor.c | 9 +++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/gst-libs/gst/mpegts/gst-dvb-descriptor.c b/gst-libs/gst/mpegts/gst-dvb-descriptor.c index 29b2442..ea33a1d 100644 --- a/gst-libs/gst/mpegts/gst-dvb-descriptor.c +++ b/gst-libs/gst/mpegts/gst-dvb-descriptor.c @@ -178,7 +178,7 @@ gst_mpegts_descriptor_parse_dvb_stuffing (const GstMpegtsDescriptor * guint8 *data; g_return_val_if_fail (descriptor != NULL && stuffing_bytes != NULL, FALSE); - __common_desc_checks (descriptor, GST_MTS_DESC_DVB_STUFFING, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_DVB_STUFFING, FALSE); data = (guint8 *) descriptor->data + 2; @@ -872,7 +872,7 @@ gst_mpegts_descriptor_parse_dvb_teletext_idx (const GstMpegtsDescriptor * guint8 *data; g_return_val_if_fail (descriptor != NULL, FALSE); - __common_desc_checks (descriptor, GST_MTS_DESC_DVB_TELETEXT, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_DVB_TELETEXT, FALSE); if (descriptor->length / 5 <= idx) return FALSE; @@ -907,7 +907,7 @@ gst_mpegts_descriptor_parse_dvb_teletext_nb (const GstMpegtsDescriptor * descriptor) { g_return_val_if_fail (descriptor != NULL, 0); - __common_desc_checks (descriptor, GST_MTS_DESC_DVB_TELETEXT, 0, 0); + __common_desc_check_base (descriptor, GST_MTS_DESC_DVB_TELETEXT, FALSE); return descriptor->length / 5; } @@ -938,7 +938,7 @@ gst_mpegts_descriptor_parse_dvb_subtitling_idx (const GstMpegtsDescriptor * guint8 *data; g_return_val_if_fail (descriptor != NULL && lang != NULL, FALSE); - __common_desc_checks (descriptor, GST_MTS_DESC_DVB_SUBTITLING, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_DVB_SUBTITLING, FALSE); /* If we went too far, return FALSE */ if (descriptor->length / 8 <= idx) @@ -973,7 +973,7 @@ gst_mpegts_descriptor_parse_dvb_subtitling_nb (const GstMpegtsDescriptor * descriptor) { g_return_val_if_fail (descriptor != NULL, FALSE); - __common_desc_checks (descriptor, GST_MTS_DESC_DVB_SUBTITLING, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_DVB_SUBTITLING, FALSE); return descriptor->length / 8; } @@ -1281,7 +1281,7 @@ gst_mpegts_descriptor_parse_dvb_content (const GstMpegtsDescriptor guint8 i; g_return_val_if_fail (descriptor != NULL && content != NULL, FALSE); - __common_desc_checks (descriptor, GST_MTS_DESC_DVB_CONTENT, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_DVB_CONTENT, FALSE); data = (guint8 *) descriptor->data + 2; len = descriptor->length; @@ -1330,7 +1330,8 @@ gst_mpegts_descriptor_parse_dvb_parental_rating (const GstMpegtsDescriptor guint i; g_return_val_if_fail (descriptor != NULL && rating != NULL, FALSE); - __common_desc_checks (descriptor, GST_MTS_DESC_DVB_PARENTAL_RATING, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_DVB_PARENTAL_RATING, + FALSE); data = (guint8 *) descriptor->data + 2; diff --git a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c index f8eb895..dc6fe3d 100644 --- a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c +++ b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c @@ -969,7 +969,7 @@ gst_mpegts_descriptor_parse_iso_639_language (const GstMpegtsDescriptor * g_return_val_if_fail (descriptor != NULL && desc != NULL, FALSE); /* This descriptor can be empty, no size check needed */ - __common_desc_checks (descriptor, GST_MTS_DESC_ISO_639_LANGUAGE, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_ISO_639_LANGUAGE, FALSE); data = (guint8 *) descriptor->data + 2; @@ -1011,7 +1011,7 @@ gst_mpegts_descriptor_parse_iso_639_language_idx (const GstMpegtsDescriptor * g_return_val_if_fail (descriptor != NULL && lang != NULL, FALSE); /* This descriptor can be empty, no size check needed */ - __common_desc_checks (descriptor, GST_MTS_DESC_ISO_639_LANGUAGE, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_ISO_639_LANGUAGE, FALSE); if (descriptor->length / 4 <= idx) return FALSE; @@ -1040,7 +1040,7 @@ gst_mpegts_descriptor_parse_iso_639_language_nb (const GstMpegtsDescriptor * { g_return_val_if_fail (descriptor != NULL, 0); /* This descriptor can be empty, no size check needed */ - __common_desc_checks (descriptor, GST_MTS_DESC_ISO_639_LANGUAGE, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_ISO_639_LANGUAGE, FALSE); return descriptor->length / 4; } @@ -1063,7 +1063,8 @@ gst_mpegts_descriptor_parse_logical_channel (const GstMpegtsDescriptor * g_return_val_if_fail (descriptor != NULL && res != NULL, FALSE); /* This descriptor loop can be empty, no size check required */ - __common_desc_checks (descriptor, GST_MTS_DESC_DTG_LOGICAL_CHANNEL, 0, FALSE); + __common_desc_check_base (descriptor, GST_MTS_DESC_DTG_LOGICAL_CHANNEL, + FALSE); data = (guint8 *) descriptor->data + 2; -- 2.7.4