@@ -673,7 +673,7 @@ static const char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib
673
673
/* }}} */
674
674
675
675
/* {{{ date_format - (gm)date helper */
676
- static zend_string * date_format (const char * format , size_t format_len , timelib_time * t , bool localtime )
676
+ static zend_string * date_format (const char * format , size_t format_len , const timelib_time * t , bool localtime )
677
677
{
678
678
smart_str string = {0 };
679
679
size_t i ;
@@ -845,7 +845,7 @@ static zend_string *date_format(const char *format, size_t format_len, timelib_t
845
845
return string .s ;
846
846
}
847
847
848
- PHPAPI zend_string * php_format_date_obj (const char * format , size_t format_len , php_date_obj * date_obj )
848
+ PHPAPI zend_string * php_format_date_obj (const char * format , size_t format_len , const php_date_obj * date_obj )
849
849
{
850
850
if (!date_obj -> time ) {
851
851
return NULL ;
@@ -2807,7 +2807,7 @@ PHP_METHOD(DateTimeImmutable, createFromTimestamp)
2807
2807
}
2808
2808
/* }}} */
2809
2809
2810
- static bool php_date_initialize_from_hash (php_date_obj * * dateobj , HashTable * myht )
2810
+ static bool php_date_initialize_from_hash (php_date_obj * * dateobj , const HashTable * myht )
2811
2811
{
2812
2812
zval * z_date ;
2813
2813
zval * z_timezone_type ;
@@ -2948,7 +2948,7 @@ PHP_METHOD(DateTimeImmutable, __serialize)
2948
2948
}
2949
2949
/* }}} */
2950
2950
2951
- static bool date_time_is_internal_property (zend_string * name )
2951
+ static bool date_time_is_internal_property (const zend_string * name )
2952
2952
{
2953
2953
if (
2954
2954
zend_string_equals_literal (name , "date" ) ||
@@ -2960,7 +2960,7 @@ static bool date_time_is_internal_property(zend_string *name)
2960
2960
return 0 ;
2961
2961
}
2962
2962
2963
- static void restore_custom_datetime_properties (zval * object , HashTable * myht )
2963
+ static void restore_custom_datetime_properties (zval * object , const HashTable * myht )
2964
2964
{
2965
2965
zend_string * prop_name ;
2966
2966
zval * prop_val ;
@@ -3023,7 +3023,7 @@ static void php_do_date_time_wakeup(INTERNAL_FUNCTION_PARAMETERS, const char *cl
3023
3023
{
3024
3024
zval * object = ZEND_THIS ;
3025
3025
php_date_obj * dateobj ;
3026
- HashTable * myht ;
3026
+ const HashTable * myht ;
3027
3027
3028
3028
ZEND_PARSE_PARAMETERS_NONE ();
3029
3029
@@ -3053,7 +3053,7 @@ PHP_METHOD(DateTimeImmutable, __wakeup)
3053
3053
/* }}} */
3054
3054
3055
3055
/* Helper function used to add an associative array of warnings and errors to a zval */
3056
- static void zval_from_error_container (zval * z , timelib_error_container * error ) /* {{{ */
3056
+ static void zval_from_error_container (zval * z , const timelib_error_container * error ) /* {{{ */
3057
3057
{
3058
3058
int i ;
3059
3059
zval element ;
@@ -3494,7 +3494,7 @@ PHP_METHOD(DateTimeImmutable, sub)
3494
3494
}
3495
3495
/* }}} */
3496
3496
3497
- static void set_timezone_from_timelib_time (php_timezone_obj * tzobj , timelib_time * t )
3497
+ static void set_timezone_from_timelib_time (php_timezone_obj * tzobj , const timelib_time * t )
3498
3498
{
3499
3499
/* Free abbreviation if already set */
3500
3500
if (tzobj -> initialized && tzobj -> type == TIMELIB_ZONETYPE_ABBR ) {
@@ -4053,7 +4053,7 @@ PHP_METHOD(DateTimeZone, __construct)
4053
4053
}
4054
4054
/* }}} */
4055
4055
4056
- static bool php_date_timezone_initialize_from_hash (zval * * return_value , php_timezone_obj * * tzobj , HashTable * myht ) /* {{{ */
4056
+ static bool php_date_timezone_initialize_from_hash (zval * * return_value , php_timezone_obj * * tzobj , const HashTable * myht ) /* {{{ */
4057
4057
{
4058
4058
zval * z_timezone_type ;
4059
4059
@@ -4103,7 +4103,7 @@ PHP_METHOD(DateTimeZone, __wakeup)
4103
4103
{
4104
4104
zval * object = ZEND_THIS ;
4105
4105
php_timezone_obj * tzobj ;
4106
- HashTable * myht ;
4106
+ const HashTable * myht ;
4107
4107
4108
4108
ZEND_PARSE_PARAMETERS_NONE ();
4109
4109
@@ -4138,7 +4138,7 @@ PHP_METHOD(DateTimeZone, __serialize)
4138
4138
}
4139
4139
/* }}} */
4140
4140
4141
- static bool date_timezone_is_internal_property (zend_string * name )
4141
+ static bool date_timezone_is_internal_property (const zend_string * name )
4142
4142
{
4143
4143
if (
4144
4144
zend_string_equals_literal (name , "timezone_type" ) ||
@@ -4149,7 +4149,7 @@ static bool date_timezone_is_internal_property(zend_string *name)
4149
4149
return 0 ;
4150
4150
}
4151
4151
4152
- static void restore_custom_datetimezone_properties (zval * object , HashTable * myht )
4152
+ static void restore_custom_datetimezone_properties (zval * object , const HashTable * myht )
4153
4153
{
4154
4154
zend_string * prop_name ;
4155
4155
zval * prop_val ;
@@ -4413,7 +4413,7 @@ PHP_FUNCTION(timezone_location_get)
4413
4413
}
4414
4414
/* }}} */
4415
4415
4416
- static bool date_interval_initialize (timelib_rel_time * * rt , /* const*/ char * format , size_t format_length ) /* {{{ */
4416
+ static bool date_interval_initialize (timelib_rel_time * * rt , const char * format , size_t format_length ) /* {{{ */
4417
4417
{
4418
4418
timelib_time * b = NULL , * e = NULL ;
4419
4419
timelib_rel_time * p = NULL ;
@@ -4598,10 +4598,10 @@ PHP_METHOD(DateInterval, __construct)
4598
4598
}
4599
4599
/* }}} */
4600
4600
4601
- static void php_date_interval_initialize_from_hash (zval * * return_value , php_interval_obj * * intobj , HashTable * myht ) /* {{{ */
4601
+ static void php_date_interval_initialize_from_hash (zval * * return_value , php_interval_obj * * intobj , const HashTable * myht ) /* {{{ */
4602
4602
{
4603
4603
/* If we have a date_string, use that instead */
4604
- zval * date_str = zend_hash_str_find (myht , "date_string" , strlen ("date_string" ));
4604
+ const zval * date_str = zend_hash_str_find (myht , "date_string" , strlen ("date_string" ));
4605
4605
if (date_str && Z_TYPE_P (date_str ) == IS_STRING ) {
4606
4606
timelib_time * time ;
4607
4607
timelib_error_container * err = NULL ;
@@ -4699,7 +4699,7 @@ static void php_date_interval_initialize_from_hash(zval **return_value, php_inte
4699
4699
PHP_DATE_INTERVAL_READ_PROPERTY ("i" , i , timelib_sll , -1 )
4700
4700
PHP_DATE_INTERVAL_READ_PROPERTY ("s" , s , timelib_sll , -1 )
4701
4701
{
4702
- zval * z_arg = zend_hash_str_find (myht , "f" , sizeof ("f" ) - 1 );
4702
+ const zval * z_arg = zend_hash_str_find (myht , "f" , sizeof ("f" ) - 1 );
4703
4703
if (z_arg ) {
4704
4704
(* intobj )-> diff -> us = zend_dval_to_lval (zval_get_double (z_arg ) * 1000000.0 );
4705
4705
}
@@ -4714,7 +4714,7 @@ static void php_date_interval_initialize_from_hash(zval **return_value, php_inte
4714
4714
PHP_DATE_INTERVAL_READ_PROPERTY ("have_weekday_relative" , have_weekday_relative , unsigned int , 0 );
4715
4715
PHP_DATE_INTERVAL_READ_PROPERTY ("have_special_relative" , have_special_relative , unsigned int , 0 );
4716
4716
{
4717
- zval * z_arg = zend_hash_str_find (myht , "civil_or_wall" , sizeof ("civil_or_wall" ) - 1 );
4717
+ const zval * z_arg = zend_hash_str_find (myht , "civil_or_wall" , sizeof ("civil_or_wall" ) - 1 );
4718
4718
(* intobj )-> civil_or_wall = PHP_DATE_CIVIL ;
4719
4719
if (z_arg ) {
4720
4720
zend_long val = zval_get_long (z_arg );
@@ -4761,7 +4761,7 @@ PHP_METHOD(DateInterval, __serialize)
4761
4761
}
4762
4762
/* }}} */
4763
4763
4764
- static bool date_interval_is_internal_property (zend_string * name )
4764
+ static bool date_interval_is_internal_property (const zend_string * name )
4765
4765
{
4766
4766
if (
4767
4767
zend_string_equals_literal (name , "date_string" ) ||
@@ -4781,7 +4781,7 @@ static bool date_interval_is_internal_property(zend_string *name)
4781
4781
return 0 ;
4782
4782
}
4783
4783
4784
- static void restore_custom_dateinterval_properties (zval * object , HashTable * myht )
4784
+ static void restore_custom_dateinterval_properties (zval * object , const HashTable * myht )
4785
4785
{
4786
4786
zend_string * prop_name ;
4787
4787
zval * prop_val ;
@@ -4818,7 +4818,7 @@ PHP_METHOD(DateInterval, __wakeup)
4818
4818
{
4819
4819
zval * object = ZEND_THIS ;
4820
4820
php_interval_obj * intobj ;
4821
- HashTable * myht ;
4821
+ const HashTable * myht ;
4822
4822
4823
4823
ZEND_PARSE_PARAMETERS_NONE ();
4824
4824
@@ -4910,7 +4910,7 @@ PHP_METHOD(DateInterval, createFromDateString)
4910
4910
/* }}} */
4911
4911
4912
4912
/* {{{ date_interval_format - */
4913
- static zend_string * date_interval_format (char * format , size_t format_len , timelib_rel_time * t )
4913
+ static zend_string * date_interval_format (const char * format , size_t format_len , timelib_rel_time * t )
4914
4914
{
4915
4915
smart_str string = {0 };
4916
4916
size_t i ;
@@ -4984,7 +4984,7 @@ PHP_FUNCTION(date_interval_format)
4984
4984
{
4985
4985
zval * object ;
4986
4986
php_interval_obj * diobj ;
4987
- char * format ;
4987
+ const char * format ;
4988
4988
size_t format_len ;
4989
4989
4990
4990
if (zend_parse_method_parameters (ZEND_NUM_ARGS (), getThis (), "Os" , & object , date_ce_interval , & format , & format_len ) == FAILURE ) {
@@ -4997,7 +4997,7 @@ PHP_FUNCTION(date_interval_format)
4997
4997
}
4998
4998
/* }}} */
4999
4999
5000
- static bool date_period_initialize (timelib_time * * st , timelib_time * * et , timelib_rel_time * * d , zend_long * recurrences , /* const*/ char * format , size_t format_length ) /* {{{ */
5000
+ static bool date_period_initialize (timelib_time * * st , timelib_time * * et , timelib_rel_time * * d , zend_long * recurrences , const char * format , size_t format_length ) /* {{{ */
5001
5001
{
5002
5002
timelib_time * b = NULL , * e = NULL ;
5003
5003
timelib_rel_time * p = NULL ;
@@ -5030,7 +5030,7 @@ static bool date_period_initialize(timelib_time **st, timelib_time **et, timelib
5030
5030
return retval ;
5031
5031
} /* }}} */
5032
5032
5033
- static bool date_period_init_iso8601_string (php_period_obj * dpobj , zend_class_entry * base_ce , char * isostr , size_t isostr_len , zend_long options , zend_long * recurrences )
5033
+ static bool date_period_init_iso8601_string (php_period_obj * dpobj , zend_class_entry * base_ce , const char * isostr , size_t isostr_len , zend_long options , zend_long * recurrences )
5034
5034
{
5035
5035
if (!date_period_initialize (& (dpobj -> start ), & (dpobj -> end ), & (dpobj -> interval ), recurrences , isostr , isostr_len )) {
5036
5036
return false;
@@ -5291,7 +5291,7 @@ PHP_METHOD(DatePeriod, getIterator)
5291
5291
zend_create_internal_iterator_zval (return_value , ZEND_THIS );
5292
5292
}
5293
5293
5294
- static int check_id_allowed (char * id , zend_long what ) /* {{{ */
5294
+ static int check_id_allowed (const char * id , zend_long what ) /* {{{ */
5295
5295
{
5296
5296
if ((what & PHP_DATE_TIMEZONE_GROUP_AFRICA ) && strncasecmp (id , "Africa/" , 7 ) == 0 ) return 1 ;
5297
5297
if ((what & PHP_DATE_TIMEZONE_GROUP_AMERICA ) && strncasecmp (id , "America/" , 8 ) == 0 ) return 1 ;
@@ -5697,7 +5697,7 @@ static void date_period_object_to_hash(php_period_obj *period_obj, HashTable *pr
5697
5697
zend_hash_str_update (props , "include_end_date" , sizeof ("include_end_date" )- 1 , & zv );
5698
5698
}
5699
5699
5700
- static bool php_date_period_initialize_from_hash (php_period_obj * period_obj , HashTable * myht ) /* {{{ */
5700
+ static bool php_date_period_initialize_from_hash (php_period_obj * period_obj , const HashTable * myht ) /* {{{ */
5701
5701
{
5702
5702
zval * ht_entry ;
5703
5703
@@ -5860,7 +5860,7 @@ PHP_METHOD(DatePeriod, __serialize)
5860
5860
* Common for date_period_read_property(), date_period_write_property(), and
5861
5861
* restore_custom_dateperiod_properties functions
5862
5862
*/
5863
- static bool date_period_is_internal_property (zend_string * name )
5863
+ static bool date_period_is_internal_property (const zend_string * name )
5864
5864
{
5865
5865
if (
5866
5866
zend_string_equals_literal (name , "start" ) ||
@@ -5877,7 +5877,7 @@ static bool date_period_is_internal_property(zend_string *name)
5877
5877
}
5878
5878
/* }}} */
5879
5879
5880
- static void restore_custom_dateperiod_properties (zval * object , HashTable * myht )
5880
+ static void restore_custom_dateperiod_properties (zval * object , const HashTable * myht )
5881
5881
{
5882
5882
zend_string * prop_name ;
5883
5883
zval * prop_val ;
@@ -5916,7 +5916,7 @@ PHP_METHOD(DatePeriod, __wakeup)
5916
5916
{
5917
5917
zval * object = ZEND_THIS ;
5918
5918
php_period_obj * period_obj ;
5919
- HashTable * myht ;
5919
+ const HashTable * myht ;
5920
5920
5921
5921
ZEND_PARSE_PARAMETERS_NONE ();
5922
5922
0 commit comments