[bTSstream-devel] [Git][videolan/bitstream][master] scte/35: fix sign warnings
Christophe Massiot (@cmassiot)
gitlab at videolan.org
Sat Nov 8 16:02:35 UTC 2025
Christophe Massiot pushed to branch master at VideoLAN / bitstream
Commits:
90524f5d by Terje Gundersen at 2025-11-08T16:01:54+00:00
scte/35: fix sign warnings
This resolves the following (6) warnings, emitted when compiling the
make target 'examples' without -Wno-sign-compare and with -Wall.
In file included from dvb_gen_si.c:44:
./bitstream/scte/35.h: In function ‘scte35_insert_validate’:
./bitstream/scte/35.h:550:22: warning: comparison of integer expressions
of different signedness: ‘size_t’ {aka ‘long unsigned int’} and
‘int’ [-Wsign-compare]
./bitstream/scte/35.h:578:25: warning: comparison of integer expressions
of different signedness: ‘size_t’ {aka ‘long unsigned int’} and
‘long int’ [-Wsign-compare]
./bitstream/scte/35.h:556:29: warning: comparison of integer expressions
of different signedness: ‘size_t’ {aka ‘long unsigned int’} and
‘int’ [-Wsign-compare]
./bitstream/scte/35.h:580:21: warning: comparison of integer expressions
of different signedness: ‘size_t’ {aka ‘long unsigned int’} and
‘long int’ [-Wsign-compare]
./bitstream/scte/35.h:561:25: warning: comparison of integer expressions
of different signedness: ‘size_t’ {aka ‘long unsigned int’} and
‘int’ [-Wsign-compare]
./bitstream/scte/35.h:578:25: warning: comparison of integer expressions
of different signedness: ‘size_t’ {aka ‘long unsigned int’} and
‘long int’ [-Wsign-compare]
This change ought not to change any logic, but merely preserve the
existing one whilst formalizing the behavior in such a way that the
compiler is made painfully aware of our intent prompting it to stop
emitting the warnings.
- - - - -
1 changed file:
- scte/35.h
Changes:
=====================================
scte/35.h
=====================================
@@ -212,7 +212,7 @@ static inline uint8_t scte35_splice_time_size(const uint8_t *p_splice_time)
/*****************************************************************************
* Splice Information Table - break_duration structure
*****************************************************************************/
-#define SCTE35_BREAK_DURATION_HEADER_SIZE 5
+#define SCTE35_BREAK_DURATION_HEADER_SIZE 5u
static inline void scte35_break_duration_init(uint8_t *p_break_duration)
{
@@ -282,11 +282,11 @@ static inline bool scte35_null_validate(const uint8_t *p_scte35)
* Splice Information Table - insert command
*****************************************************************************/
#define SCTE35_INSERT_COMMAND 5
-#define SCTE35_INSERT_HEADER_SIZE 5
-#define SCTE35_INSERT_HEADER2_SIZE 1
+#define SCTE35_INSERT_HEADER_SIZE 5u
+#define SCTE35_INSERT_HEADER2_SIZE 1u
#define SCTE35_INSERT_COMPONENT_COUNT_SIZE 1
#define SCTE35_INSERT_COMPONENT_HEADER_SIZE 1
-#define SCTE35_INSERT_FOOTER_SIZE 4
+#define SCTE35_INSERT_FOOTER_SIZE 4u
static inline void scte35_insert_init(uint8_t *p_scte35, uint16_t i_length)
{
@@ -575,9 +575,9 @@ static inline bool scte35_insert_validate(const uint8_t *p_scte35)
return false;
if (scte35_insert_has_duration(p_scte35))
- return i_length >= p_end + SCTE35_BREAK_DURATION_HEADER_SIZE +
- SCTE35_INSERT_FOOTER_SIZE - p_command;
- return i_length >= p_end + SCTE35_INSERT_FOOTER_SIZE - p_command;
+ return i_length >= (size_t)(p_end + SCTE35_BREAK_DURATION_HEADER_SIZE +
+ SCTE35_INSERT_FOOTER_SIZE - p_command);
+ return i_length >= (size_t)(p_end + SCTE35_INSERT_FOOTER_SIZE - p_command);
}
/*****************************************************************************
View it on GitLab: https://code.videolan.org/videolan/bitstream/-/commit/90524f5da17006659f77ab723ab21ad0c442d43e
--
View it on GitLab: https://code.videolan.org/videolan/bitstream/-/commit/90524f5da17006659f77ab723ab21ad0c442d43e
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the biTStream-devel
mailing list