From afd2c8043e03b4b62d71889d4d5a056becce9bbc Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sat, 8 Feb 2025 16:16:03 +0100 Subject: [PATCH] Silence some warnings --- openVulkanoCpp/IO/Archive/IArchiveWriter.hpp | 6 +++--- openVulkanoCpp/Image/YuvUtils.hpp | 4 ++-- openVulkanoCpp/Scene/DataFormat.cpp | 6 +++--- openVulkanoCpp/Scene/Export/MeshWriter.cpp | 12 ++++++------ openVulkanoCpp/Scene/Geometry.cpp | 2 +- openVulkanoCpp/Scene/Geometry.hpp | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/openVulkanoCpp/IO/Archive/IArchiveWriter.hpp b/openVulkanoCpp/IO/Archive/IArchiveWriter.hpp index efa82da..e54d36e 100644 --- a/openVulkanoCpp/IO/Archive/IArchiveWriter.hpp +++ b/openVulkanoCpp/IO/Archive/IArchiveWriter.hpp @@ -52,7 +52,7 @@ namespace OpenVulkano bool AddFile(const char* inArchiveName, const void* buffer, size_t length) { - FileDescription description = FileDescription::MakeDescriptionForFile(inArchiveName, length); + FileDescription description = FileDescription::MkFile(inArchiveName, length); return AddFile(description, buffer); } @@ -64,7 +64,7 @@ namespace OpenVulkano if (buffer.first == nullptr) continue; size += buffer.second; } - const FileDescription description = FileDescription::MakeDescriptionForFile(fileName, size); + const FileDescription description = FileDescription::MkFile(fileName, size); return AddFile(description, buffers); } @@ -95,4 +95,4 @@ namespace OpenVulkano return true; } }; -} \ No newline at end of file +} diff --git a/openVulkanoCpp/Image/YuvUtils.hpp b/openVulkanoCpp/Image/YuvUtils.hpp index 733253d..d57e9f1 100644 --- a/openVulkanoCpp/Image/YuvUtils.hpp +++ b/openVulkanoCpp/Image/YuvUtils.hpp @@ -13,9 +13,9 @@ namespace OpenVulkano { namespace YuvUtils { - inline void NV12FromChromaPlanes(unsigned char* __restrict src, unsigned char* __restrict dest, int chromaChannelPixelCount) + inline void NV12FromChromaPlanes(unsigned char* __restrict src, unsigned char* __restrict dest, size_t chromaChannelPixelCount) { - for(int i = 0; i < chromaChannelPixelCount; i++) + for(size_t i = 0; i < chromaChannelPixelCount; i++) { dest[i * 2] = src[i]; dest[i * 2 + 1] = src[i + chromaChannelPixelCount]; diff --git a/openVulkanoCpp/Scene/DataFormat.cpp b/openVulkanoCpp/Scene/DataFormat.cpp index 723a69c..fb1185b 100644 --- a/openVulkanoCpp/Scene/DataFormat.cpp +++ b/openVulkanoCpp/Scene/DataFormat.cpp @@ -242,8 +242,8 @@ namespace OpenVulkano { if (format == m_format) { - return format >= BC1_RGB_UNORM_BLOCK && format <= ASTC_12x12_SRGB_BLOCK - || format >= ASTC_4x4_SFLOAT_BLOCK && format <= PVRTC2_4BPP_SRGB_BLOCK_IMG; + return (format >= BC1_RGB_UNORM_BLOCK && format <= ASTC_12x12_SRGB_BLOCK) || + (format >= ASTC_4x4_SFLOAT_BLOCK && format <= PVRTC2_4BPP_SRGB_BLOCK_IMG); } } return false; @@ -268,4 +268,4 @@ namespace OpenVulkano #ifndef __APPLE__ DataFormat DataFormat::GetFromMetalPixelFormat(int formatId) { return UNDEFINED; } #endif -} \ No newline at end of file +} diff --git a/openVulkanoCpp/Scene/Export/MeshWriter.cpp b/openVulkanoCpp/Scene/Export/MeshWriter.cpp index c748015..19f0fc1 100644 --- a/openVulkanoCpp/Scene/Export/MeshWriter.cpp +++ b/openVulkanoCpp/Scene/Export/MeshWriter.cpp @@ -54,18 +54,18 @@ namespace OpenVulkano::Scene std::stringstream objContents; WriteObjContents(geometry, DEFAULT_OBJ_MATERIAL_NAME, objContents); std::string objContentsStr = objContents.str(); - FileDescription objDesc = FileDescription::MakeDescriptionForFile("model.obj", objContentsStr.size()); + FileDescription objDesc = FileDescription::MkFile("model.obj", objContentsStr.size()); zipWriter.AddFile(objDesc, objContentsStr.data()); } { - FileDescription mtlDesc = FileDescription::MakeDescriptionForFile("material.mtl", DEFAULT_OBJ_MATERIAL_CONTENTS.size()); + FileDescription mtlDesc = FileDescription::MkFile("material.mtl", DEFAULT_OBJ_MATERIAL_CONTENTS.size()); zipWriter.AddFile(mtlDesc, DEFAULT_OBJ_MATERIAL_CONTENTS.data()); } if (!texturePath.empty() && std::filesystem::exists(texturePath)) { MemMappedFile textureFile(texturePath); - FileDescription texDesc = FileDescription::MakeDescriptionForFile("texture.png", textureFile.Size()); + FileDescription texDesc = FileDescription::MkFile("texture.png", textureFile.Size()); zipWriter.AddFile(texDesc, textureFile.Data()); } } @@ -78,14 +78,14 @@ namespace OpenVulkano::Scene std::stringstream usdFile; WriteUsdContents(usdFile, geometry); std::string usdFileStr = usdFile.str(); - FileDescription usdDesc = FileDescription::MakeDescriptionForFile("geometry.usda", usdFileStr.size()); + FileDescription usdDesc = FileDescription::MkFile("geometry.usda", usdFileStr.size()); zipWriter.AddFile(usdDesc, usdFileStr.data()); } if (!texturePath.empty() && std::filesystem::exists(texturePath)) { MemMappedFile textureFile(texturePath); - FileDescription texDesc = FileDescription::MakeDescriptionForFile("texture.png", textureFile.Size()); + FileDescription texDesc = FileDescription::MkFile("texture.png", textureFile.Size()); zipWriter.AddFile(texDesc, textureFile.Data()); } } @@ -185,4 +185,4 @@ namespace OpenVulkano::Scene throw std::runtime_error("Unable to convert the scene to FBX: Assimp is not available!"); #endif } -} \ No newline at end of file +} diff --git a/openVulkanoCpp/Scene/Geometry.cpp b/openVulkanoCpp/Scene/Geometry.cpp index 4fa4c9f..cfd5414 100644 --- a/openVulkanoCpp/Scene/Geometry.cpp +++ b/openVulkanoCpp/Scene/Geometry.cpp @@ -154,7 +154,7 @@ namespace OpenVulkano::Scene indices = nullptr; } - uint32_t Geometry::GetIndex(uint32_t index) const + uint32_t Geometry::GetIndex(size_t index) const { uint32_t result = 0; diff --git a/openVulkanoCpp/Scene/Geometry.hpp b/openVulkanoCpp/Scene/Geometry.hpp index cd62b18..cef7b1d 100644 --- a/openVulkanoCpp/Scene/Geometry.hpp +++ b/openVulkanoCpp/Scene/Geometry.hpp @@ -56,7 +56,7 @@ namespace OpenVulkano Vertex* GetVertices() const { return vertices; } void* GetIndices() const { return indices; } - uint32_t GetIndex(uint32_t index) const; + uint32_t GetIndex(size_t index) const; uint16_t* GetIndices16() const { return static_cast(indices); } uint32_t* GetIndices32() const { return static_cast(indices); } uint32_t GetIndexCount() const { return indexCount; }