Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve project "Implicit conversion loses integer precision: ..." warnings #276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/cmark/blocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ static void S_parser_feed(cmark_parser *parser, const unsigned char *buffer,
process = true;
}

chunk_len = (eol - buffer);
chunk_len = (bufsize_t)(eol - buffer);
if (process) {
if (parser->linebuf.size > 0) {
cmark_strbuf_put(&parser->linebuf, buffer, chunk_len);
Expand Down
4 changes: 2 additions & 2 deletions Sources/cmark/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void cmark_strbuf_set(cmark_strbuf *buf, const unsigned char *data,

void cmark_strbuf_sets(cmark_strbuf *buf, const char *string) {
cmark_strbuf_set(buf, (const unsigned char *)string,
string ? strlen(string) : 0);
string ? (bufsize_t)strlen(string) : 0);
}

void cmark_strbuf_putc(cmark_strbuf *buf, int c) {
Expand All @@ -116,7 +116,7 @@ void cmark_strbuf_put(cmark_strbuf *buf, const unsigned char *data,
}

void cmark_strbuf_puts(cmark_strbuf *buf, const char *string) {
cmark_strbuf_put(buf, (const unsigned char *)string, strlen(string));
cmark_strbuf_put(buf, (const unsigned char *)string, (bufsize_t)strlen(string));
}

void cmark_strbuf_copy_cstr(char *data, bufsize_t datasize,
Expand Down
2 changes: 1 addition & 1 deletion Sources/cmark/commonmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
snprintf(listmarker, LISTMARKER_SIZE, "%d%s%s", list_number,
list_delim == CMARK_PAREN_DELIM ? ")" : ".",
list_number < 10 ? " " : " ");
marker_width = strlen(listmarker);
marker_width = (bufsize_t)strlen(listmarker);
}
if (entering) {
if (cmark_node_get_list_type(node->parent) == CMARK_BULLET_LIST) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/cmark/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static CMARK_INLINE void S_blankline(cmark_renderer *renderer) {

static void S_out(cmark_renderer *renderer, const char *source, bool wrap,
cmark_escaping escape) {
int length = strlen(source);
int length = (int)strlen(source);
unsigned char nextc;
int32_t c;
int i = 0;
Expand Down