1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-30 23:54:35 +01:00

Codechange: replace BSWAP32/BSWAP16 with std::byteswap

This commit is contained in:
Rubidium
2025-01-28 07:30:53 +01:00
committed by rubidium42
parent 2481f2e085
commit 4099acb946
25 changed files with 93 additions and 96 deletions

View File

@@ -95,14 +95,14 @@ uint32_t NewGRFProfiler::Finish()
if (!this->active) return 0;
if (this->calls.empty()) {
IConsolePrint(CC_DEBUG, "Finished profile of NewGRF [{:08X}], no events collected, not writing a file.", BSWAP32(this->grffile->grfid));
IConsolePrint(CC_DEBUG, "Finished profile of NewGRF [{:08X}], no events collected, not writing a file.", std::byteswap(this->grffile->grfid));
this->Abort();
return 0;
}
std::string filename = this->GetOutputFilename();
IConsolePrint(CC_DEBUG, "Finished profile of NewGRF [{:08X}], writing {} events to '{}'.", BSWAP32(this->grffile->grfid), this->calls.size(), filename);
IConsolePrint(CC_DEBUG, "Finished profile of NewGRF [{:08X}], writing {} events to '{}'.", std::byteswap(this->grffile->grfid), this->calls.size(), filename);
uint32_t total_microseconds = 0;
@@ -134,7 +134,7 @@ void NewGRFProfiler::Abort()
*/
std::string NewGRFProfiler::GetOutputFilename() const
{
return fmt::format("{}grfprofile-{:%Y%m%d-%H%M}-{:08X}.csv", FiosGetScreenshotDir(), fmt::localtime(time(nullptr)), BSWAP32(this->grffile->grfid));
return fmt::format("{}grfprofile-{:%Y%m%d-%H%M}-{:08X}.csv", FiosGetScreenshotDir(), fmt::localtime(time(nullptr)), std::byteswap(this->grffile->grfid));
}
/* static */ uint32_t NewGRFProfiler::FinishAll()