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 <pulkomandy@gmail.com>
This commit is contained in:
Franck LeCodeur 2021-09-26 19:33:21 +02:00 committed by Adrien Destugues
parent ae51dd6785
commit 98193d2688
2 changed files with 4 additions and 3 deletions

View File

@ -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 ;

View File

@ -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;