From 23ba70347189a3029cd4929e63334a8a45e9a149 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 9 Feb 2025 18:58:39 +0100 Subject: [PATCH] Another windows build fix --- openVulkanoCpp/IO/Archive/ArchiveReader.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/openVulkanoCpp/IO/Archive/ArchiveReader.cpp b/openVulkanoCpp/IO/Archive/ArchiveReader.cpp index 4e98bee..c7af92a 100644 --- a/openVulkanoCpp/IO/Archive/ArchiveReader.cpp +++ b/openVulkanoCpp/IO/Archive/ArchiveReader.cpp @@ -70,9 +70,9 @@ namespace OpenVulkano { PrepOpen(); if constexpr (std::is_same_v) - ChkErr(archive_read_open_filename(m_archive, archiveFile.c_str(), BUFFER_SIZE)); + ChkErr(archive_read_open_filename(m_archive, (const char*)archiveFile.c_str(), BUFFER_SIZE)); else - ChkErr(archive_read_open_filename_w(m_archive, (wchar_t*)archiveFile.c_str(), BUFFER_SIZE)); + ChkErr(archive_read_open_filename_w(m_archive, (const wchar_t*)archiveFile.c_str(), BUFFER_SIZE)); ReadNextHeader(); return HasNext(); } @@ -82,10 +82,7 @@ namespace OpenVulkano { if (archiveFile[0] == '\0') { - if (m_logger) - { - m_logger->error("Unable to open archive file with an empty name!"); - } + if (m_logger) m_logger->error("Unable to open archive file with an empty name!"); return false; } PrepOpen(); @@ -110,14 +107,14 @@ namespace OpenVulkano bool ArchiveReader::Open(const std::vector& archiveFiles) { if (archiveFiles.empty()) return false; - ArchiveConfiguration ac = ArchiveConfiguration::FromFileName(archiveFiles.front().c_str()); + const ArchiveConfiguration ac = ArchiveConfiguration::FromFileName(archiveFiles.front().c_str()); if (ac.type == ArchiveType::TAR) // TODO handle all archive types correctly { // Queue based approach for all archive types that do not natively support split archives for(const std::string& file : archiveFiles) { m_archivesToRead.push(file); } - bool state = Open(m_archivesToRead.front()); + const bool state = Open(m_archivesToRead.front()); m_archivesToRead.pop(); return state; }