Skip to content

Commit 7b6bca5

Browse files
committed
profiler: rtlib: allow compile on older gcc
- for( int i = ... not allowed on older gcc
1 parent d22b5d2 commit 7b6bca5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/rtlib/profile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,14 @@ void fb_hPROFILER_METRICS_Strings( FB_PROFILER_METRICS *metrics, STRING_TABLE *s
346346
void fb_hPROFILER_METRICS_HashTable( FB_PROFILER_METRICS *metrics, STRING_HASH_TABLE *hash )
347347
{
348348
STRING_HASH_TB *tb;
349+
int i;
349350
if( metrics && hash ) {
350351
tb = hash->tb;
351352
while( tb ) {
352353
metrics->hash_bytes_allocated += sizeof( STRING_HASH_TB );
353354
metrics->hash_count_blocks += 1;
354355

355-
for( int i=0; i < STRING_HASH_TB_SIZE; i++ )
356+
for( i=0; i < STRING_HASH_TB_SIZE; i++ )
356357
{
357358
if( tb->items[i] ) {
358359
metrics->hash_count_items += 1;

src/rtlib/profile_calls.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,14 @@ void fb_PROFILECTX_Destructor( void* data )
340340
static void fb_hPROFILER_METRICS_Procs( FB_PROFILER_METRICS *metrics, FB_PROCINFO_TB *proc_tb )
341341
{
342342
FB_PROCINFO_TB *tb;
343+
int i;
343344
if( metrics && proc_tb ) {
344345
tb = proc_tb;
345346
while( tb ) {
346347
metrics->procs_bytes_allocated += sizeof( FB_PROCINFO_TB );
347348
metrics->procs_count_blocks += 1;
348349

349-
for( int i = 0; i < PROC_INFO_TB_SIZE; i++ )
350+
for( i = 0; i < PROC_INFO_TB_SIZE; i++ )
350351
{
351352
if( tb->procinfo[i].name ) {
352353
metrics->procs_count_items += 1;

0 commit comments

Comments
 (0)