From 98193d2688b91de7aff3a9006f66e38e83e041d0 Mon Sep 17 00:00:00 2001 From: Franck LeCodeur Date: Sun, 26 Sep 2021 19:33:21 +0200 Subject: [PATCH] raw_decoder: Fix warnings and enable Werror Done as part of #9460 Warnings related to comparison of integer expressions of different signedness Change-Id: If5543db951b11aab1858a18a057b7d2e08ee2b42 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4503 Reviewed-by: Adrien Destugues --- build/jam/ArchitectureRules | 2 +- src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index 9e7e49cc88..813099473f 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -723,7 +723,7 @@ rule ArchitectureSetupWarnings architecture EnableWerror src add-ons media plugins ape_reader ; EnableWerror src add-ons media plugins au_reader ; # EnableWerror src add-ons media plugins ffmpeg ; -# EnableWerror src add-ons media plugins raw_decoder ; + EnableWerror src add-ons media plugins raw_decoder ; EnableWerror src add-ons print ; EnableWerror src add-ons screen_savers ; EnableWerror src add-ons tracker ; diff --git a/src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp b/src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp index d60c1fc86b..01e32278bd 100644 --- a/src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp +++ b/src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp @@ -487,7 +487,7 @@ RawDecoder::Decode(void *buffer, int64 *frameCount, media_header mh; status_t err; err = GetNextChunk(&fChunkBuffer, &fChunkSize, &mh); - if (err != B_OK || fChunkSize < fInputFrameSize) { + if (err != B_OK || fChunkSize < (size_t)fInputFrameSize) { fChunkSize = 0; break; } @@ -496,7 +496,8 @@ RawDecoder::Decode(void *buffer, int64 *frameCount, fStartTime = mh.start_time; continue; } - int32 frames = min_c(fOutputBufferFrameCount - *frameCount, fChunkSize / fInputFrameSize); + int32 frames = min_c(fOutputBufferFrameCount - *frameCount, + (int64)(fChunkSize / fInputFrameSize)); if (frames == 0) break;