summaryrefslogtreecommitdiffhomepage
path: root/include/stc
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2022-08-11 08:31:53 +0200
committerTyge Lovset <[email protected]>2022-08-11 08:31:53 +0200
commit65199590def8459198f9460c5d975a1df22d00a8 (patch)
tree640777149b2fd23ed4dd0ee2faa1924d7011d6f4 /include/stc
parent8b63c557e383736b617594d6c0f38956f770dc3b (diff)
downloadSTC-modified-65199590def8459198f9460c5d975a1df22d00a8.tar.gz
STC-modified-65199590def8459198f9460c5d975a1df22d00a8.zip
Renamed all iter members ._end to .end, to make them "public".
Diffstat (limited to 'include/stc')
-rw-r--r--include/stc/carr2.h2
-rw-r--r--include/stc/carr3.h2
-rw-r--r--include/stc/cdeq.h14
-rw-r--r--include/stc/cmap.h4
-rw-r--r--include/stc/cstack.h4
-rw-r--r--include/stc/cstr.h2
-rw-r--r--include/stc/csview.h2
-rw-r--r--include/stc/cvec.h18
-rw-r--r--include/stc/forward.h16
9 files changed, 32 insertions, 32 deletions
diff --git a/include/stc/carr2.h b/include/stc/carr2.h
index 1762b8ad..f55cdd17 100644
--- a/include/stc/carr2.h
+++ b/include/stc/carr2.h
@@ -98,7 +98,7 @@ STC_INLINE _cx_iter _cx_memb(_end)(const _cx_self* self)
{ return c_make(_cx_iter){NULL, *self->data + self->xdim*self->ydim}; }
STC_INLINE void _cx_memb(_next)(_cx_iter* it)
- { if (++it->ref == it->_end) it->ref = NULL; }
+ { if (++it->ref == it->end) it->ref = NULL; }
/* -------------------------- IMPLEMENTATION ------------------------- */
#if defined(i_implement)
diff --git a/include/stc/carr3.h b/include/stc/carr3.h
index 4de21208..fdc29b6f 100644
--- a/include/stc/carr3.h
+++ b/include/stc/carr3.h
@@ -101,7 +101,7 @@ STC_INLINE _cx_iter _cx_memb(_end)(const _cx_self* self)
{ return c_make(_cx_iter){NULL, **self->data + _cx_memb(_size)(self)}; }
STC_INLINE void _cx_memb(_next)(_cx_iter* it)
- { if (++it->ref == it->_end) it->ref = NULL; }
+ { if (++it->ref == it->end) it->ref = NULL; }
/* -------------------------- IMPLEMENTATION ------------------------- */
#if defined(i_implement)
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h
index 179959fd..d3c7fede 100644
--- a/include/stc/cdeq.h
+++ b/include/stc/cdeq.h
@@ -120,7 +120,7 @@ _cx_memb(_insert_n)(_cx_self* self, const size_t idx, const _cx_value arr[], con
}
STC_INLINE _cx_iter
_cx_memb(_insert_at)(_cx_self* self, _cx_iter it, i_key value) {
- return _cx_memb(_insert_range_p)(self, (it.ref ? it.ref : it._end), &value, &value + 1);
+ return _cx_memb(_insert_range_p)(self, (it.ref ? it.ref : it.end), &value, &value + 1);
}
STC_INLINE _cx_iter
@@ -133,7 +133,7 @@ _cx_memb(_erase_at)(_cx_self* self, _cx_iter it) {
}
STC_INLINE _cx_iter
_cx_memb(_erase_range)(_cx_self* self, _cx_iter i1, _cx_iter i2) {
- return _cx_memb(_erase_range_p)(self, i1.ref, (i2.ref ? i2.ref : i2._end));
+ return _cx_memb(_erase_range_p)(self, i1.ref, (i2.ref ? i2.ref : i2.end));
}
@@ -146,10 +146,10 @@ STC_INLINE _cx_iter _cx_memb(_end)(const _cx_self* self)
{ return c_make(_cx_iter){NULL, self->data + cdeq_rep_(self)->size}; }
STC_INLINE void _cx_memb(_next)(_cx_iter* it)
- { if (++it->ref == it->_end) it->ref = NULL; }
+ { if (++it->ref == it->end) it->ref = NULL; }
STC_INLINE _cx_iter _cx_memb(_advance)(_cx_iter it, size_t n)
- { if ((it.ref += n) >= it._end) it.ref = NULL; return it; }
+ { if ((it.ref += n) >= it.end) it.ref = NULL; return it; }
#if !defined _i_no_emplace
STC_INLINE _cx_value*
@@ -167,7 +167,7 @@ _cx_memb(_emplace_n)(_cx_self* self, const size_t idx, const _cx_raw arr[], cons
}
STC_INLINE _cx_iter
_cx_memb(_emplace_at)(_cx_self* self, _cx_iter it, _cx_raw raw) {
- return _cx_memb(_emplace_range_p)(self, (it.ref ? it.ref : it._end), &raw, &raw + 1);
+ return _cx_memb(_emplace_range_p)(self, (it.ref ? it.ref : it.end), &raw, &raw + 1);
}
#endif // !_i_no_emplace
@@ -189,7 +189,7 @@ _cx_memb(_get_mut)(_cx_self* self, _cx_raw raw)
STC_INLINE void
_cx_memb(_sort_range)(_cx_iter i1, _cx_iter i2, int(*cmp)(const _cx_value*, const _cx_value*)) {
- qsort(i1.ref, (i2.ref ? i2.ref : i2._end) - i1.ref, sizeof *i1.ref,
+ qsort(i1.ref, (i2.ref ? i2.ref : i2.end) - i1.ref, sizeof *i1.ref,
(int(*)(const void*, const void*)) cmp);
}
@@ -416,7 +416,7 @@ _cx_memb(_clone_range_p)(_cx_self* self, _cx_value* pos,
STC_DEF _cx_iter
_cx_memb(_find_in)(_cx_iter i1, _cx_iter i2, _cx_raw raw) {
- const _cx_value* p2 = i2.ref ? i2.ref : i2._end;
+ const _cx_value* p2 = i2.ref ? i2.ref : i2.end;
for (; i1.ref != p2; ++i1.ref) {
const _cx_raw r = i_keyto(i1.ref);
if (i_eq((&raw), (&r)))
diff --git a/include/stc/cmap.h b/include/stc/cmap.h
index 0d1c13d9..971d00a8 100644
--- a/include/stc/cmap.h
+++ b/include/stc/cmap.h
@@ -196,7 +196,7 @@ _cx_memb(_end)(const _cx_self* self)
STC_INLINE void
_cx_memb(_next)(_cx_iter* it) {
while ((++it->ref, *++it->_hx == 0)) ;
- if (it->ref == it->_end) it->ref = NULL;
+ if (it->ref == it->end) it->ref = NULL;
}
STC_INLINE _cx_iter
@@ -231,7 +231,7 @@ _cx_memb(_begin)(const _cx_self* self) {
if (it._hx)
while (*it._hx == 0)
++it.ref, ++it._hx;
- if (it.ref == it._end) it.ref = NULL;
+ if (it.ref == it.end) it.ref = NULL;
return it;
}
diff --git a/include/stc/cstack.h b/include/stc/cstack.h
index a524b71c..e1839d37 100644
--- a/include/stc/cstack.h
+++ b/include/stc/cstack.h
@@ -178,9 +178,9 @@ STC_INLINE _cx_iter _cx_memb(_end)(const _cx_self* self)
{ return c_make(_cx_iter){NULL, (_cx_value*)self->data + self->size}; }
STC_INLINE void _cx_memb(_next)(_cx_iter* it)
- { if (++it->ref == it->_end) it->ref = NULL; }
+ { if (++it->ref == it->end) it->ref = NULL; }
STC_INLINE _cx_iter _cx_memb(_advance)(_cx_iter it, size_t n)
- { if ((it.ref += n) >= it._end) it.ref = NULL ; return it; }
+ { if ((it.ref += n) >= it.end) it.ref = NULL ; return it; }
#include "template.h"
diff --git a/include/stc/cstr.h b/include/stc/cstr.h
index 509811eb..7af54c58 100644
--- a/include/stc/cstr.h
+++ b/include/stc/cstr.h
@@ -234,7 +234,7 @@ STC_INLINE cstr_iter cstr_end(const cstr* self) {
STC_INLINE void cstr_next(cstr_iter* it) {
it->ref += it->u8.chr.size;
it->u8.chr.size = utf8_chr_size(it->ref);
- if (it->ref == it->u8._end) it->ref = NULL;
+ if (it->ref == it->u8.end) it->ref = NULL;
}
diff --git a/include/stc/csview.h b/include/stc/csview.h
index c48c6ae6..5db23a01 100644
--- a/include/stc/csview.h
+++ b/include/stc/csview.h
@@ -81,7 +81,7 @@ STC_INLINE csview_iter csview_end(const csview* self)
STC_INLINE void csview_next(csview_iter* it) {
it->ref += it->u8.chr.size;
it->u8.chr.size = utf8_chr_size(it->ref);
- if (it->ref == it->u8._end) it->ref = NULL;
+ if (it->ref == it->u8.end) it->ref = NULL;
}
diff --git a/include/stc/cvec.h b/include/stc/cvec.h
index a5e1fac6..86646026 100644
--- a/include/stc/cvec.h
+++ b/include/stc/cvec.h
@@ -106,7 +106,7 @@ _cx_memb(_emplace_n)(_cx_self* self, const size_t idx, const _cx_raw arr[], cons
}
STC_INLINE _cx_iter
_cx_memb(_emplace_at)(_cx_self* self, _cx_iter it, _cx_raw raw) {
- return _cx_memb(_emplace_range_p)(self, (it.ref ? it.ref : it._end), &raw, &raw + 1);
+ return _cx_memb(_emplace_range_p)(self, (it.ref ? it.ref : it.end), &raw, &raw + 1);
}
#endif // !_i_no_emplace
@@ -171,7 +171,7 @@ _cx_memb(_insert_n)(_cx_self* self, const size_t idx, const _cx_value arr[], con
}
STC_INLINE _cx_iter
_cx_memb(_insert_at)(_cx_self* self, _cx_iter it, i_key value) {
- return _cx_memb(_insert_range_p)(self, (it.ref ? it.ref : it._end), &value, &value + 1);
+ return _cx_memb(_insert_range_p)(self, (it.ref ? it.ref : it.end), &value, &value + 1);
}
STC_INLINE _cx_iter
@@ -184,7 +184,7 @@ _cx_memb(_erase_at)(_cx_self* self, _cx_iter it) {
}
STC_INLINE _cx_iter
_cx_memb(_erase_range)(_cx_self* self, _cx_iter i1, _cx_iter i2) {
- return _cx_memb(_erase_range_p)(self, i1.ref, (i2.ref ? i2.ref : i2._end));
+ return _cx_memb(_erase_range_p)(self, i1.ref, (i2.ref ? i2.ref : i2.end));
}
STC_INLINE const _cx_value*
@@ -206,10 +206,10 @@ STC_INLINE _cx_iter _cx_memb(_end)(const _cx_self* self)
{ return c_make(_cx_iter){NULL, self->data + cvec_rep_(self)->size}; }
STC_INLINE void _cx_memb(_next)(_cx_iter* it)
- { if (++it->ref == it->_end) it->ref = NULL; }
+ { if (++it->ref == it->end) it->ref = NULL; }
STC_INLINE _cx_iter _cx_memb(_advance)(_cx_iter it, size_t n)
- { if ((it.ref += n) >= it._end) it.ref = NULL; return it; }
+ { if ((it.ref += n) >= it.end) it.ref = NULL; return it; }
STC_INLINE size_t _cx_memb(_index)(const _cx_self* cx, _cx_iter it)
{ return it.ref - cx->data; }
@@ -245,7 +245,7 @@ _cx_memb(_lower_bound)(const _cx_self* self, _cx_raw raw) {
STC_INLINE void
_cx_memb(_sort_range)(_cx_iter i1, _cx_iter i2, int(*cmp)(const _cx_value*, const _cx_value*)) {
- qsort(i1.ref, (i2.ref ? i2.ref : i2._end) - i1.ref, sizeof(_cx_value),
+ qsort(i1.ref, (i2.ref ? i2.ref : i2.end) - i1.ref, sizeof(_cx_value),
(int(*)(const void*, const void*)) cmp);
}
@@ -402,7 +402,7 @@ _cx_memb(_emplace_range_p)(_cx_self* self, _cx_value* pos,
#if !c_option(c_no_cmp)
STC_DEF _cx_iter
_cx_memb(_find_in)(_cx_iter i1, _cx_iter i2, _cx_raw raw) {
- const _cx_value* p2 = i2.ref ? i2.ref : i2._end;
+ const _cx_value* p2 = i2.ref ? i2.ref : i2.end;
for (; i1.ref != p2; ++i1.ref) {
const _cx_raw r = i_keyto(i1.ref);
if (i_eq((&raw), (&r)))
@@ -413,7 +413,7 @@ _cx_memb(_find_in)(_cx_iter i1, _cx_iter i2, _cx_raw raw) {
STC_DEF _cx_iter
_cx_memb(_binary_search_in)(_cx_iter i1, _cx_iter i2, const _cx_raw raw, _cx_iter* lower_bound) {
- const _cx_value* p2 = i2.ref ? i2.ref : i2._end;
+ const _cx_value* p2 = i2.ref ? i2.ref : i2.end;
_cx_iter mid = i1;
while (i1.ref != p2) {
mid.ref = i1.ref + (p2 - i1.ref)/2;
@@ -424,7 +424,7 @@ _cx_memb(_binary_search_in)(_cx_iter i1, _cx_iter i2, const _cx_raw raw, _cx_ite
else if (c < 0) p2 = mid.ref;
else i1.ref = mid.ref + 1;
}
- *lower_bound = i1.ref == i2._end ? i2 : i1;
+ *lower_bound = i1.ref == i2.end ? i2 : i1;
return i2;
}
diff --git a/include/stc/forward.h b/include/stc/forward.h
index 9be399af..8a0278a5 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;
- struct { csview chr; const char *_end; } u8;
+ 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, *_end; } 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, *_end; } 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, *_end; } 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, *_end; \
+ 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, *_end; } SELF##_iter; \
+ typedef struct { SELF##_value *ref, *end; } SELF##_iter; \
typedef struct SELF { \
SELF##_value* data; \
size_t size, capacity; \
@@ -194,7 +194,7 @@ typedef union {
#define _c_cstack_fixed(SELF, VAL, CAP) \
typedef VAL SELF##_value; \
- typedef struct { SELF##_value *ref, *_end; } SELF##_iter; \
+ typedef struct { SELF##_value *ref, *end; } SELF##_iter; \
typedef struct SELF { \
SELF##_value data[CAP]; \
size_t size; \
@@ -209,7 +209,7 @@ typedef union {
#define _c_cvec_types(SELF, VAL) \
typedef VAL SELF##_value; \
- typedef struct { SELF##_value *ref, *_end; } SELF##_iter; \
+ typedef struct { SELF##_value *ref, *end; } SELF##_iter; \
typedef struct { SELF##_value *data; } SELF
#endif // STC_FORWARD_H_INCLUDED