Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f427c1

Browse files
committed
pg_test_timing: Lame hack to work around compiler warning.
Fujii Masao, plus a comment by me. While I'm at it, correctly tabifythis chunk of code.
1 parentb75fbe9 commit3f427c1

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

‎contrib/pg_test_timing/pg_test_timing.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ test_timing(int32 duration)
107107
instr_timestart_time,end_time,temp;
108108

109109
staticint64histogram[32];
110+
charbuf[100];
110111

111112
total_time=duration>0 ?duration*1000000 :0;
112113

@@ -150,13 +151,15 @@ test_timing(int32 duration)
150151
printf("%9s: %10s %9s\n","< usec","count","percent");
151152

152153
found=0;
153-
for (i=31;i >=0;i--)
154-
{
155-
if (found||histogram[i])
156-
{
157-
found=1;
158-
printf("%9ld: %10ld %8.5f%%\n",1l <<i,histogram[i],
159-
(double)histogram[i]*100 /loop_count);
160-
}
161-
}
154+
for (i=31;i >=0;i--)
155+
{
156+
if (found||histogram[i])
157+
{
158+
found=1;
159+
/* lame hack to work around INT64_FORMAT deficiencies */
160+
snprintf(buf,sizeof(buf),INT64_FORMAT,histogram[i]);
161+
printf("%9ld: %10s %8.5f%%\n",1l <<i,buf,
162+
(double)histogram[i]*100 /loop_count);
163+
}
164+
}
162165
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp