mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 15:54:31 +01:00
Use named casts instead of old-style casts
Change prepared with clang-tidy and google-readability-casting check
This commit is contained in:
committed by
GitHub
parent
cfd94d4fa5
commit
2323cc1596
@@ -121,7 +121,7 @@ static std::vector<paint_session> extract_paint_session(const std::string parkFi
|
||||
dpi.width = resolutionWidth;
|
||||
dpi.height = resolutionHeight;
|
||||
dpi.pitch = 0;
|
||||
dpi.bits = (uint8_t*)malloc(dpi.width * dpi.height);
|
||||
dpi.bits = static_cast<uint8_t*>(malloc(dpi.width * dpi.height));
|
||||
|
||||
log_info("Obtaining sprite data...");
|
||||
viewport_render(&dpi, &viewport, 0, 0, viewport.width, viewport.height, &sessions);
|
||||
@@ -190,11 +190,11 @@ static int cmdline_for_bench_sprite_sort(int argc, const char** argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
argv_for_benchmark.push_back((char*)argv[i]);
|
||||
argv_for_benchmark.push_back(const_cast<char*>(argv[i]));
|
||||
}
|
||||
}
|
||||
// Update argc with all the changes made
|
||||
argc = (int)argv_for_benchmark.size();
|
||||
argc = static_cast<int>(argv_for_benchmark.size());
|
||||
::benchmark::Initialize(&argc, &argv_for_benchmark[0]);
|
||||
if (::benchmark::ReportUnrecognizedArguments(argc, &argv_for_benchmark[0]))
|
||||
return -1;
|
||||
@@ -204,7 +204,7 @@ static int cmdline_for_bench_sprite_sort(int argc, const char** argv)
|
||||
|
||||
static exitcode_t HandleBenchSpriteSort(CommandLineArgEnumerator* argEnumerator)
|
||||
{
|
||||
const char** argv = (const char**)argEnumerator->GetArguments() + argEnumerator->GetIndex();
|
||||
const char** argv = const_cast<const char**>(argEnumerator->GetArguments()) + argEnumerator->GetIndex();
|
||||
int32_t argc = argEnumerator->GetCount() - argEnumerator->GetIndex();
|
||||
int32_t result = cmdline_for_bench_sprite_sort(argc, argv);
|
||||
if (result < 0)
|
||||
|
||||
Reference in New Issue
Block a user