From 43a3188bdfc8d36785439e04daba91a19ecf7494 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 10 Oct 2020 17:26:51 +0300 Subject: [PATCH] - fixed compilation warnings reported by GCC and Clang src/common/filesystem/file_ssi.cpp:78:20: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare] src/common/filesystem/file_ssi.cpp:130:38: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] --- src/common/filesystem/file_ssi.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/filesystem/file_ssi.cpp b/src/common/filesystem/file_ssi.cpp index d475037408..64623e805e 100644 --- a/src/common/filesystem/file_ssi.cpp +++ b/src/common/filesystem/file_ssi.cpp @@ -75,7 +75,7 @@ bool FSSIFile::Open(bool quiet, int version, int lumpcount, LumpFilterInfo*) int32_t j = (version == 2 ? 267 : 254) + (lumpcount * 121); - for (int i = 0; i < NumLumps; i+=2) + for (uint32_t i = 0; i < NumLumps; i+=2) { char fn[13]; int strlength = Reader.ReadUInt8(); @@ -121,11 +121,11 @@ FResourceFile* CheckSSI(const char* filename, FileReader& file, bool quiet, Lump char buf[72]; memset(zerobuf, 0, 72); - auto skipstring = [&](int length) + auto skipstring = [&](size_t length) { - int strlength = file.ReadUInt8(); + size_t strlength = file.ReadUInt8(); if (strlength > length) return false; - int count = file.Read(buf, length); + size_t count = file.Read(buf, length); buf[length] = 0; if (count != length || strlen(buf) != strlength) return false; if (length != strlength && memcmp(buf + strlength, zerobuf, length - strlength)) return false;