Cleanup: changing variable names in TIC() and TOC()

Removing double underscores to be ANSI-C standard compliant.
This commit is contained in:
Gabda 2019-03-02 10:50:50 +01:00 committed by Niels Martin Hansen
parent 6c6971fb43
commit 4be2c1022e
1 changed files with 7 additions and 7 deletions

View File

@ -86,15 +86,15 @@ const char *GetDebugString();
**/
#define TIC() {\
uint64 _xxx_ = ottd_rdtsc();\
static uint64 __sum__ = 0;\
static uint32 __i__ = 0;
static uint64 _sum_ = 0;\
static uint32 _i_ = 0;
#define TOC(str, count)\
__sum__ += ottd_rdtsc() - _xxx_;\
if (++__i__ == count) {\
DEBUG(misc, 0, "[%s] " OTTD_PRINTF64 " [avg: %.1f]", str, __sum__, __sum__/(double)__i__);\
__i__ = 0;\
__sum__ = 0;\
_sum_ += ottd_rdtsc() - _xxx_;\
if (++_i_ == count) {\
DEBUG(misc, 0, "[%s] " OTTD_PRINTF64 " [avg: %.1f]", str, _sum_, _sum_/(double)_i_);\
_i_ = 0;\
_sum_ = 0;\
}\
}