@@ -207,8 +207,8 @@ test_pattern(const test_spec *spec)
207207 endtime = GetCurrentTimestamp ();
208208
209209 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 );
212212
213213 /*
214214 * Print stats on the amount of memory used.
@@ -228,7 +228,7 @@ test_pattern(const test_spec *spec)
228228 * MemoryContextStats().
229229 */
230230 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" ,
232232 mem_usage , (double ) mem_usage / spec -> num_values );
233233
234234 MemoryContextStats (intset_ctx );
@@ -237,7 +237,7 @@ test_pattern(const test_spec *spec)
237237 /* Check that intset_get_num_entries works */
238238 n = intset_num_entries (intset );
239239 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 );
241241
242242 /*
243243 * Test random-access probes with intset_is_member()
@@ -279,11 +279,12 @@ test_pattern(const test_spec *spec)
279279 b = intset_is_member (intset , x );
280280
281281 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 );
283283 }
284284 endtime = GetCurrentTimestamp ();
285285 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 );
287288
288289 /*
289290 * Test iterator
@@ -304,19 +305,20 @@ test_pattern(const test_spec *spec)
304305 break ;
305306
306307 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 );
308309 n ++ ;
309310 }
310311 last_int += spec -> spacing ;
311312 }
312313 endtime = GetCurrentTimestamp ();
313314 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 );
315317
316318 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 );
318320 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 );
320322
321323 MemoryContextDelete (intset_ctx );
322324}
@@ -332,7 +334,7 @@ test_single_value(uint64 value)
332334 uint64 num_entries ;
333335 bool found ;
334336
335- elog (NOTICE , "testing intset with single value %lu" , value );
337+ elog (NOTICE , "testing intset with single value " UINT64_FORMAT , value );
336338
337339 /* Create the set. */
338340 intset = intset_create ();
@@ -341,7 +343,7 @@ test_single_value(uint64 value)
341343 /* Test intset_get_num_entries() */
342344 num_entries = intset_num_entries (intset );
343345 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 );
345347
346348 /*
347349 * Test intset_is_member() at various special values, like 0 and and
@@ -362,11 +364,11 @@ test_single_value(uint64 value)
362364 intset_begin_iterate (intset );
363365 found = intset_iterate_next (intset , & x );
364366 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 );
366368
367369 found = intset_iterate_next (intset , & x );
368370 if (found )
369- elog (ERROR , "intset_iterate_next failed %lu" , x );
371+ elog (ERROR , "intset_iterate_next failed " UINT64_FORMAT , x );
370372}
371373
372374/*
@@ -391,7 +393,7 @@ test_single_value_and_filler(uint64 value, uint64 filler_min, uint64 filler_max)
391393 uint64 num_entries = 0 ;
392394 uint64 mem_usage ;
393395
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 ,
395397 value , filler_min , filler_max );
396398
397399 intset = intset_create ();
@@ -418,7 +420,7 @@ test_single_value_and_filler(uint64 value, uint64 filler_min, uint64 filler_max)
418420 /* Test intset_get_num_entries() */
419421 num_entries = intset_num_entries (intset );
420422 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 );
422424
423425 /*
424426 * 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)
456458 {
457459 found = intset_iterate_next (intset , & x );
458460 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 );
460462 }
461463 found = intset_iterate_next (intset , & x );
462464 if (found )
463- elog (ERROR , "intset_iterate_next failed %lu" , x );
465+ elog (ERROR , "intset_iterate_next failed " UINT64_FORMAT , x );
464466
465467 mem_usage = intset_memory_usage (intset );
466468 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 );
468470}
469471
470472/*
@@ -485,7 +487,7 @@ check_with_filler(IntegerSet *intset, uint64 x,
485487 actual = intset_is_member (intset , x );
486488
487489 if (actual != expected )
488- elog (ERROR , "intset_is_member failed for %lu" , x );
490+ elog (ERROR , "intset_is_member failed for " UINT64_FORMAT , x );
489491}
490492
491493/*
@@ -512,7 +514,7 @@ test_empty(void)
512514 /* Test iterator */
513515 intset_begin_iterate (intset );
514516 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 );
516518}
517519
518520/*
@@ -594,16 +596,16 @@ test_huge_distances(void)
594596 {
595597 result = intset_is_member (intset , x - 1 );
596598 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 );
598600 }
599601
600602 result = intset_is_member (intset , x );
601603 if (result != true)
602- elog (ERROR , "intset_is_member failed for %lu" , x );
604+ elog (ERROR , "intset_is_member failed for " UINT64_FORMAT , x );
603605
604606 result = intset_is_member (intset , x + 1 );
605607 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 );
607609 }
608610
609611 /*
@@ -614,9 +616,9 @@ test_huge_distances(void)
614616 {
615617 found = intset_iterate_next (intset , & x );
616618 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 );
618620 }
619621 found = intset_iterate_next (intset , & x );
620622 if (found )
621- elog (ERROR , "intset_iterate_next failed %lu" , x );
623+ elog (ERROR , "intset_iterate_next failed " UINT64_FORMAT , x );
622624}
0 commit comments