Skip to content

Commit 5a1c9d8

Browse files
committed
fix for -cstrict -cc clang-18 passes for markdown
1 parent 8098e03 commit 5a1c9d8

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/html.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ fn write_data_cb(txt &char, size u32, mut sb strings.Builder) {
1919

2020
pub fn to_html(input string) string {
2121
mut wr := strings.new_builder(200)
22-
C.md_html(input.str, input.len, write_data_cb, &wr, C.MD_DIALECT_GITHUB, 0)
22+
C.md_html(voidptr(input.str), input.len, write_data_cb, &wr, C.MD_DIALECT_GITHUB, 0)
2323
return wr.str().trim_space()
2424
}

src/html_experimental.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn tos_attribute(attr &C.MD_ATTRIBUTE, mut wr strings.Builder) {
6464
typ := unsafe { MD_TEXTTYPE(attr.substr_types[i]) }
6565
off := unsafe { attr.substr_offsets[i] }
6666
size := unsafe { attr.substr_offsets[i + 1] - off }
67-
text := unsafe { (attr.text + off).vstring_with_len(int(size)) }
67+
text := unsafe { (&char(attr.text) + off).vstring_with_len(int(size)) }
6868

6969
match typ {
7070
.md_text_null_char {

src/renderer.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn renderer_debug_log_cb(msg &char, mut renderer Renderer) {
5555
pub fn render(src string, mut renderer Renderer) !string {
5656
parser := new(u32(C.MD_DIALECT_GITHUB), renderer_enter_block_cb, renderer_leave_block_cb,
5757
renderer_enter_span_cb, renderer_leave_span_cb, renderer_text_cb, renderer_debug_log_cb)
58-
err_code := parse(src.str, u32(src.len), &parser, &renderer)
58+
err_code := parse(voidptr(src.str), u32(src.len), &parser, &renderer)
5959
if err_code != 0 {
6060
return error_with_code('Something went wrong while parsing.', err_code)
6161
}

thirdparty/md4c/md4c.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3129,6 +3129,7 @@ md_collect_marks(MD_CTX* ctx, const MD_LINE* lines, int n_lines, int table_mode)
31293129
/* Advance the current line accordingly. */
31303130
if(off > line_end) {
31313131
line = md_lookup_line(off, line, line_term - line);
3132+
if(NULL == line) exit(15);
31323133
line_end = line->end;
31333134
}
31343135
continue;

0 commit comments

Comments
 (0)