Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unnecessary #pragma warning #596

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/Features/LightLimitFIx/ParticleLights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ void ParticleLights::GetConfigs()
}

filename.erase(filename.length() - 4); // Remove ".ini"
#pragma warning(push)
#pragma warning(disable: 4244)
std::transform(filename.begin(), filename.end(), filename.begin(), ::tolower);
#pragma warning(pop)
std::transform(filename.begin(), filename.end(), filename.begin(), [](auto c) { return (char)::tolower(c); });

logger::debug("[LLF] Inserting {}", filename);

Expand Down Expand Up @@ -126,10 +123,7 @@ void ParticleLights::GetConfigs()
}

filename.erase(filename.length() - 4); // Remove ".ini"
#pragma warning(push)
#pragma warning(disable: 4244)
std::transform(filename.begin(), filename.end(), filename.begin(), ::tolower);
#pragma warning(pop)
std::transform(filename.begin(), filename.end(), filename.begin(), [](auto c) { return (char)::tolower(c); });

logger::debug("[LLF] Inserting {}", filename);

Expand Down
5 changes: 1 addition & 4 deletions src/Features/LightLimitFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,8 @@ std::string ExtractTextureStem(std::string_view a_path)
a_path = a_path.substr(lastSeparatorPos + 1);
a_path.remove_suffix(4); // Remove ".dds"

#pragma warning(push)
#pragma warning(disable: 4244)
auto textureNameView = a_path | std::views::transform(::tolower);
auto textureNameView = a_path | std::views::transform([](auto c) { return (char)::tolower(c); });
std::string textureName = { textureNameView.begin(), textureNameView.end() };
#pragma warning(pop)

return textureName;
}
Expand Down
10 changes: 2 additions & 8 deletions src/ShaderCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1475,10 +1475,7 @@ namespace SIE
descriptor);
} else {
std::array<size_t, 3> bufferSizes = { 0, 0, 0 };
#pragma warning(push)
#pragma warning(disable: 4244)
std::fill(newShader->constantTable.begin(), newShader->constantTable.end(), 0);
#pragma warning(pop)
std::ranges::fill(newShader->constantTable, (int8_t)0);
ReflectConstantBuffers(*reflector.Get(), bufferSizes, newShader->constantTable, newShader->shaderDesc,
ShaderClass::Vertex, descriptor, shader);
if (bufferSizes[0] != 0) {
Expand Down Expand Up @@ -1530,10 +1527,7 @@ namespace SIE
descriptor);
} else {
std::array<size_t, 3> bufferSizes = { 0, 0, 0 };
#pragma warning(push)
#pragma warning(disable: 4244)
std::fill(newShader->constantTable.begin(), newShader->constantTable.end(), 0);
#pragma warning(pop)
std::ranges::fill(newShader->constantTable, (int8_t)0);
uint64_t dummy;
ReflectConstantBuffers(*reflector.Get(), bufferSizes, newShader->constantTable,
dummy,
Expand Down
Loading