Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
This commit is contained in:
@@ -47,7 +47,7 @@ void NewGRFProfiler::BeginResolve(const ResolverObject &resolver)
|
||||
using namespace std::chrono;
|
||||
this->cur_call.root_sprite = resolver.root_spritegroup->nfo_line;
|
||||
this->cur_call.subs = 0;
|
||||
this->cur_call.time = (uint32)time_point_cast<microseconds>(high_resolution_clock::now()).time_since_epoch().count();
|
||||
this->cur_call.time = (uint32_t)time_point_cast<microseconds>(high_resolution_clock::now()).time_since_epoch().count();
|
||||
this->cur_call.tick = TimerGameTick::counter;
|
||||
this->cur_call.cb = resolver.callback;
|
||||
this->cur_call.feat = resolver.GetFeature();
|
||||
@@ -60,7 +60,7 @@ void NewGRFProfiler::BeginResolve(const ResolverObject &resolver)
|
||||
void NewGRFProfiler::EndResolve(const SpriteGroup *result)
|
||||
{
|
||||
using namespace std::chrono;
|
||||
this->cur_call.time = (uint32)time_point_cast<microseconds>(high_resolution_clock::now()).time_since_epoch().count() - this->cur_call.time;
|
||||
this->cur_call.time = (uint32_t)time_point_cast<microseconds>(high_resolution_clock::now()).time_since_epoch().count() - this->cur_call.time;
|
||||
|
||||
if (result == nullptr) {
|
||||
this->cur_call.result = 0;
|
||||
@@ -90,7 +90,7 @@ void NewGRFProfiler::Start()
|
||||
this->start_tick = TimerGameTick::counter;
|
||||
}
|
||||
|
||||
uint32 NewGRFProfiler::Finish()
|
||||
uint32_t NewGRFProfiler::Finish()
|
||||
{
|
||||
if (!this->active) return 0;
|
||||
|
||||
@@ -107,7 +107,7 @@ uint32 NewGRFProfiler::Finish()
|
||||
FILE *f = FioFOpenFile(filename, "wt", Subdirectory::NO_DIRECTORY);
|
||||
FileCloser fcloser(f);
|
||||
|
||||
uint32 total_microseconds = 0;
|
||||
uint32_t total_microseconds = 0;
|
||||
|
||||
fmt::print(f, "Tick,Sprite,Feature,Item,CallbackID,Microseconds,Depth,Result\n");
|
||||
for (const Call &c : this->calls) {
|
||||
@@ -134,12 +134,12 @@ 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));
|
||||
}
|
||||
|
||||
/* static */ uint32 NewGRFProfiler::FinishAll()
|
||||
/* static */ uint32_t NewGRFProfiler::FinishAll()
|
||||
{
|
||||
NewGRFProfiler::AbortTimer();
|
||||
|
||||
uint64 max_ticks = 0;
|
||||
uint32 total_microseconds = 0;
|
||||
uint64_t max_ticks = 0;
|
||||
uint32_t total_microseconds = 0;
|
||||
for (NewGRFProfiler &pr : _newgrf_profilers) {
|
||||
if (pr.active) {
|
||||
total_microseconds += pr.Finish();
|
||||
@@ -165,7 +165,7 @@ static TimeoutTimer<TimerGameTick> _profiling_finish_timeout(0, []()
|
||||
/**
|
||||
* Start the timeout timer that will finish all profiling sessions.
|
||||
*/
|
||||
/* static */ void NewGRFProfiler::StartTimer(uint64 ticks)
|
||||
/* static */ void NewGRFProfiler::StartTimer(uint64_t ticks)
|
||||
{
|
||||
_profiling_finish_timeout.Reset(ticks);
|
||||
}
|
||||
|
Reference in New Issue
Block a user