From 60aad6335ca6e304b9d1f4af18d09b08e8939998 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 2 Jun 2023 00:00:39 -0500 Subject: [PATCH] [keel] Enable sign-conversion warning --- src/keel/CMakeLists.txt | 4 ++++ src/keel/asset.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/keel/CMakeLists.txt b/src/keel/CMakeLists.txt index ce01e383..f9fbca2f 100644 --- a/src/keel/CMakeLists.txt +++ b/src/keel/CMakeLists.txt @@ -9,6 +9,10 @@ add_library( typestore.cpp ) +if(NOT MSVC) + target_compile_options(Keel PRIVATE -Wsign-conversion) +endif() + target_link_libraries( Keel PUBLIC OxClaw diff --git a/src/keel/asset.cpp b/src/keel/asset.cpp index ce324ef2..913f66af 100644 --- a/src/keel/asset.cpp +++ b/src/keel/asset.cpp @@ -32,7 +32,7 @@ ox::Result readAsset(ox::TypeStore *ts, const ox::Buffer &buff) ox::Result readAssetHeader(const char *buff, std::size_t buffLen) noexcept { AssetHdr out; const auto err = readUuidHeader(buff, buffLen).moveTo(&out.uuid); - const auto offset = err ? 0 : K1HdrSz; + const auto offset = err ? 0u : K1HdrSz; buff = buff + offset; buffLen = buffLen - offset; oxReturnError(ox::readClawHeader(buff, buffLen).moveTo(&out.clawHdr));