1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

RealToString() is always called with separator set to true.

This commit is contained in:
Bartosz Taudul
2020-01-31 01:43:24 +01:00
parent 3050f19e0b
commit f017b27ae2
4 changed files with 173 additions and 176 deletions
+11 -14
View File
@@ -214,7 +214,7 @@ const char* TimeToString( int64_t _ns )
return bufstart;
}
const char* RealToString( double val, bool separator )
const char* RealToString( double val )
{
enum { Pool = 8 };
static char bufpool[Pool][64];
@@ -228,20 +228,17 @@ const char* RealToString( double val, bool separator )
const auto vbegin = ptr;
if( separator )
{
while( *ptr != '\0' && *ptr != ',' && *ptr != '.' ) ptr++;
auto end = ptr;
while( *end != '\0' ) end++;
auto sz = end - ptr;
while( *ptr != '\0' && *ptr != ',' && *ptr != '.' ) ptr++;
auto end = ptr;
while( *end != '\0' ) end++;
auto sz = end - ptr;
while( ptr - vbegin > 3 )
{
ptr -= 3;
memmove( ptr+1, ptr, sz );
*ptr = ',';
sz += 4;
}
while( ptr - vbegin > 3 )
{
ptr -= 3;
memmove( ptr+1, ptr, sz );
*ptr = ',';
sz += 4;
}
while( *ptr != '\0' && *ptr != ',' && *ptr != '.' ) ptr++;