@@ -458,7 +458,7 @@ PHP_MINFO_FUNCTION(date)
458
458
/* }}} */
459
459
460
460
/* {{{ Timezone Cache functions */
461
- static timelib_tzinfo * php_date_parse_tzfile (char * formal_tzname , const timelib_tzdb * tzdb )
461
+ static timelib_tzinfo * php_date_parse_tzfile (const char * formal_tzname , const timelib_tzdb * tzdb )
462
462
{
463
463
timelib_tzinfo * tzi ;
464
464
int dummy_error_code ;
@@ -479,7 +479,7 @@ static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_
479
479
return tzi ;
480
480
}
481
481
482
- timelib_tzinfo * php_date_parse_tzfile_wrapper (char * formal_tzname , const timelib_tzdb * tzdb , int * dummy_error_code )
482
+ timelib_tzinfo * php_date_parse_tzfile_wrapper (const char * formal_tzname , const timelib_tzdb * tzdb , int * dummy_error_code )
483
483
{
484
484
return php_date_parse_tzfile (formal_tzname , tzdb );
485
485
}
@@ -987,7 +987,7 @@ PHPAPI zend_long php_parse_date(const char *string, zend_long *now)
987
987
int error2 ;
988
988
zend_long retval ;
989
989
990
- parsed_time = timelib_strtotime (( char * ) string , strlen (string ), & error , DATE_TIMEZONEDB , php_date_parse_tzfile_wrapper );
990
+ parsed_time = timelib_strtotime (string , strlen (string ), & error , DATE_TIMEZONEDB , php_date_parse_tzfile_wrapper );
991
991
if (error -> error_count ) {
992
992
timelib_time_dtor (parsed_time );
993
993
timelib_error_container_dtor (error );
@@ -2197,15 +2197,13 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, const char *time_str, size
2197
2197
if (time_str_len == 0 ) {
2198
2198
time_str = "" ;
2199
2199
}
2200
- // TODO: drop this const casts
2201
- dateobj -> time = timelib_parse_from_format ((char * ) format , (char * ) time_str , time_str_len , & err , DATE_TIMEZONEDB , php_date_parse_tzfile_wrapper );
2200
+ dateobj -> time = timelib_parse_from_format (format , time_str , time_str_len , & err , DATE_TIMEZONEDB , php_date_parse_tzfile_wrapper );
2202
2201
} else {
2203
2202
if (time_str_len == 0 ) {
2204
2203
time_str = "now" ;
2205
2204
time_str_len = sizeof ("now" ) - 1 ;
2206
2205
}
2207
- // TODO: drop this const casts
2208
- dateobj -> time = timelib_strtotime ((char * ) time_str , time_str_len , & err , DATE_TIMEZONEDB , php_date_parse_tzfile_wrapper );
2206
+ dateobj -> time = timelib_strtotime (time_str , time_str_len , & err , DATE_TIMEZONEDB , php_date_parse_tzfile_wrapper );
2209
2207
}
2210
2208
2211
2209
/* update last errors and warnings */
@@ -3349,11 +3347,11 @@ PHP_FUNCTION(date_diff)
3349
3347
}
3350
3348
/* }}} */
3351
3349
3352
- static int timezone_initialize (php_timezone_obj * tzobj , /* const*/ char * tz , size_t tz_len ) /* {{{ */
3350
+ static int timezone_initialize (php_timezone_obj * tzobj , const char * tz , size_t tz_len ) /* {{{ */
3353
3351
{
3354
3352
timelib_time * dummy_t = ecalloc (1 , sizeof (timelib_time ));
3355
3353
int dst , not_found ;
3356
- char * orig_tz = tz ;
3354
+ const char * orig_tz = tz ;
3357
3355
3358
3356
if (strlen (tz ) != tz_len ) {
3359
3357
php_error_docref (NULL , E_WARNING , "Timezone must not contain null bytes" );
0 commit comments