diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/cdeq.h | 4 | ||||
| -rw-r--r-- | include/stc/csmap.h | 4 | ||||
| -rw-r--r-- | include/stc/csview.h | 4 | ||||
| -rw-r--r-- | include/stc/cvec.h | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h index ee0d1c2c..846a9c7f 100644 --- a/include/stc/cdeq.h +++ b/include/stc/cdeq.h @@ -199,14 +199,14 @@ struct cdeq_rep { size_t size, cap; void* base[]; }; #if !defined(STC_HEADER) || defined(STC_IMPLEMENTATION)
-static struct cdeq_rep _cdeq_inits = {0, 0};
+static struct cdeq_rep _cdeq_sentinel = {0, 0};
#define _cdeq_nfront(self) ((self)->data - (self)->_base)
#define _c_implement_cdeq(CX, Value, valueCompareRaw, valueDel, valueFromRaw, valueToRaw, RawValue) \
\
STC_DEF CX \
CX##_init(void) { \
- CX##_value_t *b = (CX##_value_t *) _cdeq_inits.base; \
+ CX##_value_t *b = (CX##_value_t *) _cdeq_sentinel.base; \
return c_make(CX){b, b}; \
} \
\
diff --git a/include/stc/csmap.h b/include/stc/csmap.h index 3535897c..336280bf 100644 --- a/include/stc/csmap.h +++ b/include/stc/csmap.h @@ -308,14 +308,14 @@ struct csmap_rep { size_t root, disp, head, size, cap; void* nodes[]; }; /* -------------------------- IMPLEMENTATION ------------------------- */
#if !defined(STC_HEADER) || defined(STC_IMPLEMENTATION)
-static struct csmap_rep _csmap_inits = {0, 0, 0, 0};
+static struct csmap_rep _csmap_sentinel = {0, 0, 0, 0, 0};
#define _c_implement_aatree(CX, C, Key, Mapped, keyCompareRaw, \
mappedDel, mappedFromRaw, mappedToRaw, RawMapped, \
keyDel, keyFromRaw, keyToRaw, RawKey) \
STC_DEF CX \
CX##_init(void) { \
- CX tree = {(CX##_node_t *) _csmap_inits.nodes}; \
+ CX tree = {(CX##_node_t *) _csmap_sentinel.nodes}; \
return tree; \
} \
\
diff --git a/include/stc/csview.h b/include/stc/csview.h index bbb2752f..990104f1 100644 --- a/include/stc/csview.h +++ b/include/stc/csview.h @@ -81,8 +81,8 @@ STC_INLINE csview csview_first_token(csview sv, csview sep) { }
STC_INLINE csview csview_next_token(csview sv, csview sep, csview token) {
- if (token.str - sv.str + token.size == sv.size)
- return c_make(csview){sv.str + sv.size, 0};
+ if (&token.str[token.size] == &sv.str[sv.size])
+ return c_make(csview){&sv.str[sv.size], 0};
token.str += token.size + sep.size;
size_t n = sv.size - (token.str - sv.str);
const char* res = c_strnstrn(token.str, sep.str, n, sep.size);
diff --git a/include/stc/cvec.h b/include/stc/cvec.h index e4feaf8a..3e7e37f2 100644 --- a/include/stc/cvec.h +++ b/include/stc/cvec.h @@ -203,13 +203,13 @@ struct cvec_rep { size_t size, cap; void* data[]; }; /* -------------------------- IMPLEMENTATION ------------------------- */
#if !defined(STC_HEADER) || defined(STC_IMPLEMENTATION)
-static struct cvec_rep _cvec_inits = {0, 0};
+static struct cvec_rep _cvec_sentinel = {0, 0};
#define _c_implement_cvec(CX, Value, valueCompareRaw, valueDel, valueFromRaw, valueToRaw, RawValue) \
\
STC_DEF CX \
CX##_init(void) { \
- CX cx = {(CX##_value_t *) _cvec_inits.data}; \
+ CX cx = {(CX##_value_t *) _cvec_sentinel.data}; \
return cx; \
} \
\
|
