diff --git a/source/common/cutscenes/movieplayer.cpp b/source/common/cutscenes/movieplayer.cpp index 8ea3967c5..4041e4556 100644 --- a/source/common/cutscenes/movieplayer.cpp +++ b/source/common/cutscenes/movieplayer.cpp @@ -532,7 +532,7 @@ public: SmkPlayer* pId = (SmkPlayer*)userdata; memcpy(buff, &pId->adata.samples[pId->adata.nRead], len); pId->adata.nRead += len / 2; - if (pId->adata.nRead >= countof(pId->adata.samples)) pId->adata.nRead = 0; + if (pId->adata.nRead >= (int)countof(pId->adata.samples)) pId->adata.nRead = 0; return true; } @@ -541,7 +541,7 @@ public: for (unsigned i = 0; i < count; i++) { adata.samples[adata.nWrite] = (audioBuffer[i] - 128) << 8; - if (++adata.nWrite >= countof(adata.samples)) adata.nWrite = 0; + if (++adata.nWrite >= (int)countof(adata.samples)) adata.nWrite = 0; } } @@ -551,7 +551,7 @@ public: for (unsigned i = 0; i < count/2; i++) { adata.samples[adata.nWrite] = *ptr++; - if (++adata.nWrite >= countof(adata.samples)) adata.nWrite = 0; + if (++adata.nWrite >= (int)countof(adata.samples)) adata.nWrite = 0; } } @@ -789,7 +789,7 @@ DEFINE_ACTION_FUNCTION(_MoviePlayer, Create) auto movie = OpenMovie(filename, *sndinf, frametime == -1? nullptr : frametimes, flags, error); if (!movie) { - Printf(TEXTCOLOR_YELLOW, "%s", error.GetChars()); + Printf(TEXTCOLOR_YELLOW "%s", error.GetChars()); } ACTION_RETURN_POINTER(movie); } diff --git a/source/common/cutscenes/playmve.cpp b/source/common/cutscenes/playmve.cpp index 4967d2ccc..242997e26 100644 --- a/source/common/cutscenes/playmve.cpp +++ b/source/common/cutscenes/playmve.cpp @@ -97,7 +97,7 @@ static bool StreamCallbackFunc(SoundStream* stream, void* buff, int len, void* u InterplayDecoder* pId = (InterplayDecoder*)userdata; memcpy(buff, &pId->audio.samples[pId->audio.nRead], len); pId->audio.nRead += len / 2; - if (pId->audio.nRead >= countof(pId->audio.samples)) pId->audio.nRead = 0; + if (pId->audio.nRead >= (int)countof(pId->audio.samples)) pId->audio.nRead = 0; return true; } @@ -364,7 +364,7 @@ bool InterplayDecoder::RunFrame(uint64_t clock) } audio.samples[audio.nWrite++] = predictor[ch]; - if (audio.nWrite >= countof(audio.samples)) audio.nWrite = 0; + if (audio.nWrite >= (int)countof(audio.samples)) audio.nWrite = 0; } int ch = 0; @@ -374,7 +374,7 @@ bool InterplayDecoder::RunFrame(uint64_t clock) predictor[ch] = clamp(predictor[ch], -32768, 32768); audio.samples[audio.nWrite++] = predictor[ch]; - if (audio.nWrite >= countof(audio.samples)) audio.nWrite = 0; + if (audio.nWrite >= (int)countof(audio.samples)) audio.nWrite = 0; // toggle channel ch ^= audio.nChannels - 1; @@ -442,7 +442,7 @@ bool InterplayDecoder::RunFrame(uint64_t clock) } else { - if (opcodeSize != decodeMap.nSize) { + if (opcodeSize != (int)decodeMap.nSize) { delete[] decodeMap.pData; decodeMap.pData = new uint8_t[opcodeSize]; decodeMap.nSize = opcodeSize; diff --git a/source/common/filesystem/file_zip.cpp b/source/common/filesystem/file_zip.cpp index b3acb8d13..db5bdf902 100644 --- a/source/common/filesystem/file_zip.cpp +++ b/source/common/filesystem/file_zip.cpp @@ -266,7 +266,7 @@ bool FZipFile::Open(bool quiet, LumpFilterInfo* filter) // at least one of the more common definition lumps must be present. for (auto &p : filter->requiredPrefixes) { - if (name.IndexOf(name0 + p) == 0 || name.LastIndexOf(p) == name.Len() - strlen(p)) + if (name.IndexOf(name0 + p) == 0 || name.LastIndexOf(p) == ptrdiff_t(name.Len() - strlen(p))) { foundspeciallump = true; break; diff --git a/source/common/fonts/font.cpp b/source/common/fonts/font.cpp index 6ddbe41d4..5edd09eb1 100644 --- a/source/common/fonts/font.cpp +++ b/source/common/fonts/font.cpp @@ -686,7 +686,7 @@ int FFont::GetColorTranslation (EColorRange range, PalEntry *color) const { // Single pic fonts do not set up their translation table and must always return 0. if (Translations.Size() == 0) return 0; - assert(Translations.Size() == NumTextColors); + assert(Translations.Size() == (unsigned)NumTextColors); if (noTranslate) { diff --git a/source/common/rendering/gles/gles_postprocess.cpp b/source/common/rendering/gles/gles_postprocess.cpp index a618c3b2e..0e909da2d 100644 --- a/source/common/rendering/gles/gles_postprocess.cpp +++ b/source/common/rendering/gles/gles_postprocess.cpp @@ -159,7 +159,7 @@ void FGLRenderer::DrawPresentTexture(const IntRect &box, bool applyGamma) mPresentShader->Uniforms.SetData(); - for (int n = 0; n < mPresentShader->Uniforms.mFields.size(); n++) + for (size_t n = 0; n < mPresentShader->Uniforms.mFields.size(); n++) { int index = -1; UniformFieldDesc desc = mPresentShader->Uniforms.mFields[n]; @@ -175,6 +175,8 @@ void FGLRenderer::DrawPresentTexture(const IntRect &box, bool applyGamma) case UniformType::Vec2: glUniform2fv(loc,1 , ((GLfloat*)(((char*)(&mPresentShader->Uniforms)) + desc.Offset))); break; + default: + break; } } @@ -222,4 +224,4 @@ void FGLRenderer::ClearBorders() glDisable(GL_SCISSOR_TEST); } -} \ No newline at end of file +} diff --git a/source/common/rendering/gles/gles_renderstate.cpp b/source/common/rendering/gles/gles_renderstate.cpp index 78bfc23de..f3d92b126 100644 --- a/source/common/rendering/gles/gles_renderstate.cpp +++ b/source/common/rendering/gles/gles_renderstate.cpp @@ -116,13 +116,13 @@ bool FGLRenderState::ApplyShader() addLights = (int(lightPtr[3]) - int(lightPtr[2])) / LIGHT_VEC4_NUM; // Here we limit the number of lights, but dont' change the light data so priority has to be mod, sub then add - if (modLights > gles.maxlights) + if (modLights > (int)gles.maxlights) modLights = gles.maxlights; - if (modLights + subLights > gles.maxlights) + if (modLights + subLights > (int)gles.maxlights) subLights = gles.maxlights - modLights; - if (modLights + subLights + addLights > gles.maxlights) + if (modLights + subLights + addLights > (int)gles.maxlights) addLights = gles.maxlights - modLights - subLights; totalLights = modLights + subLights + addLights; @@ -332,7 +332,7 @@ bool FGLRenderState::ApplyShader() // Calculate the total number of vec4s we need int totalVectors = totalLights * LIGHT_VEC4_NUM; - if (totalVectors > gles.numlightvectors) + if (totalVectors > (int)gles.numlightvectors) totalVectors = gles.numlightvectors; glUniform4fv(activeShader->cur->lights_index, totalVectors, lightPtr); diff --git a/source/common/rendering/gles/gles_shaderprogram.cpp b/source/common/rendering/gles/gles_shaderprogram.cpp index 26906f57a..5070303a9 100644 --- a/source/common/rendering/gles/gles_shaderprogram.cpp +++ b/source/common/rendering/gles/gles_shaderprogram.cpp @@ -272,7 +272,7 @@ void FPresentShaderBase::Init(const char * vtx_shader_name, const char * program Uniforms.UniformLocation.resize(Uniforms.mFields.size()); - for (int n = 0; n < Uniforms.mFields.size(); n++) + for (size_t n = 0; n < Uniforms.mFields.size(); n++) { int index = -1; UniformFieldDesc desc = Uniforms.mFields[n]; @@ -290,4 +290,4 @@ void FPresentShader::Bind() mShader->Bind(); } -} \ No newline at end of file +}