1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 01:35:06 +01:00

Use named casts on openrct2/(util|windows|scenario|title) (#11146)

This commit is contained in:
Tulio Leao
2020-04-17 14:45:19 -03:00
committed by GitHub
parent fd69886350
commit 116bcb5ccb
8 changed files with 69 additions and 67 deletions

View File

@@ -88,7 +88,7 @@ TitleSequence* LoadTitleSequence(const utf8* path)
isZip = false;
}
auto commands = LegacyScriptRead((utf8*)script.data(), script.size(), saves);
auto commands = LegacyScriptRead(reinterpret_cast<utf8*>(script.data()), script.size(), saves);
TitleSequence* seq = CreateTitleSequence();
seq->Name = Path::GetFileNameWithoutExtension(path);
@@ -174,7 +174,7 @@ void TitleSequenceCloseParkHandle(TitleSequenceParkHandle* handle)
if (handle != nullptr)
{
Memory::Free(handle->HintPath);
delete ((IStream*)handle->Stream);
delete (static_cast<IStream*>(handle->Stream));
Memory::Free(handle);
}
}
@@ -408,7 +408,7 @@ static std::vector<TitleCommand> LegacyScriptRead(utf8* script, size_t scriptLen
{
if (String::Equals(part1, saves[i], true))
{
command.SaveIndex = (uint8_t)i;
command.SaveIndex = static_cast<uint8_t>(i);
break;
}
}
@@ -544,7 +544,7 @@ static std::vector<uint8_t> ReadScriptFile(const utf8* path)
try
{
auto fs = FileStream(path, FILE_MODE_OPEN);
auto size = (size_t)fs.GetLength();
auto size = static_cast<size_t>(fs.GetLength());
result.resize(size);
fs.Read(result.data(), size);
}