diff --git a/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader.cpp b/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader.cpp index 0e2b8d8cf..f28cab631 100644 --- a/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader.cpp +++ b/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader.cpp @@ -55,6 +55,7 @@ static void ShaderSetUniform1f(const FString &shaderName, const FString &uniform int * i = (int *)uniform.Value; switch(uniform.Type) { + default: case UniformType::Undefined: break; case UniformType::Int: @@ -111,6 +112,7 @@ DEFINE_ACTION_FUNCTION(_PPShader, SetUniform2f) int * i = (int *)uniform.Value; switch(uniform.Type) { + default: case UniformType::Undefined: break; case UniformType::Int: @@ -159,6 +161,7 @@ DEFINE_ACTION_FUNCTION(_PPShader, SetUniform3f) int * i = (int *)uniform.Value; switch(uniform.Type) { + default: case UniformType::Undefined: break; case UniformType::Int: @@ -208,6 +211,7 @@ DEFINE_ACTION_FUNCTION(_PPShader, SetUniform4f) int * i = (int *)uniform.Value; switch(uniform.Type) { + default: case UniformType::Undefined: break; case UniformType::Int: @@ -254,6 +258,7 @@ DEFINE_ACTION_FUNCTION(_PPShader, SetUniform1i) int * i = (int *)uniform.Value; switch(uniform.Type) { + default: case UniformType::Undefined: break; case UniformType::Int: diff --git a/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader_ccmds.cpp b/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader_ccmds.cpp index 93706d72e..a6e099aeb 100644 --- a/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader_ccmds.cpp +++ b/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader_ccmds.cpp @@ -62,8 +62,9 @@ static void PrintUniform(const char * shaderName, const char * uniformName, cons int * i = (int *)uniform.Value; switch(uniform.Type) { + default: case UniformType::Undefined: - Printf("Shader '%s': could not find uniform '%s': %f %f %f\n", shaderName, uniformName); + Printf("Shader '%s': could not find uniform '%s'\n", shaderName, uniformName); break; case UniformType::Int: Printf("Shader '%s' uniform '%s': %d\n", shaderName, uniformName, *i); @@ -72,13 +73,13 @@ static void PrintUniform(const char * shaderName, const char * uniformName, cons Printf("Shader '%s' uniform '%s': %f\n", shaderName, uniformName, *f); break; case UniformType::Vec2: - Printf("Shader '%s' uniform '%s': %f %f\n", shaderName, uniformName, f[0], f[1]); + Printf("Shader '%s' uniform '%s': %f %f\n", shaderName, uniformName, (double)f[0], (double)f[1]); break; case UniformType::Vec3: - Printf("Shader '%s' uniform '%s': %f %f %f\n", shaderName, uniformName, f[0], f[1], f[2]); + Printf("Shader '%s' uniform '%s': %f %f %f\n", shaderName, uniformName, (double)f[0], (double)f[1], (double)f[2]); break; case UniformType::Vec4: - Printf("Shader '%s' uniform '%s': %f %f %f %f\n", shaderName, uniformName, f[0], f[1], f[2], f[3]); + Printf("Shader '%s' uniform '%s': %f %f %f %f\n", shaderName, uniformName, (double)f[0], (double)f[1], (double)f[2], (double)f[3]); break; } } @@ -106,8 +107,9 @@ CCMD (shaderuniform) int * i = (int *)uniform.Value; switch(uniform.Type) { + default: case UniformType::Undefined: - Printf("Shader '%s': could not find uniform '%s': %f %f %f\n", shaderName, uniformName); + Printf("Shader '%s': could not find uniform '%s'\n", shaderName, uniformName); break; case UniformType::Int: *i = atoi(argv[3]); diff --git a/src/common/rendering/vulkan/shaders/vk_shadercache.cpp b/src/common/rendering/vulkan/shaders/vk_shadercache.cpp index 361a2135a..f01e206f4 100644 --- a/src/common/rendering/vulkan/shaders/vk_shadercache.cpp +++ b/src/common/rendering/vulkan/shaders/vk_shadercache.cpp @@ -253,7 +253,7 @@ void VkShaderCache::Load() VkCachedCompile cachedCompile; cachedCompile.LastUsed = readUInt64(fr); cachedCompile.Code.resize(readUInt32(fr)); - if (fr.Read(cachedCompile.Code.data(), cachedCompile.Code.size() * sizeof(uint32_t)) != (FileReader::Size)cachedCompile.Code.size() * sizeof(uint32_t)) + if (fr.Read(cachedCompile.Code.data(), cachedCompile.Code.size() * sizeof(uint32_t)) != (FileReader::Size)(cachedCompile.Code.size() * sizeof(uint32_t))) return; uint32_t includecount = readUInt32(fr); diff --git a/src/common/rendering/vulkan/textures/vk_texture.cpp b/src/common/rendering/vulkan/textures/vk_texture.cpp index 53a5949d5..6d74abc5a 100644 --- a/src/common/rendering/vulkan/textures/vk_texture.cpp +++ b/src/common/rendering/vulkan/textures/vk_texture.cpp @@ -188,7 +188,7 @@ void VkTextureManager::CreateBrdfLutTexture() if (lump == -1) I_FatalError("Unable to load '%s'", lumpname); auto fd = fileSystem.ReadFile(lump); if (fd.size() != 512 * 512 * 2 * sizeof(uint16_t)) - I_FatalError("Unexpected file size for '%s'"); + I_FatalError("Unexpected file size for 'bdrf.lut'"); BrdfLutTexture = ImageBuilder() .Format(VK_FORMAT_R16G16_SFLOAT) diff --git a/src/common/utility/bounds.cpp b/src/common/utility/bounds.cpp index 8b1b30b8d..f620b6d16 100644 --- a/src/common/utility/bounds.cpp +++ b/src/common/utility/bounds.cpp @@ -259,14 +259,6 @@ BBox &BBox::operator*=(const FVector3 &vec) return *this; } -BBox &BBox::operator=(const BBox &bbox) -{ - min = bbox.min; - max = bbox.max; - - return *this; -} - FVector3 BBox::operator[](int index) const { assert(index >= 0 && index < 2); diff --git a/src/common/utility/bounds.h b/src/common/utility/bounds.h index 29a86ce79..d4a3c651c 100644 --- a/src/common/utility/bounds.h +++ b/src/common/utility/bounds.h @@ -56,7 +56,6 @@ public: BBox& operator-=(const float radius); BBox operator*(const FVector3& vec) const; BBox& operator*=(const FVector3& vec); - BBox& operator=(const BBox& bbox); FVector3 operator[](int index) const; FVector3& operator[](int index); diff --git a/src/common/utility/tarray.h b/src/common/utility/tarray.h index b6e852fe5..971de6f5a 100644 --- a/src/common/utility/tarray.h +++ b/src/common/utility/tarray.h @@ -666,7 +666,7 @@ public: void SortedInsertUnique(const T &item) { - int foundIndex = SortedFind (item, false); + unsigned int foundIndex = SortedFind (item, false); if (foundIndex >= Count || Array[foundIndex] != item) { Insert (foundIndex, item); diff --git a/src/console/c_cmds.cpp b/src/console/c_cmds.cpp index fc849eaa9..bc3826c29 100644 --- a/src/console/c_cmds.cpp +++ b/src/console/c_cmds.cpp @@ -1331,7 +1331,7 @@ CCMD (mapinfo) if (myLevel->Music.IsNotEmpty()) Printf(" Music: %s%s\n", myLevel->Music[0] == '$'? "D_" : "", testlocalised(myLevel->Music.GetChars())); - Printf(" PixelStretch: %f\n", myLevel->pixelstretch); + Printf(" PixelStretch: %f\n", myLevel->pixelstretch); if (myLevel->RedirectType != NAME_None) Printf(" Redirect (Item): %s\n", myLevel->RedirectType.GetChars()); @@ -1345,7 +1345,7 @@ CCMD (mapinfo) if (myLevel->RedirectCVARMapName.IsNotEmpty()) Printf(" CVAR_Redirect (Map): %s\n", myLevel->RedirectCVARMapName.GetChars()); - Printf(" LightMode: %i\n", (int8_t)myLevel->lightmode); + Printf(" LightMode: %i\n", (int8_t)myLevel->lightmode); if (players[consoleplayer].mo && players[consoleplayer].mo->Level) { diff --git a/src/d_anonstats.cpp b/src/d_anonstats.cpp index b302ad189..8edaff008 100644 --- a/src/d_anonstats.cpp +++ b/src/d_anonstats.cpp @@ -1,4 +1,8 @@ + +#ifndef NO_SEND_STATS #define NO_SEND_STATS +#endif + #ifdef NO_SEND_STATS void D_DoAnonStats() diff --git a/src/r_data/gldefs.cpp b/src/r_data/gldefs.cpp index fea4ded27..18e365f38 100644 --- a/src/r_data/gldefs.cpp +++ b/src/r_data/gldefs.cpp @@ -316,6 +316,8 @@ void setUniformI(UniformField field, int val) case UniformType::Float: ((float *)field.Value)[0] = val; break; + default: + break; } } @@ -335,6 +337,8 @@ void setUniformF(UniformField field, float val) case UniformType::Float: ((float *)field.Value)[0] = val; break; + default: + break; } } @@ -354,6 +358,8 @@ void setUniformF(UniformField field, const FVector2 &val) case UniformType::Float: ((float *)field.Value)[0] = val.X; break; + default: + break; } } @@ -373,6 +379,8 @@ void setUniformF(UniformField field, const FVector3 &val) case UniformType::Float: ((float *)field.Value)[0] = val.X; break; + default: + break; } } @@ -392,6 +400,8 @@ void setUniformF(UniformField field, const FVector4 &val) case UniformType::Float: ((float *)field.Value)[0] = val.X; break; + default: + break; } } @@ -2535,7 +2545,8 @@ class GLDefsParser sc.MustGetFloat(); Values[3] = sc.Float; break; - + default: + break; } } diff --git a/src/rendering/hwrenderer/doom_levelmesh.cpp b/src/rendering/hwrenderer/doom_levelmesh.cpp index 9c76b9697..f4e306ed9 100644 --- a/src/rendering/hwrenderer/doom_levelmesh.cpp +++ b/src/rendering/hwrenderer/doom_levelmesh.cpp @@ -850,7 +850,7 @@ void DoomLevelMesh::ReleaseTiles(int surf) void DoomLevelMesh::FreeSide(FLevelLocals& doomMap, unsigned int sideIndex) { - if (sideIndex < 0 || sideIndex >= Sides.Size()) + if (sideIndex >= Sides.Size()) return; ReleaseTiles(Sides[sideIndex].FirstSurface); @@ -887,7 +887,7 @@ void DoomLevelMesh::FreeSide(FLevelLocals& doomMap, unsigned int sideIndex) void DoomLevelMesh::FreeFlat(FLevelLocals& doomMap, unsigned int sectorIndex) { - if (sectorIndex < 0 || sectorIndex >= Flats.Size()) + if (sectorIndex >= Flats.Size()) return; for (FSection& section : level.sections.SectionsForSector(&doomMap.sectors[sectorIndex])) @@ -2023,8 +2023,8 @@ void DoomLevelMesh::GetVisibleSurfaces(LightmapTile* tile, TArray& outSurfa while (surf != -1) { const auto& sinfo = DoomSurfaceInfos[surf]; - int controlSector = sinfo.ControlSector ? sinfo.ControlSector->Index() : (int)0xffffffffUL; - if (sinfo.Type == tile->Binding.Type && controlSector == tile->Binding.ControlSector) + uint32_t controlSector = sinfo.ControlSector ? (uint32_t)sinfo.ControlSector->Index() : (uint32_t)0xffffffffUL; + if (sinfo.Type == (DoomLevelMeshSurfaceType)tile->Binding.Type && controlSector == tile->Binding.ControlSector) { outSurfaces.Push(surf); } @@ -2084,7 +2084,7 @@ void DoomLevelMesh::DumpMesh(const FString& objFilename, const FString& mtlFilen for (unsigned i = 0, count = Mesh.IndexCount; i + 2 < count; i += 3) { - auto index = Mesh.SurfaceIndexes[i / 3]; + uint32_t index = Mesh.SurfaceIndexes[i / 3]; if (index != lastSurfaceIndex) { @@ -2429,7 +2429,7 @@ TArray LoadMapLumps(FileReader* reader, const char* wadType) for (uint32_t i = 0; i < numlumps; i++) { if (reader->Seek(offsets[i], FileReader::SeekSet) == -1) return {}; - if (reader->Read(lumps[i].Data.data(), lumps[i].Data.size()) != lumps[i].Data.size()) return {}; + if (reader->Read(lumps[i].Data.data(), lumps[i].Data.size()) != (FileReader::Size)lumps[i].Data.size()) return {}; } return lumps; diff --git a/src/rendering/hwrenderer/hw_vertexbuilder.cpp b/src/rendering/hwrenderer/hw_vertexbuilder.cpp index 33af2e483..1bb7e111e 100644 --- a/src/rendering/hwrenderer/hw_vertexbuilder.cpp +++ b/src/rendering/hwrenderer/hw_vertexbuilder.cpp @@ -459,7 +459,7 @@ static void UpdatePlaneLightmap(FRenderState& renderstate, sector_t* sec, int pl { if (origin->sub) { - int lightmap = origin->sub->LightmapTiles[origin->plane].Size() > origin->lightmapSlot ? origin->sub->LightmapTiles[origin->plane][origin->lightmapSlot] : -1; + int lightmap = origin->sub->LightmapTiles[origin->plane].Size() > (unsigned int)origin->lightmapSlot ? origin->sub->LightmapTiles[origin->plane][origin->lightmapSlot] : -1; if (lightmap >= 0) // tile may be missing if the subsector is degenerate triangle { const auto& tile = level.levelMesh->Lightmap.Tiles[lightmap]; diff --git a/src/rendering/hwrenderer/scene/hw_visibleset.cpp b/src/rendering/hwrenderer/scene/hw_visibleset.cpp index 53693c029..72e1c5b3c 100644 --- a/src/rendering/hwrenderer/scene/hw_visibleset.cpp +++ b/src/rendering/hwrenderer/scene/hw_visibleset.cpp @@ -672,7 +672,7 @@ void CameraFrustum::Set(const VSMatrix& worldToProjection, const DVector3& viewp Planes[5] = FarFrustum(worldToProjection); // Move back near plane to be slightly behind the camera position - Planes[0].W = -(Planes[0].XYZ() | viewpoint.ToXZY() - 1.0); + Planes[0].W = -((Planes[0].XYZ() | viewpoint.ToXZY()) - 1.0); for (int i = 0; i < 6; i++) { diff --git a/src/rendering/hwrenderer/scene/hw_walls.cpp b/src/rendering/hwrenderer/scene/hw_walls.cpp index dc08b1b83..d2d684f85 100644 --- a/src/rendering/hwrenderer/scene/hw_walls.cpp +++ b/src/rendering/hwrenderer/scene/hw_walls.cpp @@ -1580,9 +1580,9 @@ void HWWall::BuildFFBlock(HWWallDispatcher *di, FRenderState& state, seg_t * seg if (di->di) { if (seg->sidedef == seg->linedef->sidedef[0]) - lightmaptile = seg->linedef->sidedef[1]->LightmapTiles.Size() > 4 + roverIndex ? seg->linedef->sidedef[1]->LightmapTiles[4 + roverIndex] : -1; + lightmaptile = seg->linedef->sidedef[1]->LightmapTiles.Size() > (unsigned int)(4 + roverIndex) ? seg->linedef->sidedef[1]->LightmapTiles[4 + roverIndex] : -1; else - lightmaptile = seg->linedef->sidedef[0]->LightmapTiles.Size() > 4 + roverIndex ? seg->linedef->sidedef[0]->LightmapTiles[4 + roverIndex] : -1; + lightmaptile = seg->linedef->sidedef[0]->LightmapTiles.Size() > (unsigned int)(4 + roverIndex) ? seg->linedef->sidedef[0]->LightmapTiles[4 + roverIndex] : -1; if (lightmaptile >= 0) {