summaryrefslogtreecommitdiff
path: root/src/utf8.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-08-10 20:19:09 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-08-10 20:19:09 -0700
commit735098e097ad62bdc4b1121c6c0c983eb7483485 (patch)
treea858fedc30e6149ed430784942413a2b06741ec9 /src/utf8.c
parenta541e39f69cfa75422fbe70c59c2ac40fbdbe1d7 (diff)
parentce0e58469f7c4abf3f51bde6d3298215d6ef99d1 (diff)
Merge pull request #76 from kainjow/msvc-warnings
Fix some MSVC warnings
Diffstat (limited to 'src/utf8.c')
-rwxr-xr-xsrc/utf8.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utf8.c b/src/utf8.c
index a742a75..319539d 100755
--- a/src/utf8.c
+++ b/src/utf8.c
@@ -191,10 +191,10 @@ void cmark_utf8proc_encode_char(int32_t uc, cmark_strbuf *buf) {
assert(uc >= 0);
if (uc < 0x80) {
- dst[0] = uc;
+ dst[0] = (uint8_t)(uc);
len = 1;
} else if (uc < 0x800) {
- dst[0] = 0xC0 + (uc >> 6);
+ dst[0] = (uint8_t)(0xC0 + (uc >> 6));
dst[1] = 0x80 + (uc & 0x3F);
len = 2;
} else if (uc == 0xFFFF) {
@@ -204,12 +204,12 @@ void cmark_utf8proc_encode_char(int32_t uc, cmark_strbuf *buf) {
dst[0] = 0xFE;
len = 1;
} else if (uc < 0x10000) {
- dst[0] = 0xE0 + (uc >> 12);
+ dst[0] = (uint8_t)(0xE0 + (uc >> 12));
dst[1] = 0x80 + ((uc >> 6) & 0x3F);
dst[2] = 0x80 + (uc & 0x3F);
len = 3;
} else if (uc < 0x110000) {
- dst[0] = 0xF0 + (uc >> 18);
+ dst[0] = (uint8_t)(0xF0 + (uc >> 18));
dst[1] = 0x80 + ((uc >> 12) & 0x3F);
dst[2] = 0x80 + ((uc >> 6) & 0x3F);
dst[3] = 0x80 + (uc & 0x3F);