1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +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:
Michał Janiszewski
2020-04-22 17:09:29 +02:00
committed by GitHub
parent cfd94d4fa5
commit 2323cc1596
114 changed files with 604 additions and 560 deletions

View File

@@ -198,7 +198,7 @@ std::string screenshot_dump_png_32bpp(int32_t width, int32_t height, const void*
return "";
}
const auto pixels8 = (const uint8_t*)pixels;
const auto pixels8 = static_cast<const uint8_t*>(pixels);
const auto pixelsLen = width * 4 * height;
try
@@ -333,7 +333,7 @@ static rct_drawpixelinfo CreateDPI(const rct_viewport& viewport)
if (viewport.flags & VIEWPORT_FLAG_TRANSPARENT_BACKGROUND)
{
std::memset(dpi.bits, PALETTE_INDEX_0, (size_t)dpi.width * dpi.height);
std::memset(dpi.bits, PALETTE_INDEX_0, static_cast<size_t>(dpi.width) * dpi.height);
}
return dpi;