From 3824751760495f6516e2526d85433ab93e1cd6e1 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Fri, 18 Sep 2020 12:34:13 +0200 Subject: Changed macro to c_forrange (..), iter param first. --- examples/complex.c | 2 +- stc/cdefs.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/complex.c b/examples/complex.c index 001637ef..7cde293c 100644 --- a/examples/complex.c +++ b/examples/complex.c @@ -33,5 +33,5 @@ int main() { printf("value (%d, %d) is: %f\n", y, x, *carray2f_at(&table, y, x)); } - c_del_(cmap_s, &myMap); // free up everything! + cmap_s_del(&myMap); // free up everything! } \ No newline at end of file diff --git a/stc/cdefs.h b/stc/cdefs.h index c10d3899..2d92c9ef 100644 --- a/stc/cdefs.h +++ b/stc/cdefs.h @@ -86,10 +86,10 @@ #define c_foreach_4(it, ctype, start, finish) \ for (ctype##_iter_t it = start, it##_end_ = finish; it.get != it##_end_.get; ctype##_next(&it)) -#define c_for_range(...) c_MACRO_OVERLOAD(c_for_range, __VA_ARGS__) -#define c_for_range_3(type, i, stop) for (type i=0, i##_end_=stop; i < i##_end_; ++i) -#define c_for_range_4(type, i, start, stop) for (type i=start, i##_end_=stop; i < i##_end_; ++i) -#define c_for_range_5(type, i, start, stop, step) \ +#define c_forrange(...) c_MACRO_OVERLOAD(c_forrange, __VA_ARGS__) +#define c_forrange_3(i, type, stop) for (type i=0, i##_end_=stop; i < i##_end_; ++i) +#define c_forrange_4(i, type, start, stop) for (type i=start, i##_end_=stop; i < i##_end_; ++i) +#define c_forrange_5(i, type, start, stop, step) \ for (type i=start, i##_inc_=step, i##_end_=stop - (i##_inc_ > 0); (i <= i##_end_) == (0 < i##_inc_); i += i##_inc_) #define c_push_items(self, ctype, ...) do { \ -- cgit v1.2.3