4949#include "libxml_arginfo.h"
5050
5151/* a true global for initialization */
52- static int php_libxml_initialized = 0 ;
53- static int php_libxml_per_request_initialization = 1 ;
52+ static bool php_libxml_initialized = false ;
53+ static bool php_libxml_per_request_initialization = true ;
5454static xmlExternalEntityLoader php_libxml_default_entity_loader ;
5555
5656typedef struct php_libxml_func_handler {
@@ -404,7 +404,7 @@ PHP_LIBXML_API php_stream_context *php_libxml_get_stream_context(void)
404404/* Channel libxml file io layer through the PHP streams subsystem.
405405 * This allows use of ftps:// and https:// urls */
406406
407- static void * php_libxml_streams_IO_open_wrapper (const char * filename , const char * mode , const int read_only )
407+ static void * php_libxml_streams_IO_open_wrapper (const char * filename , const char * mode , const bool read_only )
408408{
409409 php_stream_statbuf ssbuf ;
410410 char * resolved_path ;
@@ -480,12 +480,12 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
480480
481481static void * php_libxml_streams_IO_open_read_wrapper (const char * filename )
482482{
483- return php_libxml_streams_IO_open_wrapper (filename , "rb" , 1 );
483+ return php_libxml_streams_IO_open_wrapper (filename , "rb" , true );
484484}
485485
486486static void * php_libxml_streams_IO_open_write_wrapper (const char * filename )
487487{
488- return php_libxml_streams_IO_open_wrapper (filename , "wb" , 0 );
488+ return php_libxml_streams_IO_open_wrapper (filename , "wb" , false );
489489}
490490
491491static int php_libxml_streams_IO_read (void * context , char * buffer , int len )
@@ -916,7 +916,7 @@ PHP_LIBXML_API void php_libxml_initialize(void)
916916
917917 zend_hash_init (& php_libxml_exports , 0 , NULL , php_libxml_exports_dtor , 1 );
918918
919- php_libxml_initialized = 1 ;
919+ php_libxml_initialized = true ;
920920 }
921921}
922922
@@ -930,7 +930,7 @@ PHP_LIBXML_API void php_libxml_shutdown(void)
930930 zend_hash_destroy (& php_libxml_exports );
931931
932932 xmlSetExternalEntityLoader (php_libxml_default_entity_loader );
933- php_libxml_initialized = 0 ;
933+ php_libxml_initialized = false ;
934934 }
935935}
936936
@@ -962,7 +962,7 @@ static PHP_MINIT_FUNCTION(libxml)
962962
963963 for (sapi_name = supported_sapis ; * sapi_name ; sapi_name ++ ) {
964964 if (strcmp (sapi_module .name , * sapi_name ) == 0 ) {
965- php_libxml_per_request_initialization = 0 ;
965+ php_libxml_per_request_initialization = false ;
966966 break ;
967967 }
968968 }
@@ -1242,7 +1242,7 @@ PHP_FUNCTION(libxml_get_external_entity_loader)
12421242/* }}} */
12431243
12441244/* {{{ Common functions shared by extensions */
1245- int php_libxml_xmlCheckUTF8 (const unsigned char * s )
1245+ bool php_libxml_xmlCheckUTF8 (const unsigned char * s )
12461246{
12471247 size_t i ;
12481248 unsigned char c ;
@@ -1251,21 +1251,21 @@ int php_libxml_xmlCheckUTF8(const unsigned char *s)
12511251 if ((c & 0x80 ) == 0 ) {
12521252 } else if ((c & 0xe0 ) == 0xc0 ) {
12531253 if ((s [i ++ ] & 0xc0 ) != 0x80 ) {
1254- return 0 ;
1254+ return false ;
12551255 }
12561256 } else if ((c & 0xf0 ) == 0xe0 ) {
12571257 if ((s [i ++ ] & 0xc0 ) != 0x80 || (s [i ++ ] & 0xc0 ) != 0x80 ) {
1258- return 0 ;
1258+ return false ;
12591259 }
12601260 } else if ((c & 0xf8 ) == 0xf0 ) {
12611261 if ((s [i ++ ] & 0xc0 ) != 0x80 || (s [i ++ ] & 0xc0 ) != 0x80 || (s [i ++ ] & 0xc0 ) != 0x80 ) {
1262- return 0 ;
1262+ return false ;
12631263 }
12641264 } else {
1265- return 0 ;
1265+ return false ;
12661266 }
12671267 }
1268- return 1 ;
1268+ return true ;
12691269}
12701270
12711271zval * php_libxml_register_export (const zend_class_entry * ce , php_libxml_export_node export_function )
0 commit comments