summaryrefslogtreecommitdiffhomepage
path: root/include/stc/csview.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-25 14:51:35 +0200
committerTyge Løvset <[email protected]>2022-09-25 15:09:23 +0200
commit2093b18689383286915df511167a12dc5d7bc75f (patch)
tree174779ae7e7b4f6d10ec8be300ea9574e2395729 /include/stc/csview.h
parent756120e349a892ef1b7655fc777f28ec13845300 (diff)
downloadSTC-modified-2093b18689383286915df511167a12dc5d7bc75f.tar.gz
STC-modified-2093b18689383286915df511167a12dc5d7bc75f.zip
Added: crange number generator type. (similar to c++ std::iota). Fixed c_forfilter again. Cleanups. Docs added.
Diffstat (limited to 'include/stc/csview.h')
-rw-r--r--include/stc/csview.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/csview.h b/include/stc/csview.h
index 3bb8a542..2be30cb0 100644
--- a/include/stc/csview.h
+++ b/include/stc/csview.h
@@ -86,7 +86,7 @@ STC_INLINE void csview_next(csview_iter* it) {
it->u8.chr.size = utf8_chr_size(it->ref);
if (it->ref == it->u8.end) it->ref = NULL;
}
-STC_INLINE csview_iter csview_advance(csview_iter it, isize_t pos) {
+STC_INLINE csview_iter csview_advance(csview_iter it, intptr_t pos) {
int inc = -1;
if (pos > 0) pos = -pos, inc = 1;
while (pos && it.ref != it.u8.end) pos += (*(it.ref += inc) & 0xC0) != 0x80;
@@ -145,7 +145,7 @@ STC_INLINE csview cstr_u8_substr(const cstr* self , size_t bytepos, size_t u8len
STC_INLINE int csview_cmp(const csview* x, const csview* y) {
size_t n = x->size < y->size ? x->size : y->size;
int c = memcmp(x->str, y->str, n);
- return c ? c : x->size - y->size;
+ return c ? c : (int)(x->size - y->size);
}
STC_INLINE int csview_icmp(const csview* x, const csview* y)