summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-28 17:08:43 +0200
committerTyge Løvset <[email protected]>2022-09-28 17:08:43 +0200
commit8291d15b6cb0705df1d40745548b8c765938fb36 (patch)
tree5d1245a2c8785b93c2980d13920a18a1f24e7742 /include
parente1a353c8a82315d9456c2f33e3e4416b5f444800 (diff)
downloadSTC-modified-8291d15b6cb0705df1d40745548b8c765938fb36.tar.gz
STC-modified-8291d15b6cb0705df1d40745548b8c765938fb36.zip
Added a convenience macro: c_RANGE(), to mainly be used with c_forfilter().
Diffstat (limited to 'include')
-rw-r--r--include/stc/ccommon.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h
index 7b7dc283..97d74d9e 100644
--- a/include/stc/ccommon.h
+++ b/include/stc/ccommon.h
@@ -219,10 +219,10 @@ STC_INLINE char* c_strnstrn(const char *s, const char *needle,
typedef long long crange_value;
struct {crange_value start, end, step, val; } typedef crange;
struct {crange_value *ref, end, step; } typedef crange_iter;
-#define crange_init() crange_make3(0, INTMAX_MAX, 1)
#define crange_make(...) c_MACRO_OVERLOAD(crange_make, __VA_ARGS__)
#define crange_make1(stop) crange_make3(0, stop, 1)
#define crange_make2(start, stop) crange_make3(start, stop, 1)
+#define c_RANGE(...) crange, *(crange[]){crange_make(__VA_ARGS__)}
STC_INLINE crange crange_make3(crange_value start, crange_value stop, crange_value step)
{ crange r = {start, stop - (step > 0), step}; return r; }
STC_INLINE crange_iter crange_begin(crange* self)