From c247a7628c16c2658562c187dbfb1805a1b0f705 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sun, 25 Sep 2022 20:09:10 +0200 Subject: Change crange_value from intmax_t to 'long long' - enables usage of "%lld" format. --- docs/ccommon_api.md | 2 +- include/stc/ccommon.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index 8938f0d2..3ff3c17e 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -256,7 +256,7 @@ int main() { Note that `c_flt_take()` is given as an optional argument, which makes the loop stop when it becomes false (for efficiency). Chaining it after `flt_prime()` instead will give same result, but the full input is processed. ### crange -**crange** is a number sequence generator type. The **crange_value** type is `intmax_t`. Below, *start*, *end*, *step* are of *crange_type*. +**crange** is a number sequence generator type. The **crange_value** type is `long long`. Below, *start*, *end*, *step* are type *crange_value*: ```c crange crange_init(void); // will generate 0, 1, 2, ... crange crange_from(start); // will generate start, start+1, ... diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index 49f735f7..02f41dd5 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -203,7 +203,7 @@ STC_INLINE char* c_strnstrn(const char *s, const char *needle, for (itype i=start, _inc=step, _end=(stop) - (_inc > 0) \ ; (_inc > 0) ^ (i > _end); i += _inc) -typedef intmax_t crange_value; +typedef long long crange_value; struct {crange_value val, end, step; } typedef crange; struct {crange_value *ref, end, step; } typedef crange_iter; #define crange_from(...) c_MACRO_OVERLOAD(crange_from, __VA_ARGS__) -- cgit v1.2.3