diff options
| author | Tyge Lovset <[email protected]> | 2022-08-11 08:50:36 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2022-08-11 08:50:36 +0200 |
| commit | f7fbc7727b8ceab54ef1ae1744cc378225a36d02 (patch) | |
| tree | 7a379efdd71c5350f2f06e34f5200029163ce64c /include | |
| parent | 65199590def8459198f9460c5d975a1df22d00a8 (diff) | |
| download | STC-modified-f7fbc7727b8ceab54ef1ae1744cc378225a36d02.tar.gz STC-modified-f7fbc7727b8ceab54ef1ae1744cc378225a36d02.zip | |
Minor formatting.
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/cdeq.h | 3 | ||||
| -rw-r--r-- | include/stc/cregex.h | 5 | ||||
| -rw-r--r-- | include/stc/csview.h | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h index d3c7fede..d09c43ae 100644 --- a/include/stc/cdeq.h +++ b/include/stc/cdeq.h @@ -231,7 +231,8 @@ _cx_memb(_shrink_to_fit)(_cx_self *self) { struct cdeq_rep* rep = cdeq_rep_(self); const size_t sz = rep->size; memmove(self->_base, self->data, sz*sizeof(i_key)); - rep = (struct cdeq_rep*) c_realloc(rep, offsetof(struct cdeq_rep, base) + sz*sizeof(i_key)); + rep = (struct cdeq_rep*) c_realloc(rep, offsetof(struct cdeq_rep, base) + + sz*sizeof(i_key)); if (rep) { self->_base = self->data = (_cx_value*)rep->base; rep->cap = sz; diff --git a/include/stc/cregex.h b/include/stc/cregex.h index d19d518f..4812bff2 100644 --- a/include/stc/cregex.h +++ b/include/stc/cregex.h @@ -76,8 +76,9 @@ typedef struct { csview ref[cre_MAXCAPTURES]; } cregex_iter; -#define c_foreach_match(i, _re, _input) \ - for (cregex_iter i = {_re, _input}; cregex_find(i.input, i.re, i.ref, cre_m_next) == cre_success;) +#define c_foreach_match(it, Re, Input) \ + for (cregex_iter it = {Re, Input}; \ + cregex_find(it.input, it.re, it.ref, cre_m_next) == cre_success;) static inline cregex cregex_init(void) { diff --git a/include/stc/csview.h b/include/stc/csview.h index 5db23a01..dbff8620 100644 --- a/include/stc/csview.h +++ b/include/stc/csview.h @@ -72,7 +72,8 @@ STC_INLINE csview csview_slice(csview sv, size_t p1, size_t p2) { /* utf8 iterator */ STC_INLINE csview_iter csview_begin(const csview* self) { if (!self->size) return c_make(csview_iter){NULL}; - return c_make(csview_iter){.u8 = {{self->str, utf8_chr_size(self->str)}, self->str + self->size}}; + return c_make(csview_iter){.u8 = {{self->str, utf8_chr_size(self->str)}, + self->str + self->size}}; } STC_INLINE csview_iter csview_end(const csview* self) |
