Skip to content

Commit

Permalink
[cage] fix formats in runcore/subprof.c without long long
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Dec 9, 2014
1 parent 3f1cb74 commit 925749b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/runcore/subprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,12 @@ dump_profile_data(PARROT_INTERP, ARGIN(subprofiledata *spdata))
unsigned int totalops = 0;
UHUGEINTVAL totalticks = 0;

#ifdef HAS_LONGLONG
# define UHUGEINTVAL_FMT "%llu"
#else
# define UHUGEINTVAL_FMT "%lu"
#endif

if (!spdata->profile_type)
return;

Expand All @@ -846,7 +852,7 @@ dump_profile_data(PARROT_INTERP, ARGIN(subprofiledata *spdata))
});

fprintf(stderr, "events: ops ticks\n");
fprintf(stderr, "summary: %d %lld\n", totalops, totalticks);
fprintf(stderr, "summary: %d "UHUGEINTVAL_FMT"\n", totalops, totalticks);

parrot_hash_iterate(spdata->sphash,
subprofile *hsp = (subprofile*)_bucket->value;
Expand Down Expand Up @@ -896,7 +902,7 @@ dump_profile_data(PARROT_INTERP, ARGIN(subprofiledata *spdata))

if (li->ops || li->ticks)
fprintf(stderr,
"%d %u %llu\n",
"%d %u "UHUGEINTVAL_FMT"\n",
(int) srcline,
(unsigned int) li->ops,
(unsigned long long) li->ticks);
Expand All @@ -909,7 +915,7 @@ dump_profile_data(PARROT_INTERP, ARGIN(subprofiledata *spdata))
fprintf(stderr, "\n");
fprintf(stderr, "calls=%u %d\n", (unsigned int) ci->count, (int) csp->srcline);
fprintf(stderr,
"%d %u %llu\n",
"%d %u "UHUGEINTVAL_FMT"\n",
(int) srcline,
(unsigned int) ci->ops,
(unsigned long long) ci->ticks);
Expand Down Expand Up @@ -937,14 +943,14 @@ dump_profile_data(PARROT_INTERP, ARGIN(subprofiledata *spdata))
fprintf(stderr, "\n");
fprintf(stderr, "calls=%u %d\n", (unsigned int) ci->count, (int) csp->srcline);
fprintf(stderr,
"%d %u %llu\n",
"%d %u "UHUGEINTVAL_FMT"\n",
0,
(unsigned int) ci->ops,
(unsigned long long) ci->ticks);
}
}

fprintf(stderr, "\ntotals: %d %lld\n", totalops, totalticks);
fprintf(stderr, "\ntotals: %d "UHUGEINTVAL_FMT"\n", totalops, totalticks);
}


Expand Down

0 comments on commit 925749b

Please sign in to comment.