@@ -1291,9 +1291,9 @@ PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object)
12911291	return  node ;
12921292}
12931293
1294- PHP_LIBXML_API  int  php_libxml_increment_node_ptr (php_libxml_node_object  * object , xmlNodePtr  node , void  * private_data )
1294+ PHP_LIBXML_API  unsigned   int  php_libxml_increment_node_ptr (php_libxml_node_object  * object , xmlNodePtr  node , void  * private_data )
12951295{
1296- 	int  ret_refcount  =  -1 ;
1296+ 	unsigned  int   ret_refcount  =  0 ;
12971297
12981298	if  (object  !=  NULL  &&  node  !=  NULL ) {
12991299		if  (object -> node  !=  NULL ) {
@@ -1323,11 +1323,11 @@ PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object,
13231323	return  ret_refcount ;
13241324}
13251325
1326- PHP_LIBXML_API  int  php_libxml_decrement_node_ptr_ref (php_libxml_node_ptr  * ptr )
1326+ PHP_LIBXML_API  unsigned   int  php_libxml_decrement_node_ptr_ref (php_libxml_node_ptr  * ptr )
13271327{
13281328	ZEND_ASSERT (ptr  !=  NULL );
13291329
1330- 	int  ret_refcount  =  -- ptr -> refcount ;
1330+ 	unsigned  int   ret_refcount  =  -- ptr -> refcount ;
13311331	if  (ret_refcount  ==  0 ) {
13321332		if  (ptr -> node  !=  NULL ) {
13331333			ptr -> node -> _private  =  NULL ;
@@ -1341,17 +1341,17 @@ PHP_LIBXML_API int php_libxml_decrement_node_ptr_ref(php_libxml_node_ptr *ptr)
13411341	return  ret_refcount ;
13421342}
13431343
1344- PHP_LIBXML_API  int  php_libxml_decrement_node_ptr (php_libxml_node_object  * object )
1344+ PHP_LIBXML_API  unsigned   int  php_libxml_decrement_node_ptr (php_libxml_node_object  * object )
13451345{
13461346	if  (object  !=  NULL  &&  object -> node  !=  NULL ) {
13471347		return  php_libxml_decrement_node_ptr_ref (object -> node );
13481348	}
1349- 	return  -1 ;
1349+ 	return  0 ;
13501350}
13511351
1352- PHP_LIBXML_API  int  php_libxml_increment_doc_ref (php_libxml_node_object  * object , xmlDocPtr  docp )
1352+ PHP_LIBXML_API  unsigned   int  php_libxml_increment_doc_ref (php_libxml_node_object  * object , xmlDocPtr  docp )
13531353{
1354- 	int  ret_refcount  =  -1 ;
1354+ 	unsigned  int   ret_refcount  =  0 ;
13551355
13561356	if  (object -> document  !=  NULL ) {
13571357		object -> document -> refcount ++ ;
@@ -1372,9 +1372,9 @@ PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object,
13721372	return  ret_refcount ;
13731373}
13741374
1375- PHP_LIBXML_API  int  php_libxml_decrement_doc_ref_directly (php_libxml_ref_obj  * document )
1375+ PHP_LIBXML_API  unsigned   int  php_libxml_decrement_doc_ref_directly (php_libxml_ref_obj  * document )
13761376{
1377- 	int  ret_refcount  =  -- document -> refcount ;
1377+ 	unsigned  int   ret_refcount  =  -- document -> refcount ;
13781378	if  (ret_refcount  ==  0 ) {
13791379		if  (document -> private_data  !=  NULL ) {
13801380			document -> private_data -> dtor (document -> private_data );
@@ -1395,9 +1395,9 @@ PHP_LIBXML_API int php_libxml_decrement_doc_ref_directly(php_libxml_ref_obj *doc
13951395	return  ret_refcount ;
13961396}
13971397
1398- PHP_LIBXML_API  int  php_libxml_decrement_doc_ref (php_libxml_node_object  * object )
1398+ PHP_LIBXML_API  unsigned   int  php_libxml_decrement_doc_ref (php_libxml_node_object  * object )
13991399{
1400- 	int  ret_refcount  =  -1 ;
1400+ 	unsigned  int   ret_refcount  =  0 ;
14011401
14021402	if  (object  !=  NULL  &&  object -> document  !=  NULL ) {
14031403		ret_refcount  =  php_libxml_decrement_doc_ref_directly (object -> document );
@@ -1445,7 +1445,7 @@ PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *o
14451445	if  (object  !=  NULL  &&  object -> node  !=  NULL ) {
14461446		php_libxml_node_ptr  * obj_node  =  (php_libxml_node_ptr  * ) object -> node ;
14471447		xmlNodePtr  nodep  =  obj_node -> node ;
1448- 		int  ret_refcount  =  php_libxml_decrement_node_ptr (object );
1448+ 		unsigned  int   ret_refcount  =  php_libxml_decrement_node_ptr (object );
14491449		if  (ret_refcount  ==  0 ) {
14501450			php_libxml_node_free_resource (nodep );
14511451		} else  {
0 commit comments