Skip to content

Commit 53e07ba

Browse files
committed
Fix function libxml free error signature
Fixes a -Wcast-function-type warning.
1 parent 8e5df60 commit 53e07ba

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ext/libxml/libxml.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,10 @@ php_libxml_output_buffer_create_filename(const char *URI,
418418
return(ret);
419419
}
420420

421-
static int _php_libxml_free_error(xmlErrorPtr error)
421+
static void _php_libxml_free_error(void *ptr)
422422
{
423423
/* This will free the libxml alloc'd memory */
424-
xmlResetError(error);
425-
return 1;
424+
xmlResetError((xmlErrorPtr) ptr);
426425
}
427426

428427
static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
@@ -943,7 +942,7 @@ PHP_FUNCTION(libxml_use_internal_errors)
943942
xmlSetStructuredErrorFunc(NULL, php_libxml_structured_error_handler);
944943
if (LIBXML(error_list) == NULL) {
945944
LIBXML(error_list) = (zend_llist *) emalloc(sizeof(zend_llist));
946-
zend_llist_init(LIBXML(error_list), sizeof(xmlError), (llist_dtor_func_t) _php_libxml_free_error, 0);
945+
zend_llist_init(LIBXML(error_list), sizeof(xmlError), _php_libxml_free_error, 0);
947946
}
948947
}
949948
RETURN_BOOL(retval);

0 commit comments

Comments
 (0)