@@ -333,11 +333,11 @@ PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node)
333333 if (curnode -> type == XML_ELEMENT_NODE ) {
334334 /* This ensures that namespace references in this subtree are defined within this subtree,
335335 * otherwise a use-after-free would be possible when the original namespace holder gets freed. */
336- php_libxml_node_ptr * ptr = curnode -> _private ;
336+ const php_libxml_node_ptr * ptr = curnode -> _private ;
337337
338338 /* Checking in case it runs out of reference */
339339 if (ptr -> _private ) {
340- php_libxml_node_object * obj = ptr -> _private ;
340+ const php_libxml_node_object * obj = ptr -> _private ;
341341 if (!obj -> document || obj -> document -> class_type < PHP_LIBXML_CLASS_MODERN ) {
342342 xmlReconciliateNs (curnode -> doc , curnode );
343343 }
@@ -524,7 +524,7 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
524524
525525 /* Check if there's been an external transport protocol with an encoding information */
526526 if (enc == XML_CHAR_ENCODING_NONE ) {
527- php_stream * s = (php_stream * ) context ;
527+ const php_stream * s = (php_stream * ) context ;
528528 zend_string * charset = php_libxml_sniff_charset_from_stream (s );
529529 if (charset != NULL ) {
530530 enc = xmlParseCharEncoding (ZSTR_VAL (charset ));
@@ -934,7 +934,7 @@ PHP_LIBXML_API void php_libxml_shutdown(void)
934934 }
935935}
936936
937- PHP_LIBXML_API void php_libxml_switch_context (zval * context , zval * oldcontext )
937+ PHP_LIBXML_API void php_libxml_switch_context (const zval * context , zval * oldcontext )
938938{
939939 if (oldcontext ) {
940940 ZVAL_COPY_VALUE (oldcontext , & LIBXML (stream_context ));
@@ -1268,7 +1268,7 @@ int php_libxml_xmlCheckUTF8(const unsigned char *s)
12681268 return 1 ;
12691269}
12701270
1271- zval * php_libxml_register_export (zend_class_entry * ce , php_libxml_export_node export_function )
1271+ zval * php_libxml_register_export (const zend_class_entry * ce , php_libxml_export_node export_function )
12721272{
12731273 php_libxml_func_handler export_hnd ;
12741274
@@ -1284,11 +1284,11 @@ PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object)
12841284 xmlNodePtr node = NULL ;
12851285
12861286 if (Z_TYPE_P (object ) == IS_OBJECT ) {
1287- zend_class_entry * ce = Z_OBJCE_P (object );
1287+ const zend_class_entry * ce = Z_OBJCE_P (object );
12881288 while (ce -> parent != NULL ) {
12891289 ce = ce -> parent ;
12901290 }
1291- php_libxml_func_handler * export_hnd = zend_hash_find_ptr (& php_libxml_exports , ce -> name );
1291+ const php_libxml_func_handler * export_hnd = zend_hash_find_ptr (& php_libxml_exports , ce -> name );
12921292 if (export_hnd ) {
12931293 node = export_hnd -> export_func (object );
12941294 }
0 commit comments