From 90624d6d398ff1d0f79df3dd656c4ad0c9c498a9 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 9 Aug 2022 17:34:13 +0200 Subject: Experiment with other type of iterator. Does not compile. --- include/stc/forward.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/stc/forward.h') diff --git a/include/stc/forward.h b/include/stc/forward.h index 04566b98..1a85f1ed 100644 --- a/include/stc/forward.h +++ b/include/stc/forward.h @@ -57,7 +57,7 @@ typedef struct { const char* str; size_t size; } csview; typedef char csview_value; typedef union { const char *ref; - csview chr; + struct { csview chr; const char *_end; } u8; } csview_iter, cstr_iter; #define c_true(...) __VA_ARGS__ @@ -73,12 +73,12 @@ typedef union { #define _c_carr2_types(SELF, VAL) \ typedef VAL SELF##_value; \ - typedef struct { SELF##_value *ref; } SELF##_iter; \ + typedef struct { SELF##_value *ref, *_end; } SELF##_iter; \ typedef struct { SELF##_value **data; size_t xdim, ydim; } SELF #define _c_carr3_types(SELF, VAL) \ typedef VAL SELF##_value; \ - typedef struct { SELF##_value *ref; } SELF##_iter; \ + typedef struct { SELF##_value *ref, *_end; } SELF##_iter; \ typedef struct { SELF##_value ***data; size_t xdim, ydim, zdim; } SELF #define _c_cbox_types(SELF, VAL) \ @@ -89,7 +89,7 @@ typedef union { #define _c_cdeq_types(SELF, VAL) \ typedef VAL SELF##_value; \ - typedef struct {SELF##_value *ref; } SELF##_iter; \ + typedef struct {SELF##_value *ref, *_end; } SELF##_iter; \ typedef struct {SELF##_value *_base, *data;} SELF #define _c_clist_types(SELF, VAL) \ @@ -120,7 +120,7 @@ typedef union { } SELF##_result; \ \ typedef struct { \ - SELF##_value *ref; \ + SELF##_value *ref, *_end; \ uint8_t* _hx; \ } SELF##_iter; \ \ @@ -186,7 +186,7 @@ typedef union { #endif #define _c_cstack_types(SELF, VAL) \ typedef VAL SELF##_value; \ - typedef struct { SELF##_value *ref; } SELF##_iter; \ + typedef struct { SELF##_value *ref, *_end; } SELF##_iter; \ typedef struct SELF { \ SELF##_value* data; \ size_t size, capacity; \ @@ -209,7 +209,7 @@ typedef union { #define _c_cvec_types(SELF, VAL) \ typedef VAL SELF##_value; \ - typedef struct { SELF##_value *ref; } SELF##_iter; \ + typedef struct { SELF##_value *ref, *_end; } SELF##_iter; \ typedef struct { SELF##_value *data; } SELF #endif // STC_FORWARD_H_INCLUDED -- cgit v1.2.3