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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user