diff --git a/src/common/filesystem/include/fs_filesystem.h b/src/common/filesystem/include/fs_filesystem.h index bf3fe0e2b..bfd134758 100644 --- a/src/common/filesystem/include/fs_filesystem.h +++ b/src/common/filesystem/include/fs_filesystem.h @@ -119,7 +119,7 @@ public: static uint32_t LumpNameHash (const char *name); // [RH] Create hash key from an 8-char name - int FileLength (int lump) const; + ptrdiff_t FileLength (int lump) const; int GetFileFlags (int lump); // Return the flags for this lump const char* GetFileShortName(int lump) const; const char *GetFileFullName (int lump, bool returnshort = true) const; // [RH] Returns the lump's full name diff --git a/src/common/filesystem/source/ancientzip.cpp b/src/common/filesystem/source/ancientzip.cpp index b95d424a3..34356306e 100644 --- a/src/common/filesystem/source/ancientzip.cpp +++ b/src/common/filesystem/source/ancientzip.cpp @@ -167,7 +167,7 @@ unsigned int FZipExploder::InitTable(std::vector &decoder, int numspot size_t start = decoder.size(); decoder.resize(decoder.size() + numspots); memset(&decoder[start], 0, sizeof(HuffNode)*numspots); - return start; + return (unsigned)start; } int FZipExploder::buildercmp(const void *a, const void *b) diff --git a/src/common/filesystem/source/file_hog.cpp b/src/common/filesystem/source/file_hog.cpp index f81c921c6..cc4eef4ff 100644 --- a/src/common/filesystem/source/file_hog.cpp +++ b/src/common/filesystem/source/file_hog.cpp @@ -73,7 +73,7 @@ static bool OpenHog(FResourceFile* rf, LumpFilterInfo* filter) entries.push_back(Entry); Reader->Seek(elength, FileReader::SeekCur); } - auto Entries = rf->AllocateEntries(entries.size()); + auto Entries = rf->AllocateEntries((int)entries.size()); memcpy(Entries, entries.data(), entries.size() * sizeof(Entries[0])); rf->GenerateHash(); return true; diff --git a/src/common/filesystem/source/filesystem.cpp b/src/common/filesystem/source/filesystem.cpp index e2be0b187..394735d85 100644 --- a/src/common/filesystem/source/filesystem.cpp +++ b/src/common/filesystem/source/filesystem.cpp @@ -774,14 +774,14 @@ int FileSystem::GetResource (int resid, const char *type, int filenum) const // //========================================================================== -int FileSystem::FileLength (int lump) const +ptrdiff_t FileSystem::FileLength (int lump) const { if ((size_t)lump >= NumEntries) { return -1; } const auto &lump_p = FileInfo[lump]; - return lump_p.resfile->Length(lump_p.resindex); + return (int)lump_p.resfile->Length(lump_p.resindex); } //========================================================================== diff --git a/src/common/filesystem/source/unicode.cpp b/src/common/filesystem/source/unicode.cpp index 7b5fd2aef..3d148270a 100644 --- a/src/common/filesystem/source/unicode.cpp +++ b/src/common/filesystem/source/unicode.cpp @@ -151,7 +151,7 @@ bool unicode_validate(const char* str) while (*str != 0) { int cp; - int result = utf8proc_iterate((const uint8_t*)str, -1, &cp); + auto result = utf8proc_iterate((const uint8_t*)str, -1, &cp); if (result < 0) return false; } return true;