From 9b8886a6f578b1011094984040609ef053442c92 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 18 Oct 2026 23:21:03 -0500 Subject: [PATCH] Fix integer truncation warning on MSVC --- h264bitstream/bs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/h264bitstream/bs.h b/h264bitstream/bs.h index fc8fbf44..fad69b08 100644 --- a/h264bitstream/bs.h +++ b/h264bitstream/bs.h @@ -101,7 +101,7 @@ static inline int bs_eof(bs_t* b) { if (b->p >= b->end) { return 1; } else { ret static inline int bs_overrun(bs_t* b) { if (b->p > b->end) { return 1; } else { return 0; } } -static inline int bs_pos(bs_t* b) { if (b->p > b->end) { return (b->end - b->start); } else { return (b->p - b->start); } } +static inline int bs_pos(bs_t* b) { if (b->p > b->end) { return (int)(b->end - b->start); } else { return (int)(b->p - b->start); } } static inline uint32_t bs_read_u1(bs_t* b) { @@ -217,7 +217,7 @@ static inline void bs_write_u8(bs_t* b, uint32_t v) #ifdef FAST_U8 if (b->bits_left == 8 && ! bs_eof(b)) // can do fast write { - b->p[0] = v; + b->p[0] = (uint8_t)v; b->p++; return; }