Skip to content

Commit

Permalink
addressed a few warnings in the filesystem code.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Dec 17, 2023
1 parent df5dc5e commit efef4bd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/common/filesystem/include/fs_filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class FileSystem

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
Expand Down
2 changes: 1 addition & 1 deletion src/common/filesystem/source/ancientzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ unsigned int FZipExploder::InitTable(std::vector<HuffNode> &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)
Expand Down
2 changes: 1 addition & 1 deletion src/common/filesystem/source/file_hog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/common/filesystem/source/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

//==========================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/common/filesystem/source/unicode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit efef4bd

Please sign in to comment.