Fix compiler warnings.
This commit is contained in:
parent
4a5743c67b
commit
0a54d940bb
@ -97,7 +97,7 @@ workspace "iw4x"
|
||||
-- Pre-compiled header
|
||||
pchheader "STDInclude.hpp" -- must be exactly same as used in #include directives
|
||||
pchsource "src/STDInclude.cpp" -- real path
|
||||
buildoptions { "-Zm200" } -- allocate ~150mb memory for the precompiled header. This should be enough, increase if necessary
|
||||
buildoptions { "-Zm88" }
|
||||
|
||||
-- Dependency on zlib, json11 and asio
|
||||
links { "zlib", "json11", "pdcurses", "libtomcrypt", "libtommath" }
|
||||
|
@ -86,7 +86,7 @@ namespace Components
|
||||
path.append(".ff");
|
||||
}
|
||||
|
||||
return (GetFileAttributes(path.data()) != INVALID_FILE_ATTRIBUTES);
|
||||
return std::ifstream(path.data()).good();
|
||||
}
|
||||
|
||||
const char* FastFiles::GetZoneLocation(const char* file)
|
||||
@ -104,7 +104,7 @@ namespace Components
|
||||
}
|
||||
|
||||
// Check if FastFile exists
|
||||
if (GetFileAttributes(absoluteFile.data()) != INVALID_FILE_ATTRIBUTES)
|
||||
if (std::ifstream(absoluteFile.data()).good())
|
||||
{
|
||||
return Utils::VA("%s", path.data());
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ namespace Components
|
||||
|
||||
void StructuredData::PatchPlayerDataEnum(Game::structuredDataDef_t* data, StructuredData::PlayerDataType type, std::vector<StructuredData::EnumEntry>& entries)
|
||||
{
|
||||
if (!data || !data->data) return;
|
||||
if (!data || !data->data || type >= StructuredData::ENUM_MAX) return;
|
||||
|
||||
Game::structuredDataEnum_t* dataEnum = &data->data->enums[type];
|
||||
|
||||
@ -74,9 +74,9 @@ namespace Components
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int j = dataEnum->numIndices + i; j > pos; j--)
|
||||
for (unsigned int j = dataEnum->numIndices + i; j > pos && j < static_cast<unsigned int>(StructuredData::IndexCount[type]); j--)
|
||||
{
|
||||
StructuredData::Indices[type][j] = StructuredData::Indices[type][j - 1];
|
||||
memcpy(&StructuredData::Indices[type][j], &StructuredData::Indices[type][j - 1], sizeof(Game::structuredDataEnumIndex_t));
|
||||
}
|
||||
|
||||
StructuredData::Indices[type][pos].index = entries[i].statOffset + lastIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user