@@ -207,8 +207,8 @@ test_pattern(const test_spec *spec)
207
207
endtime = GetCurrentTimestamp ();
208
208
209
209
if (intset_test_stats )
210
- fprintf (stderr , "added %lu values in %lu ms\n" ,
211
- spec -> num_values , (endtime - starttime ) / 1000 );
210
+ fprintf (stderr , "added " UINT64_FORMAT " values in %d ms\n" ,
211
+ spec -> num_values , (int ) ( endtime - starttime ) / 1000 );
212
212
213
213
/*
214
214
* Print stats on the amount of memory used.
@@ -228,7 +228,7 @@ test_pattern(const test_spec *spec)
228
228
* MemoryContextStats().
229
229
*/
230
230
mem_usage = intset_memory_usage (intset );
231
- fprintf (stderr , "intset_memory_usage() reported %lu (%0.2f bytes / integer)\n" ,
231
+ fprintf (stderr , "intset_memory_usage() reported " UINT64_FORMAT " (%0.2f bytes / integer)\n" ,
232
232
mem_usage , (double ) mem_usage / spec -> num_values );
233
233
234
234
MemoryContextStats (intset_ctx );
@@ -237,7 +237,7 @@ test_pattern(const test_spec *spec)
237
237
/* Check that intset_get_num_entries works */
238
238
n = intset_num_entries (intset );
239
239
if (n != spec -> num_values )
240
- elog (ERROR , "intset_num_entries returned %lu , expected %lu" , n , spec -> num_values );
240
+ elog (ERROR , "intset_num_entries returned " UINT64_FORMAT " , expected " UINT64_FORMAT , n , spec -> num_values );
241
241
242
242
/*
243
243
* Test random-access probes with intset_is_member()
@@ -279,11 +279,12 @@ test_pattern(const test_spec *spec)
279
279
b = intset_is_member (intset , x );
280
280
281
281
if (b != expected )
282
- elog (ERROR , "mismatch at %lu : %d vs %d" , x , b , expected );
282
+ elog (ERROR , "mismatch at " UINT64_FORMAT " : %d vs %d" , x , b , expected );
283
283
}
284
284
endtime = GetCurrentTimestamp ();
285
285
if (intset_test_stats )
286
- fprintf (stderr , "probed %lu values in %lu ms\n" , n , (endtime - starttime ) / 1000 );
286
+ fprintf (stderr , "probed " UINT64_FORMAT " values in %d ms\n" ,
287
+ n , (int ) (endtime - starttime ) / 1000 );
287
288
288
289
/*
289
290
* Test iterator
@@ -304,19 +305,20 @@ test_pattern(const test_spec *spec)
304
305
break ;
305
306
306
307
if (x != expected )
307
- elog (ERROR , "iterate returned wrong value; got %lu , expected %lu" , x , expected );
308
+ elog (ERROR , "iterate returned wrong value; got " UINT64_FORMAT " , expected " UINT64_FORMAT , x , expected );
308
309
n ++ ;
309
310
}
310
311
last_int += spec -> spacing ;
311
312
}
312
313
endtime = GetCurrentTimestamp ();
313
314
if (intset_test_stats )
314
- fprintf (stderr , "iterated %lu values in %lu ms\n" , n , (endtime - starttime ) / 1000 );
315
+ fprintf (stderr , "iterated " UINT64_FORMAT " values in %d ms\n" ,
316
+ n , (int ) (endtime - starttime ) / 1000 );
315
317
316
318
if (n < spec -> num_values )
317
- elog (ERROR , "iterator stopped short after %lu entries, expected %lu" , n , spec -> num_values );
319
+ elog (ERROR , "iterator stopped short after " UINT64_FORMAT " entries, expected " UINT64_FORMAT , n , spec -> num_values );
318
320
if (n > spec -> num_values )
319
- elog (ERROR , "iterator returned %lu entries, %lu was expected" , n , spec -> num_values );
321
+ elog (ERROR , "iterator returned " UINT64_FORMAT " entries, " UINT64_FORMAT " was expected" , n , spec -> num_values );
320
322
321
323
MemoryContextDelete (intset_ctx );
322
324
}
@@ -332,7 +334,7 @@ test_single_value(uint64 value)
332
334
uint64 num_entries ;
333
335
bool found ;
334
336
335
- elog (NOTICE , "testing intset with single value %lu" , value );
337
+ elog (NOTICE , "testing intset with single value " UINT64_FORMAT , value );
336
338
337
339
/* Create the set. */
338
340
intset = intset_create ();
@@ -341,7 +343,7 @@ test_single_value(uint64 value)
341
343
/* Test intset_get_num_entries() */
342
344
num_entries = intset_num_entries (intset );
343
345
if (num_entries != 1 )
344
- elog (ERROR , "intset_num_entries returned %lu , expected %lu " , num_entries , 1L );
346
+ elog (ERROR , "intset_num_entries returned " UINT64_FORMAT " , expected 1 " , num_entries );
345
347
346
348
/*
347
349
* Test intset_is_member() at various special values, like 0 and and
@@ -362,11 +364,11 @@ test_single_value(uint64 value)
362
364
intset_begin_iterate (intset );
363
365
found = intset_iterate_next (intset , & x );
364
366
if (!found || x != value )
365
- elog (ERROR , "intset_iterate_next failed for %lu" , x );
367
+ elog (ERROR , "intset_iterate_next failed for " UINT64_FORMAT , x );
366
368
367
369
found = intset_iterate_next (intset , & x );
368
370
if (found )
369
- elog (ERROR , "intset_iterate_next failed %lu" , x );
371
+ elog (ERROR , "intset_iterate_next failed " UINT64_FORMAT , x );
370
372
}
371
373
372
374
/*
@@ -391,7 +393,7 @@ test_single_value_and_filler(uint64 value, uint64 filler_min, uint64 filler_max)
391
393
uint64 num_entries = 0 ;
392
394
uint64 mem_usage ;
393
395
394
- elog (NOTICE , "testing intset with value %lu , and all between %lu and %lu" ,
396
+ elog (NOTICE , "testing intset with value " UINT64_FORMAT " , and all between " UINT64_FORMAT " and " UINT64_FORMAT ,
395
397
value , filler_min , filler_max );
396
398
397
399
intset = intset_create ();
@@ -418,7 +420,7 @@ test_single_value_and_filler(uint64 value, uint64 filler_min, uint64 filler_max)
418
420
/* Test intset_get_num_entries() */
419
421
num_entries = intset_num_entries (intset );
420
422
if (num_entries != n )
421
- elog (ERROR , "intset_num_entries returned %lu , expected %lu" , num_entries , n );
423
+ elog (ERROR , "intset_num_entries returned " UINT64_FORMAT " , expected " UINT64_FORMAT , num_entries , n );
422
424
423
425
/*
424
426
* Test intset_is_member() at various spots, at and around the values that
@@ -456,15 +458,15 @@ test_single_value_and_filler(uint64 value, uint64 filler_min, uint64 filler_max)
456
458
{
457
459
found = intset_iterate_next (intset , & x );
458
460
if (!found || x != iter_expected [i ])
459
- elog (ERROR , "intset_iterate_next failed for %lu" , x );
461
+ elog (ERROR , "intset_iterate_next failed for " UINT64_FORMAT , x );
460
462
}
461
463
found = intset_iterate_next (intset , & x );
462
464
if (found )
463
- elog (ERROR , "intset_iterate_next failed %lu" , x );
465
+ elog (ERROR , "intset_iterate_next failed " UINT64_FORMAT , x );
464
466
465
467
mem_usage = intset_memory_usage (intset );
466
468
if (mem_usage < 5000 || mem_usage > 500000000 )
467
- elog (ERROR , "intset_memory_usage() reported suspicous value: %lu" , mem_usage );
469
+ elog (ERROR , "intset_memory_usage() reported suspicious value: " UINT64_FORMAT , mem_usage );
468
470
}
469
471
470
472
/*
@@ -485,7 +487,7 @@ check_with_filler(IntegerSet *intset, uint64 x,
485
487
actual = intset_is_member (intset , x );
486
488
487
489
if (actual != expected )
488
- elog (ERROR , "intset_is_member failed for %lu" , x );
490
+ elog (ERROR , "intset_is_member failed for " UINT64_FORMAT , x );
489
491
}
490
492
491
493
/*
@@ -512,7 +514,7 @@ test_empty(void)
512
514
/* Test iterator */
513
515
intset_begin_iterate (intset );
514
516
if (intset_iterate_next (intset , & x ))
515
- elog (ERROR , "intset_iterate_next on empty set returned a value (%lu )" , x );
517
+ elog (ERROR , "intset_iterate_next on empty set returned a value (" UINT64_FORMAT " )" , x );
516
518
}
517
519
518
520
/*
@@ -594,16 +596,16 @@ test_huge_distances(void)
594
596
{
595
597
result = intset_is_member (intset , x - 1 );
596
598
if (result != false)
597
- elog (ERROR , "intset_is_member failed for %lu" , x - 1 );
599
+ elog (ERROR , "intset_is_member failed for " UINT64_FORMAT , x - 1 );
598
600
}
599
601
600
602
result = intset_is_member (intset , x );
601
603
if (result != true)
602
- elog (ERROR , "intset_is_member failed for %lu" , x );
604
+ elog (ERROR , "intset_is_member failed for " UINT64_FORMAT , x );
603
605
604
606
result = intset_is_member (intset , x + 1 );
605
607
if (result != false)
606
- elog (ERROR , "intset_is_member failed for %lu" , x + 1 );
608
+ elog (ERROR , "intset_is_member failed for " UINT64_FORMAT , x + 1 );
607
609
}
608
610
609
611
/*
@@ -614,9 +616,9 @@ test_huge_distances(void)
614
616
{
615
617
found = intset_iterate_next (intset , & x );
616
618
if (!found || x != values [i ])
617
- elog (ERROR , "intset_iterate_next failed for %lu" , x );
619
+ elog (ERROR , "intset_iterate_next failed for " UINT64_FORMAT , x );
618
620
}
619
621
found = intset_iterate_next (intset , & x );
620
622
if (found )
621
- elog (ERROR , "intset_iterate_next failed %lu" , x );
623
+ elog (ERROR , "intset_iterate_next failed " UINT64_FORMAT , x );
622
624
}
0 commit comments