diff options
| author | Tyge Løvset <[email protected]> | 2022-10-21 09:31:17 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-10-21 09:31:17 +0200 |
| commit | 3eb08b0372dd669af535a368e8a8cdb8a9c793c5 (patch) | |
| tree | 05d70cd2fe623eddc94280767c88332d8773405f | |
| parent | 2cefae32252f3051f75f44f4718a62a1210bd3a7 (diff) | |
| download | STC-modified-3eb08b0372dd669af535a368e8a8cdb8a9c793c5.tar.gz STC-modified-3eb08b0372dd669af535a368e8a8cdb8a9c793c5.zip | |
Renamed size_t formatting macro c_zu to c_ZU (for replacing %zu on mingw64).
| -rw-r--r-- | benchmarks/misc/rust_cmap.c | 10 | ||||
| -rw-r--r-- | benchmarks/shootout_hashmaps.cpp | 12 | ||||
| -rw-r--r-- | docs/cbits_api.md | 6 | ||||
| -rw-r--r-- | docs/cstr_api.md | 2 | ||||
| -rw-r--r-- | examples/bits.c | 12 | ||||
| -rw-r--r-- | examples/bits2.c | 4 | ||||
| -rw-r--r-- | examples/books.c | 2 | ||||
| -rw-r--r-- | examples/box2.c | 12 | ||||
| -rw-r--r-- | examples/complex.c | 2 | ||||
| -rw-r--r-- | examples/csmap_erase.c | 4 | ||||
| -rw-r--r-- | examples/csmap_find.c | 2 | ||||
| -rw-r--r-- | examples/cstr_match.c | 4 | ||||
| -rw-r--r-- | examples/demos.c | 8 | ||||
| -rw-r--r-- | examples/new_queue.c | 4 | ||||
| -rw-r--r-- | examples/prime.c | 4 | ||||
| -rw-r--r-- | examples/priority.c | 2 | ||||
| -rw-r--r-- | examples/queue.c | 2 | ||||
| -rw-r--r-- | examples/random.c | 6 | ||||
| -rw-r--r-- | examples/sso_map.c | 2 | ||||
| -rw-r--r-- | include/stc/ccommon.h | 4 |
20 files changed, 52 insertions, 52 deletions
diff --git a/benchmarks/misc/rust_cmap.c b/benchmarks/misc/rust_cmap.c index 02d62319..0750b182 100644 --- a/benchmarks/misc/rust_cmap.c +++ b/benchmarks/misc/rust_cmap.c @@ -29,7 +29,7 @@ int main() ms = CLOCKS_PER_SEC/1000; cmap_u64_max_load_factor(&m, 0.8); cmap_u64_reserve(&m, n); - printf("STC cmap n = %" c_zu ", mask = 0x%" PRIxMAX "\n", n, mask); + printf("STC cmap n = %" c_ZU ", mask = 0x%" PRIxMAX "\n", n, mask); uint64_t rng[3] = {1872361123, 123879177, 87739234}, sum; clock_t now = clock(); @@ -37,17 +37,17 @@ int main() uint64_t key = romu_trio(rng) & mask; cmap_u64_insert(&m, key, 0).ref->second += 1; } - printf("insert : %" c_zu "ms \tsize : %" c_zu "\n", (clock() - now)/ms, cmap_u64_size(&m)); + printf("insert : %" c_ZU "ms \tsize : %" c_ZU "\n", (clock() - now)/ms, cmap_u64_size(&m)); now = clock(); sum = 0; c_forrange (key, mask + 1) { sum += cmap_u64_contains(&m, key); } - printf("lookup : %" c_zu "ms \tsum : %" c_zu "\n", (clock() - now)/ms, sum); + printf("lookup : %" c_ZU "ms \tsum : %" c_ZU "\n", (clock() - now)/ms, sum); now = clock(); sum = 0; c_foreach (i, cmap_u64, m) { sum += i.ref->second; } - printf("iterate : %" c_zu "ms \tsum : %" c_zu "\n", (clock() - now)/ms, sum); + printf("iterate : %" c_ZU "ms \tsum : %" c_ZU "\n", (clock() - now)/ms, sum); uint64_t rng2[3] = {1872361123, 123879177, 87739234}; now = clock(); @@ -55,7 +55,7 @@ int main() uint64_t key = romu_trio(rng2) & mask; cmap_u64_erase(&m, key); } - printf("remove : %" c_zu "ms \tsize : %" c_zu "\n", (clock() - now)/ms, cmap_u64_size(&m)); + printf("remove : %" c_ZU "ms \tsize : %" c_ZU "\n", (clock() - now)/ms, cmap_u64_size(&m)); printf("press a key:\n"); getchar(); } } diff --git a/benchmarks/shootout_hashmaps.cpp b/benchmarks/shootout_hashmaps.cpp index cc1778d1..39f7cd43 100644 --- a/benchmarks/shootout_hashmaps.cpp +++ b/benchmarks/shootout_hashmaps.cpp @@ -184,7 +184,7 @@ KHASH_MAP_INIT_INT64(ii, IValue) sum += ++ M##_PUT(X, RAND(keybits), i); \ } \ difference = clock() - before; \ - printf(#M ": time: %5.03f, size: %" c_zu ", buckets: %8" c_zu ", sum: %" c_zu "\n", \ + printf(#M ": time: %5.03f, size: %" c_ZU ", buckets: %8" c_ZU ", sum: %" c_ZU "\n", \ (float) difference / CLOCKS_PER_SEC, (size_t) M##_SIZE(X), (size_t) M##_BUCKETS(X), sum); \ M##_DTOR(X); \ } @@ -199,7 +199,7 @@ KHASH_MAP_INIT_INT64(ii, IValue) for (size_t i = 0; i < n; ++i) \ erased += M##_ERASE(X, i); \ difference = clock() - before; \ - printf(#M ": time: %5.03f, size: %" c_zu ", buckets: %8" c_zu ", erased %" c_zu "\n", \ + printf(#M ": time: %5.03f, size: %" c_ZU ", buckets: %8" c_ZU ", erased %" c_ZU "\n", \ (float) difference / CLOCKS_PER_SEC, (size_t) M##_SIZE(X), (size_t) M##_BUCKETS(X), erased); \ M##_DTOR(X); \ } @@ -217,7 +217,7 @@ KHASH_MAP_INIT_INT64(ii, IValue) for (size_t i = 0; i < n; ++i) \ erased += M##_ERASE(X, RAND(keybits)); \ difference = clock() - before; \ - printf(#M ": time: %5.03f, size: %" c_zu ", buckets: %8" c_zu ", erased %" c_zu "\n", \ + printf(#M ": time: %5.03f, size: %" c_ZU ", buckets: %8" c_ZU ", erased %" c_ZU "\n", \ (float) difference / CLOCKS_PER_SEC, (size_t) M##_SIZE(X), (size_t) M##_BUCKETS(X), erased); \ M##_DTOR(X); \ } @@ -235,7 +235,7 @@ KHASH_MAP_INIT_INT64(ii, IValue) for (size_t k=0; k < rep; k++) M##_FOR (X, it) \ sum += M##_ITEM(X, it); \ difference = clock() - before; \ - printf(#M ": time: %5.03f, size: %" c_zu ", buckets: %8" c_zu ", repeats: %" c_zu ", sum: %" c_zu "\n", \ + printf(#M ": time: %5.03f, size: %" c_ZU ", buckets: %8" c_ZU ", repeats: %" c_ZU ", sum: %" c_ZU "\n", \ (float) difference / CLOCKS_PER_SEC, (size_t) M##_SIZE(X), (size_t) M##_BUCKETS(X), rep, sum); \ M##_DTOR(X); \ } @@ -257,7 +257,7 @@ KHASH_MAP_INIT_INT64(ii, IValue) for (size_t i = 0; i < x; ++i) \ found += M##_FIND(X, RAND(keybits)); \ difference = clock() - before; \ - printf(#M ": time: %5.03f, size: %" c_zu ", buckets: %8" c_zu ", lookups: %" c_zu ", found: %" c_zu "\n", \ + printf(#M ": time: %5.03f, size: %" c_ZU ", buckets: %8" c_ZU ", lookups: %" c_ZU ", found: %" c_ZU "\n", \ (float) difference / CLOCKS_PER_SEC, (size_t) M##_SIZE(X), (size_t) M##_BUCKETS(X), x*2, found); \ M##_DTOR(X); \ } @@ -299,7 +299,7 @@ int main(int argc, char* argv[]) "UMAP = std::unordered_map\n\n"); printf("Usage %s [n-million=%d key-bits=%d]\n", argv[0], DEFAULT_N_MILL, DEFAULT_KEYBITS); - printf("N-base = %d. Random keys are in range [0, 2^%d). Seed = %" c_zu ":\n", n_mill, keybits, seed); + printf("N-base = %d. Random keys are in range [0, 2^%d). Seed = %" c_ZU ":\n", n_mill, keybits, seed); printf("\nT1: Insert/update random keys:\n"); RUN_TEST(1) diff --git a/docs/cbits_api.md b/docs/cbits_api.md index 51c89f21..b21611df 100644 --- a/docs/cbits_api.md +++ b/docs/cbits_api.md @@ -91,18 +91,18 @@ cbits sieveOfEratosthenes(size_t n) int main(void) { size_t n = 100000000; - printf("computing prime numbers up to %" c_zu "\n", n); + printf("computing prime numbers up to %" c_ZU "\n", n); clock_t t1 = clock(); cbits primes = sieveOfEratosthenes(n + 1); size_t nprimes = cbits_count(&primes); clock_t t2 = clock(); - printf("number of primes: %" c_zu ", time: %f\n", nprimes, (float)(t2 - t1)/CLOCKS_PER_SEC); + printf("number of primes: %" c_ZU ", time: %f\n", nprimes, (float)(t2 - t1)/CLOCKS_PER_SEC); printf(" 2"); for (size_t i = 3; i < 1000; i += 2) - if (cbits_test(&primes, i>>1)) printf(" %" c_zu, i); + if (cbits_test(&primes, i>>1)) printf(" %" c_ZU, i); puts(""); cbits_drop(&primes); diff --git a/docs/cstr_api.md b/docs/cstr_api.md index ceeeac2a..a3211a52 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -161,7 +161,7 @@ char* c_strnstrn(const char* str, const char* search, size_t slen, size_t int main() { cstr s0 = cstr_new("Initialization without using strlen()."); - printf("%s\nLength: %" c_zu "\n\n", cstr_str(&s0), cstr_size(&s0)); + printf("%s\nLength: %" c_ZU "\n\n", cstr_str(&s0), cstr_size(&s0)); cstr s1 = cstr_new("one-nine-three-seven-five."); printf("%s\n", cstr_str(&s1)); diff --git a/examples/bits.c b/examples/bits.c index 48c77ed0..ca4de6af 100644 --- a/examples/bits.c +++ b/examples/bits.c @@ -4,11 +4,11 @@ int main() { c_with (cbits set = cbits_with_size(23, true), cbits_drop(&set)) { - printf("count %" c_zu ", %" c_zu "\n", cbits_count(&set), cbits_size(&set)); + printf("count %" c_ZU ", %" c_ZU "\n", cbits_count(&set), cbits_size(&set)); cbits s1 = cbits_from("1110100110111"); char buf[256]; cbits_to_str(&s1, buf, 0, -1); - printf("buf: %s: %" c_zu "\n", buf, cbits_count(&s1)); + printf("buf: %s: %" c_ZU "\n", buf, cbits_count(&s1)); cbits_drop(&s1); cbits_reset(&set, 9); @@ -16,7 +16,7 @@ int main() c_autobuf (str, char, cbits_size(&set) + 1) printf(" str: %s\n", cbits_to_str(&set, str, 0, -1)); - printf("%4" c_zu ": ", cbits_size(&set)); + printf("%4" c_ZU ": ", cbits_size(&set)); c_forrange (i, cbits_size(&set)) printf("%d", cbits_test(&set, i)); puts(""); @@ -26,12 +26,12 @@ int main() cbits_resize(&set, 93, false); cbits_resize(&set, 102, true); cbits_set_value(&set, 99, false); - printf("%4" c_zu ": ", cbits_size(&set)); + printf("%4" c_ZU ": ", cbits_size(&set)); c_forrange (i, cbits_size(&set)) printf("%d", cbits_test(&set, i)); puts("\nIterate:"); - printf("%4" c_zu ": ", cbits_size(&set)); + printf("%4" c_ZU ": ", cbits_size(&set)); c_forrange (i, cbits_size(&set)) printf("%d", cbits_test(&set, i)); puts(""); @@ -53,7 +53,7 @@ int main() puts(""); cbits_set_all(&set, false); - printf("%4" c_zu ": ", cbits_size(&set)); + printf("%4" c_ZU ": ", cbits_size(&set)); c_forrange (i, cbits_size(&set)) printf("%d", cbits_test(&set, i)); puts(""); diff --git a/examples/bits2.c b/examples/bits2.c index e42ca4e5..95eb8b83 100644 --- a/examples/bits2.c +++ b/examples/bits2.c @@ -9,10 +9,10 @@ int main() { Bits s1 = Bits_from("1110100110111"); - printf("size %" c_zu "\n", Bits_size(&s1)); + printf("size %" c_ZU "\n", Bits_size(&s1)); char buf[256]; Bits_to_str(&s1, buf, 0, -1); - printf("buf: %s: count=%" c_zu "\n", buf, Bits_count(&s1)); + printf("buf: %s: count=%" c_ZU "\n", buf, Bits_count(&s1)); Bits_reset(&s1, 8); c_autobuf (str, char, Bits_size(&s1) + 1) diff --git a/examples/books.c b/examples/books.c index bdcc5889..bfced28f 100644 --- a/examples/books.c +++ b/examples/books.c @@ -32,7 +32,7 @@ int main() // When collections store owned values (String), they can still be // queried using references (&str). if (cmap_str_contains(&book_reviews, "Les Misérables")) { - printf("We've got %" c_zu " reviews, but Les Misérables ain't one.", + printf("We've got %" c_ZU " reviews, but Les Misérables ain't one.", cmap_str_size(&book_reviews)); } diff --git a/examples/box2.c b/examples/box2.c index 13dc8c26..2413e3fe 100644 --- a/examples/box2.c +++ b/examples/box2.c @@ -64,22 +64,22 @@ int main(void) { // Double indirection box_in_a_box = cbox_BoxPoint_from(boxed_origin()); - printf("Point occupies %" c_zu " bytes on the stack\n", + printf("Point occupies %" c_ZU " bytes on the stack\n", sizeof(point)); - printf("Rectangle occupies %" c_zu " bytes on the stack\n", + printf("Rectangle occupies %" c_ZU " bytes on the stack\n", sizeof(rectangle)); // box size == pointer size - printf("Boxed point occupies %" c_zu " bytes on the stack\n", + printf("Boxed point occupies %" c_ZU " bytes on the stack\n", sizeof(boxed_point)); - printf("Boxed rectangle occupies %" c_zu " bytes on the stack\n", + printf("Boxed rectangle occupies %" c_ZU " bytes on the stack\n", sizeof(boxed_rectangle)); - printf("Boxed box occupies %" c_zu " bytes on the stack\n", + printf("Boxed box occupies %" c_ZU " bytes on the stack\n", sizeof(box_in_a_box)); // Copy the data contained in `boxed_point` into `unboxed_point` Point unboxed_point = *boxed_point.get; - printf("Unboxed point occupies %" c_zu " bytes on the stack\n", + printf("Unboxed point occupies %" c_ZU " bytes on the stack\n", sizeof(unboxed_point)); } } diff --git a/examples/complex.c b/examples/complex.c index 71ee6b0b..c91f95d5 100644 --- a/examples/complex.c +++ b/examples/complex.c @@ -37,7 +37,7 @@ int main() // Put in some data in the structures stack.data[3] = 3.1415927f; - printf("stack size: %" c_zu "\n", FloatStack_size(&stack)); + printf("stack size: %" c_ZU "\n", FloatStack_size(&stack)); StackList list = StackList_init(); StackList_push_back(&list, stack); diff --git a/examples/csmap_erase.c b/examples/csmap_erase.c index d05c32fe..97f45779 100644 --- a/examples/csmap_erase.c +++ b/examples/csmap_erase.c @@ -12,7 +12,7 @@ void printmap(mymap m) { c_foreach (elem, mymap, m) printf(" [%d, %s]", elem.ref->first, cstr_str(&elem.ref->second)); - printf("\nsize() == %" c_zu "\n\n", mymap_size(&m)); + printf("\nsize() == %" c_ZU "\n\n", mymap_size(&m)); } int main() @@ -77,7 +77,7 @@ int main() // The 3rd member function removes elements with a given Key size_t count = mymap_erase(&m3, 2); // The 3rd member function also returns the number of elements removed - printf("The number of elements removed from m3 is: %" c_zu "\n", count); + printf("The number of elements removed from m3 is: %" c_ZU "\n", count); puts("After the element with a key of 2 is deleted, the map m3 is:"); printmap(m3); } diff --git a/examples/csmap_find.c b/examples/csmap_find.c index 98da589e..3c507476 100644 --- a/examples/csmap_find.c +++ b/examples/csmap_find.c @@ -18,7 +18,7 @@ void print_elem(csmap_istr_raw p) { #define using_print_collection(CX) \ void print_collection_##CX(const CX* t) { \ - printf("%" c_zu " elements: ", CX##_size(t)); \ + printf("%" c_ZU " elements: ", CX##_size(t)); \ \ c_foreach (p, CX, *t) { \ print_elem(CX##_value_toraw(p.ref)); \ diff --git a/examples/cstr_match.c b/examples/cstr_match.c index a991278c..9324ce41 100644 --- a/examples/cstr_match.c +++ b/examples/cstr_match.c @@ -6,7 +6,7 @@ int main() { c_with (cstr ss = cstr_new("The quick brown fox jumps over the lazy dog.JPG"), cstr_drop(&ss)) { size_t pos = cstr_find_at(&ss, 0, "brown"); - printf("%" c_zu " [%s]\n", pos, pos == cstr_npos ? "<NULL>" : cstr_str(&ss) + pos); + printf("%" c_ZU " [%s]\n", pos, pos == cstr_npos ? "<NULL>" : cstr_str(&ss) + pos); printf("equals: %d\n", cstr_equals(&ss, "The quick brown fox jumps over the lazy dog.JPG")); printf("contains: %d\n", cstr_contains(&ss, "umps ove")); printf("starts_with: %d\n", cstr_starts_with(&ss, "The quick brown")); @@ -16,7 +16,7 @@ int main() cstr s1 = cstr_new("hell😀 w😀rl🐨"); csview ch1 = cstr_u8_chr(&s1, 7); csview ch2 = cstr_u8_chr(&s1, 10); - printf("%s\nsize: %" c_zu ", %" c_zu "\n", cstr_str(&s1), cstr_u8_size(&s1), cstr_size(&s1)); + printf("%s\nsize: %" c_ZU ", %" c_ZU "\n", cstr_str(&s1), cstr_u8_size(&s1), cstr_size(&s1)); printf("ch1: %.*s\n", c_ARGsv(ch1)); printf("ch2: %.*s\n", c_ARGsv(ch2)); } diff --git a/examples/demos.c b/examples/demos.c index 457e5f4d..2795b478 100644 --- a/examples/demos.c +++ b/examples/demos.c @@ -48,7 +48,7 @@ void vectordemo1() cvec_ix_erase_n(&bignums, 0, 1); // erase the first for (size_t i = 0; i < cvec_ix_size(&bignums); ++i) { - printf("%" c_zu ": %" PRIu64 "\n", i, bignums.data[i]); + printf("%" c_ZU ": %" PRIu64 "\n", i, bignums.data[i]); } } } @@ -175,11 +175,11 @@ void mapdemo3() cmap_str_iter it = cmap_str_find(&table, "Make"); c_foreach (i, cmap_str, table) printf("entry: %s: %s\n", cstr_str(&i.ref->first), cstr_str(&i.ref->second)); - printf("size %" c_zu ": remove: Make: %s\n", cmap_str_size(&table), cstr_str(&it.ref->second)); + printf("size %" c_ZU ": remove: Make: %s\n", cmap_str_size(&table), cstr_str(&it.ref->second)); //cmap_str_erase(&table, "Make"); cmap_str_erase_at(&table, it); - printf("size %" c_zu "\n", cmap_str_size(&table)); + printf("size %" c_ZU "\n", cmap_str_size(&table)); c_foreach (i, cmap_str, table) printf("entry: %s: %s\n", cstr_str(&i.ref->first), cstr_str(&i.ref->second)); cmap_str_drop(&table); // frees key and value cstrs, and hash table. @@ -199,7 +199,7 @@ void arraydemo1() float **arr2 = arr3.data[5]; float *arr1 = arr3.data[5][4]; - printf("arr3: %" c_zu ": (%" c_zu ", %" c_zu ", %" c_zu ") = %" c_zu "\n", sizeof(arr3), + printf("arr3: %" c_ZU ": (%" c_ZU ", %" c_ZU ", %" c_ZU ") = %" c_ZU "\n", sizeof(arr3), arr3.xdim, arr3.ydim, arr3.zdim, carr3_f_size(&arr3)); printf("%g\n", arr1[3]); // = 10.2 diff --git a/examples/new_queue.c b/examples/new_queue.c index c1e4e7b0..46ae836e 100644 --- a/examples/new_queue.c +++ b/examples/new_queue.c @@ -32,7 +32,7 @@ int main() { IQ_push(&Q, stc64_uniform(&rng, &dist)); // Push or pop on the queue 50 million times - printf("befor: size %" c_zu ", capacity %" c_zu "\n", IQ_size(&Q), IQ_capacity(&Q)); + printf("befor: size %" c_ZU ", capacity %" c_ZU "\n", IQ_size(&Q), IQ_capacity(&Q)); c_forrange (n) { int r = stc64_uniform(&rng, &dist); if (r & 3) @@ -40,6 +40,6 @@ int main() { else IQ_pop(&Q); } - printf("after: size %" c_zu ", capacity %" c_zu "\n", IQ_size(&Q), IQ_capacity(&Q)); + printf("after: size %" c_ZU ", capacity %" c_ZU "\n", IQ_size(&Q), IQ_capacity(&Q)); } } diff --git a/examples/prime.c b/examples/prime.c index 01528d80..8f883f14 100644 --- a/examples/prime.c +++ b/examples/prime.c @@ -25,7 +25,7 @@ cbits sieveOfEratosthenes(size_t n) int main(void) { size_t n = 1000000000; - printf("computing prime numbers up to %" c_zu "\n", n); + printf("computing prime numbers up to %" c_ZU "\n", n); clock_t t1 = clock(); c_with (cbits primes = sieveOfEratosthenes(n + 1), cbits_drop(&primes)) { @@ -33,7 +33,7 @@ int main(void) size_t np = cbits_count(&primes); clock_t t2 = clock(); - printf("number of primes: %" c_zu ", time: %f\n", np, (t2 - t1) / (float)CLOCKS_PER_SEC); + printf("number of primes: %" c_ZU ", time: %f\n", np, (t2 - t1) / (float)CLOCKS_PER_SEC); puts("Show all the primes in the range [2, 1000):"); printf("2"); c_forrange (i, 3, 1000, 2) diff --git a/examples/priority.c b/examples/priority.c index 82f95d09..6af297ac 100644 --- a/examples/priority.c +++ b/examples/priority.c @@ -15,7 +15,7 @@ int main() { c_auto (cpque_i, heap) { // Push ten million random numbers to priority queue - printf("Push %" c_zu " numbers\n", N); + printf("Push %" c_ZU " numbers\n", N); c_forrange (N) cpque_i_push(&heap, stc64_uniform(&rng, &dist)); diff --git a/examples/queue.c b/examples/queue.c index cdf4cdb3..f39c4b8b 100644 --- a/examples/queue.c +++ b/examples/queue.c @@ -26,6 +26,6 @@ int main() { else --n, cqueue_i_pop(&queue); } - printf("%d, %" c_zu "\n", n, cqueue_i_size(&queue)); + printf("%d, %" c_ZU "\n", n, cqueue_i_size(&queue)); } } diff --git a/examples/random.c b/examples/random.c index 6ebda57e..fe64290d 100644 --- a/examples/random.c +++ b/examples/random.c @@ -18,7 +18,7 @@ int main() sum += (uint32_t)stc64_rand(&rng); } diff = clock() - before; - printf("full range\t\t: %f secs, %" c_zu ", avg: %f\n", + printf("full range\t\t: %f secs, %" c_ZU ", avg: %f\n", (float)diff / CLOCKS_PER_SEC, N, (double)sum / N); stc64_uniform_t dist1 = stc64_uniform_new(0, range); @@ -29,7 +29,7 @@ int main() sum += stc64_uniform(&rng, &dist1); // unbiased } diff = clock() - before; - printf("unbiased 0-%" PRIu64 "\t: %f secs, %" c_zu ", avg: %f\n", + printf("unbiased 0-%" PRIu64 "\t: %f secs, %" c_ZU ", avg: %f\n", range, (float)diff/CLOCKS_PER_SEC, N, (double)sum / N); sum = 0; @@ -39,7 +39,7 @@ int main() sum += stc64_rand(&rng) % (range + 1); // biased } diff = clock() - before; - printf("biased 0-%" PRIu64 " \t: %f secs, %" c_zu ", avg: %f\n", + printf("biased 0-%" PRIu64 " \t: %f secs, %" c_ZU ", avg: %f\n", range, (float)diff / CLOCKS_PER_SEC, N, (double)sum / N); } diff --git a/examples/sso_map.c b/examples/sso_map.c index a7ee5bb5..cc5e16a1 100644 --- a/examples/sso_map.c +++ b/examples/sso_map.c @@ -10,7 +10,7 @@ int main() cmap_str_emplace(&m, "Test long ", "This is a longer string."); c_forpair (k, v, cmap_str, m) - printf("%s: '%s' Len=%" c_zu ", Is long: %s\n", + printf("%s: '%s' Len=%" c_ZU ", Is long: %s\n", cstr_str(_.k), cstr_str(_.v), cstr_size(_.v), cstr_is_long(_.v)?"true":"false"); } diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index 5ecb42f8..fb4129b3 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -31,9 +31,9 @@ #include <assert.h> #if SIZE_MAX == UINT32_MAX -# define c_zu PRIu32 +# define c_ZU PRIu32 #elif SIZE_MAX == UINT64_MAX -# define c_zu PRIu64 +# define c_ZU PRIu64 #endif #if defined(_MSC_VER) |
