summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-25 20:09:10 +0200
committerTyge Løvset <[email protected]>2022-09-25 20:09:10 +0200
commitc247a7628c16c2658562c187dbfb1805a1b0f705 (patch)
tree3475cac859653d2599e47c1d1257d1a4784f262f
parenta383150d78622d1177ba1da5f5060d08b520cdf5 (diff)
downloadSTC-modified-c247a7628c16c2658562c187dbfb1805a1b0f705.tar.gz
STC-modified-c247a7628c16c2658562c187dbfb1805a1b0f705.zip
Change crange_value from intmax_t to 'long long' - enables usage of "%lld" format.
-rw-r--r--docs/ccommon_api.md2
-rw-r--r--include/stc/ccommon.h2
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__)