summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api_test/CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt2
-rwxr-xr-xsrc/blocks.c2
-rw-r--r--src/buffer.c2
-rw-r--r--src/html.c4
-rwxr-xr-xsrc/utf8.c8
6 files changed, 10 insertions, 10 deletions
diff --git a/api_test/CMakeLists.txt b/api_test/CMakeLists.txt
index f7dff55..4ac4a1d 100644
--- a/api_test/CMakeLists.txt
+++ b/api_test/CMakeLists.txt
@@ -18,7 +18,7 @@ if(MSVC)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
endif()
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4244 /wd4267 /wd4706 /D_CRT_SECURE_NO_WARNINGS")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4267 /wd4706 /D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP")
elseif(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -pedantic")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ecdd016..0f04351 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -155,7 +155,7 @@ if(MSVC)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
endif()
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4244 /wd4267 /wd4706 /D_CRT_SECURE_NO_WARNINGS")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4267 /wd4706 /D_CRT_SECURE_NO_WARNINGS")
elseif(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -pedantic")
endif()
diff --git a/src/blocks.c b/src/blocks.c
index 6d3053b..49ac273 100755
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -774,7 +774,7 @@ static void S_process_line(cmark_parser *parser, const unsigned char *buffer,
container->as.code.fenced = true;
container->as.code.fence_char = peek_at(&input, parser->first_nonspace);
container->as.code.fence_length = matched;
- container->as.code.fence_offset = parser->first_nonspace - parser->offset;
+ container->as.code.fence_offset = (int8_t)(parser->first_nonspace - parser->offset);
container->as.code.info = cmark_chunk_literal("");
S_advance_offset(parser, &input,
parser->first_nonspace + matched - parser->offset,
diff --git a/src/buffer.c b/src/buffer.c
index 26dfb8e..a89c82e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -133,7 +133,7 @@ void cmark_strbuf_sets(cmark_strbuf *buf, const char *string) {
void cmark_strbuf_putc(cmark_strbuf *buf, int c) {
S_strbuf_grow_by(buf, 1);
- buf->ptr[buf->size++] = c;
+ buf->ptr[buf->size++] = (unsigned char)(c & 0xFF);
buf->ptr[buf->size] = '\0';
}
diff --git a/src/html.c b/src/html.c
index e365c8c..dfe2aec 100644
--- a/src/html.c
+++ b/src/html.c
@@ -130,12 +130,12 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
case CMARK_NODE_HEADER:
if (entering) {
cr(html);
- start_header[2] = '0' + node->as.header.level;
+ start_header[2] = (char)('0' + node->as.header.level);
cmark_strbuf_puts(html, start_header);
S_render_sourcepos(node, html, options);
cmark_strbuf_putc(html, '>');
} else {
- end_header[3] = '0' + node->as.header.level;
+ end_header[3] = (char)('0' + node->as.header.level);
cmark_strbuf_puts(html, end_header);
cmark_strbuf_puts(html, ">\n");
}
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);