@@ -62,7 +62,7 @@ static zif_handler orig_file_exists = NULL;
6262static zif_handler orig_is_file = NULL ;
6363static zif_handler orig_is_readable = NULL ;
6464
65- static int validate_api_restriction (void )
65+ static bool validate_api_restriction (void )
6666{
6767 if (ZCG (accel_directives ).restrict_api && * ZCG (accel_directives ).restrict_api ) {
6868 size_t len = strlen (ZCG (accel_directives ).restrict_api );
@@ -71,10 +71,10 @@ static int validate_api_restriction(void)
7171 strlen (SG (request_info ).path_translated ) < len ||
7272 memcmp (SG (request_info ).path_translated , ZCG (accel_directives ).restrict_api , len ) != 0 ) {
7373 zend_error (E_WARNING , ACCELERATOR_PRODUCT_NAME " API is restricted by \"restrict_api\" configuration directive" );
74- return 0 ;
74+ return false ;
7575 }
7676 }
77- return 1 ;
77+ return true ;
7878}
7979
8080static ZEND_INI_MH (OnUpdateMemoryConsumption )
@@ -178,8 +178,8 @@ static ZEND_INI_MH(OnEnable)
178178 }
179179 return FAILURE ;
180180 } else {
181- * p = 0 ;
182- ZCG (accelerator_enabled ) = 0 ;
181+ * p = false ;
182+ ZCG (accelerator_enabled ) = false ;
183183 return SUCCESS ;
184184 }
185185 }
@@ -363,7 +363,7 @@ ZEND_INI_BEGIN()
363363#endif
364364ZEND_INI_END ()
365365
366- static int filename_is_in_cache (zend_string * filename )
366+ static bool filename_is_in_cache (zend_string * filename )
367367{
368368 zend_string * key ;
369369
@@ -373,27 +373,26 @@ static int filename_is_in_cache(zend_string *filename)
373373 if (persistent_script && !persistent_script -> corrupted ) {
374374 if (ZCG (accel_directives ).validate_timestamps ) {
375375 zend_file_handle handle ;
376- int ret ;
376+ bool ret ;
377377
378378 zend_stream_init_filename_ex (& handle , filename );
379- ret = validate_timestamp_and_record_ex (persistent_script , & handle ) == SUCCESS
380- ? 1 : 0 ;
379+ ret = validate_timestamp_and_record_ex (persistent_script , & handle ) == SUCCESS ;
381380 zend_destroy_file_handle (& handle );
382381 return ret ;
383382 }
384383
385- return 1 ;
384+ return true ;
386385 }
387386 }
388387
389- return 0 ;
388+ return false ;
390389}
391390
392- static int filename_is_in_file_cache (zend_string * filename )
391+ static bool filename_is_in_file_cache (zend_string * filename )
393392{
394393 zend_string * realpath = zend_resolve_path (filename );
395394 if (!realpath ) {
396- return 0 ;
395+ return false ;
397396 }
398397
399398 zend_file_handle handle ;
@@ -406,7 +405,7 @@ static int filename_is_in_file_cache(zend_string *filename)
406405 return result != NULL ;
407406}
408407
409- static int accel_file_in_cache (INTERNAL_FUNCTION_PARAMETERS )
408+ static bool accel_file_in_cache (INTERNAL_FUNCTION_PARAMETERS )
410409{
411410 if (ZEND_NUM_ARGS () == 1 ) {
412411 zval * zv = ZEND_CALL_ARG (execute_data , 1 );
@@ -415,7 +414,7 @@ static int accel_file_in_cache(INTERNAL_FUNCTION_PARAMETERS)
415414 return filename_is_in_cache (Z_STR_P (zv ));
416415 }
417416 }
418- return 0 ;
417+ return false ;
419418}
420419
421420static ZEND_NAMED_FUNCTION (accel_file_exists )
0 commit comments