summaryrefslogtreecommitdiffhomepage
path: root/include/stc/utf8.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-11-22 16:12:35 +0100
committerTyge Løvset <[email protected]>2022-11-22 16:12:35 +0100
commit72f75574edea7a864d5784e38d7d90315c2b2190 (patch)
tree74e5b097b75c8d13faacc781106c4b99a1040169 /include/stc/utf8.h
parent512cba08af831a864e09d34f02250820d3d76883 (diff)
downloadSTC-modified-72f75574edea7a864d5784e38d7d90315c2b2190.tar.gz
STC-modified-72f75574edea7a864d5784e38d7d90315c2b2190.zip
Fixes of -Wconversion warnings (not examples).
Diffstat (limited to 'include/stc/utf8.h')
-rw-r--r--include/stc/utf8.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/utf8.h b/include/stc/utf8.h
index 7a4ba921..0ff79fb9 100644
--- a/include/stc/utf8.h
+++ b/include/stc/utf8.h
@@ -31,7 +31,7 @@ STC_INLINE uint32_t utf8_decode(utf8_decode_t* d, const uint32_t byte) {
extern const uint8_t utf8_dtab[]; /* utf8code.c */
const uint32_t type = utf8_dtab[byte];
d->codep = d->state ? (byte & 0x3fu) | (d->codep << 6)
- : (0xff >> type) & byte;
+ : (0xffU >> type) & byte;
return d->state = utf8_dtab[256 + d->state + type];
}
@@ -86,6 +86,6 @@ STC_INLINE const char* utf8_at(const char *s, size_t index) {
}
STC_INLINE size_t utf8_pos(const char* s, size_t index)
- { return utf8_at(s, index) - s; }
+ { return (size_t)(utf8_at(s, index) - s); }
#endif