summaryrefslogtreecommitdiff
path: root/src/utf8.c
diff options
context:
space:
mode:
authorKevin Wojniak <kainjow@kainjow.com>2015-08-10 10:06:14 -0700
committerKevin Wojniak <kainjow@kainjow.com>2015-08-10 10:06:14 -0700
commit722bc5df7e7bde6ec865b991e500aca04c931ad5 (patch)
tree24b01e07e7b5921fb415011e3db41e5aad669b34 /src/utf8.c
parent59bcd222c3ef1a64045e27db24ffddeb99ee29d4 (diff)
Remove need to disable MSVC warning 4244
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);