Skip to content

Commit

Permalink
Fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
zyc9012 committed Sep 1, 2024
1 parent 33f95e5 commit a3257b6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions ext/nokolexbor/nl_attribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ nl_attribute_parent(VALUE self)
if (attr->owner == NULL) {
return Qnil;
}
return nl_rb_node_create(attr->owner, nl_rb_document_get(self));
return nl_rb_node_create((lxb_dom_node_t *)attr->owner, nl_rb_document_get(self));
}

/**
Expand All @@ -158,7 +158,7 @@ nl_attribute_previous(VALUE self)
if (attr->prev == NULL) {
return Qnil;
}
return nl_rb_node_create(attr->prev, nl_rb_document_get(self));
return nl_rb_node_create((lxb_dom_node_t *)attr->prev, nl_rb_document_get(self));
}

/**
Expand All @@ -175,7 +175,7 @@ nl_attribute_next(VALUE self)
if (attr->next == NULL) {
return Qnil;
}
return nl_rb_node_create(attr->next, nl_rb_document_get(self));
return nl_rb_node_create((lxb_dom_node_t *)attr->next, nl_rb_document_get(self));
}

static VALUE
Expand All @@ -189,7 +189,7 @@ nl_attribute_inspect(VALUE self)

return rb_sprintf("#<%" PRIsVALUE " %s=\"%s\">", c,
lxb_dom_attr_qualified_name(attr, &len),
attr_value == NULL ? "" : attr_value);
attr_value == NULL ? "" : (char *)attr_value);
}

void Init_nl_attribute(void)
Expand Down
4 changes: 2 additions & 2 deletions ext/nokolexbor/nl_document.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static VALUE
nl_document_get_title(VALUE self)
{
size_t len;
lxb_char_t *str = lxb_html_document_title(nl_rb_document_unwrap(self), &len);
lxb_char_t *str = lxb_html_document_title((lxb_html_document_t *)nl_rb_document_unwrap(self), &len);
return str == NULL ? rb_str_new("", 0) : rb_utf8_str_new(str, len);
}

Expand All @@ -126,7 +126,7 @@ nl_document_set_title(VALUE self, VALUE rb_title)
{
const char *c_title = StringValuePtr(rb_title);
size_t len = RSTRING_LEN(rb_title);
lxb_html_document_title_set(nl_rb_document_unwrap(self), (const lxb_char_t *)c_title, len);
lxb_html_document_title_set((lxb_html_document_t *)nl_rb_document_unwrap(self), (const lxb_char_t *)c_title, len);
return rb_title;
}

Expand Down
4 changes: 2 additions & 2 deletions ext/nokolexbor/nl_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ nl_node_attribute(VALUE self, VALUE rb_name)
if (attr->owner == NULL) {
attr->owner = lxb_dom_interface_element(node);
}
return nl_rb_node_create(attr, nl_rb_document_get(self));
return nl_rb_node_create((lxb_dom_node_t *)attr, nl_rb_document_get(self));
}

/**
Expand All @@ -191,7 +191,7 @@ nl_node_attribute_nodes(VALUE self)
if (attr->owner == NULL) {
attr->owner = lxb_dom_interface_element(node);
}
rb_ary_push(ary, nl_rb_node_create(attr, rb_doc));
rb_ary_push(ary, nl_rb_node_create((lxb_dom_node_t *)attr, rb_doc));
attr = attr->next;
}

Expand Down
4 changes: 2 additions & 2 deletions ext/nokolexbor/xml_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ nl_xmlGetNodePath(const lxb_dom_node_t *node)

} else if (cur->type == LXB_DOM_NODE_TYPE_ATTRIBUTE) {
sep = "/@";
name = (const char *) lxb_dom_attr_qualified_name(cur, &tmp_len);
next = ((lxb_dom_attr_t_ptr)cur)->owner;
name = (const char *) lxb_dom_attr_qualified_name((lxb_dom_attr_t_ptr)cur, &tmp_len);
next = (lxb_dom_node_t *)((lxb_dom_attr_t_ptr)cur)->owner;
} else {
nl_xmlFree(buf);
nl_xmlFree(buffer);
Expand Down
2 changes: 1 addition & 1 deletion patches/0004-lexbor-fix-template-clone.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ index a2153f4..8a9c69f 100755

+ if (curr->local_name == LXB_TAG_TEMPLATE && curr->first_child != NULL && cnode->type == LXB_DOM_NODE_TYPE_DOCUMENT_FRAGMENT) {
+ lxb_dom_node_remove(curr->first_child);
+ lxb_html_interface_template(curr)->content = cnode;
+ lxb_html_interface_template(curr)->content = (lxb_dom_document_fragment_t *)cnode;
+ }
+
lxb_dom_node_insert_child(curr, cnode);
Expand Down

0 comments on commit a3257b6

Please sign in to comment.