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

Fix gcc warings - alternative to #2061 #2068

Merged
merged 2 commits into from
Aug 28, 2020
Merged
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
7 changes: 6 additions & 1 deletion ext/nokogiri/xml_document.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <xml_document.h>

static int dealloc_node_i(xmlNodePtr key, xmlNodePtr node, xmlDocPtr doc)
static int dealloc_node_i2(xmlNodePtr key, xmlNodePtr node, xmlDocPtr doc)
{
switch(node->type) {
case XML_ATTRIBUTE_NODE:
Expand All @@ -20,6 +20,11 @@ static int dealloc_node_i(xmlNodePtr key, xmlNodePtr node, xmlDocPtr doc)
return ST_CONTINUE;
}

static int dealloc_node_i(st_data_t key, st_data_t node, st_data_t doc)
{
return dealloc_node_i2((xmlNodePtr)key, (xmlNodePtr)node, (xmlDocPtr)doc);
}

static void remove_private(xmlNodePtr node)
{
xmlNodePtr child;
Expand Down
14 changes: 8 additions & 6 deletions ext/nokogiri/xml_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

static ID id_read, id_write;

VALUE read_check(VALUE *args) {
VALUE read_check(VALUE val) {
VALUE *args = (VALUE *)val;
return rb_funcall(args[0], id_read, 1, args[1]);
}

VALUE read_failed(void) {
return Qundef;
VALUE read_failed(VALUE arg, VALUE exc) {
return Qundef;
}

int io_read_callback(void * ctx, char * buffer, int len) {
Expand All @@ -30,12 +31,13 @@ int io_read_callback(void * ctx, char * buffer, int len) {
return (int)safe_len;
}

VALUE write_check(VALUE *args) {
VALUE write_check(VALUE val) {
VALUE *args = (VALUE *)val;
return rb_funcall(args[0], id_write, 1, args[1]);
}

VALUE write_failed(void) {
return Qundef;
VALUE write_failed(VALUE arg, VALUE exc) {
return Qundef;
}

int io_write_callback(void * ctx, char * buffer, int len) {
Expand Down