@@ -965,14 +965,14 @@ ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC)
965965}
966966
967967
968- ZEND_API int add_assoc_function (zval * arg , char * key , void (* function_ptr )(INTERNAL_FUNCTION_PARAMETERS ))
968+ ZEND_API int add_assoc_function (zval * arg , const char * key , void (* function_ptr )(INTERNAL_FUNCTION_PARAMETERS ))
969969{
970970 zend_error (E_WARNING , "add_assoc_function() is no longer supported" );
971971 return FAILURE ;
972972}
973973
974974
975- ZEND_API int add_assoc_long_ex (zval * arg , char * key , uint key_len , long n )
975+ ZEND_API int add_assoc_long_ex (zval * arg , const char * key , uint key_len , long n )
976976{
977977 zval * tmp ;
978978
@@ -982,7 +982,7 @@ ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n)
982982 return zend_symtable_update (Z_ARRVAL_P (arg ), key , key_len , (void * ) & tmp , sizeof (zval * ), NULL );
983983}
984984
985- ZEND_API int add_assoc_null_ex (zval * arg , char * key , uint key_len )
985+ ZEND_API int add_assoc_null_ex (zval * arg , const char * key , uint key_len )
986986{
987987 zval * tmp ;
988988
@@ -992,7 +992,7 @@ ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len)
992992 return zend_symtable_update (Z_ARRVAL_P (arg ), key , key_len , (void * ) & tmp , sizeof (zval * ), NULL );
993993}
994994
995- ZEND_API int add_assoc_bool_ex (zval * arg , char * key , uint key_len , int b )
995+ ZEND_API int add_assoc_bool_ex (zval * arg , const char * key , uint key_len , int b )
996996{
997997 zval * tmp ;
998998
@@ -1002,7 +1002,7 @@ ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b)
10021002 return zend_symtable_update (Z_ARRVAL_P (arg ), key , key_len , (void * ) & tmp , sizeof (zval * ), NULL );
10031003}
10041004
1005- ZEND_API int add_assoc_resource_ex (zval * arg , char * key , uint key_len , int r )
1005+ ZEND_API int add_assoc_resource_ex (zval * arg , const char * key , uint key_len , int r )
10061006{
10071007 zval * tmp ;
10081008
@@ -1013,7 +1013,7 @@ ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r)
10131013}
10141014
10151015
1016- ZEND_API int add_assoc_double_ex (zval * arg , char * key , uint key_len , double d )
1016+ ZEND_API int add_assoc_double_ex (zval * arg , const char * key , uint key_len , double d )
10171017{
10181018 zval * tmp ;
10191019
@@ -1024,7 +1024,7 @@ ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d)
10241024}
10251025
10261026
1027- ZEND_API int add_assoc_string_ex (zval * arg , char * key , uint key_len , char * str , int duplicate )
1027+ ZEND_API int add_assoc_string_ex (zval * arg , const char * key , uint key_len , char * str , int duplicate )
10281028{
10291029 zval * tmp ;
10301030
@@ -1035,7 +1035,7 @@ ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str,
10351035}
10361036
10371037
1038- ZEND_API int add_assoc_stringl_ex (zval * arg , char * key , uint key_len , char * str , uint length , int duplicate )
1038+ ZEND_API int add_assoc_stringl_ex (zval * arg , const char * key , uint key_len , char * str , uint length , int duplicate )
10391039{
10401040 zval * tmp ;
10411041
@@ -1045,7 +1045,7 @@ ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str,
10451045 return zend_symtable_update (Z_ARRVAL_P (arg ), key , key_len , (void * ) & tmp , sizeof (zval * ), NULL );
10461046}
10471047
1048- ZEND_API int add_assoc_zval_ex (zval * arg , char * key , uint key_len , zval * value )
1048+ ZEND_API int add_assoc_zval_ex (zval * arg , const char * key , uint key_len , zval * value )
10491049{
10501050 return zend_symtable_update (Z_ARRVAL_P (arg ), key , key_len , (void * ) & value , sizeof (zval * ), NULL );
10511051}
@@ -1105,7 +1105,7 @@ ZEND_API int add_index_double(zval *arg, ulong index, double d)
11051105}
11061106
11071107
1108- ZEND_API int add_index_string (zval * arg , ulong index , char * str , int duplicate )
1108+ ZEND_API int add_index_string (zval * arg , ulong index , const char * str , int duplicate )
11091109{
11101110 zval * tmp ;
11111111
@@ -1116,7 +1116,7 @@ ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate)
11161116}
11171117
11181118
1119- ZEND_API int add_index_stringl (zval * arg , ulong index , char * str , uint length , int duplicate )
1119+ ZEND_API int add_index_stringl (zval * arg , ulong index , const char * str , uint length , int duplicate )
11201120{
11211121 zval * tmp ;
11221122
@@ -1188,7 +1188,7 @@ ZEND_API int add_next_index_double(zval *arg, double d)
11881188}
11891189
11901190
1191- ZEND_API int add_next_index_string (zval * arg , char * str , int duplicate )
1191+ ZEND_API int add_next_index_string (zval * arg , const char * str , int duplicate )
11921192{
11931193 zval * tmp ;
11941194
@@ -1199,7 +1199,7 @@ ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate)
11991199}
12001200
12011201
1202- ZEND_API int add_next_index_stringl (zval * arg , char * str , uint length , int duplicate )
1202+ ZEND_API int add_next_index_stringl (zval * arg , const char * str , uint length , int duplicate )
12031203{
12041204 zval * tmp ;
12051205
@@ -1216,7 +1216,7 @@ ZEND_API int add_next_index_zval(zval *arg, zval *value)
12161216}
12171217
12181218
1219- ZEND_API int add_get_assoc_string_ex (zval * arg , char * key , uint key_len , char * str , void * * dest , int duplicate )
1219+ ZEND_API int add_get_assoc_string_ex (zval * arg , const char * key , uint key_len , const char * str , void * * dest , int duplicate )
12201220{
12211221 zval * tmp ;
12221222
@@ -1227,7 +1227,7 @@ ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *s
12271227}
12281228
12291229
1230- ZEND_API int add_get_assoc_stringl_ex (zval * arg , char * key , uint key_len , char * str , uint length , void * * dest , int duplicate )
1230+ ZEND_API int add_get_assoc_stringl_ex (zval * arg , const char * key , uint key_len , const char * str , uint length , void * * dest , int duplicate )
12311231{
12321232 zval * tmp ;
12331233
@@ -1260,7 +1260,7 @@ ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest)
12601260}
12611261
12621262
1263- ZEND_API int add_get_index_string (zval * arg , ulong index , char * str , void * * dest , int duplicate )
1263+ ZEND_API int add_get_index_string (zval * arg , ulong index , const char * str , void * * dest , int duplicate )
12641264{
12651265 zval * tmp ;
12661266
@@ -1271,7 +1271,7 @@ ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest
12711271}
12721272
12731273
1274- ZEND_API int add_get_index_stringl (zval * arg , ulong index , char * str , uint length , void * * dest , int duplicate )
1274+ ZEND_API int add_get_index_stringl (zval * arg , ulong index , const char * str , uint length , void * * dest , int duplicate )
12751275{
12761276 zval * tmp ;
12771277
@@ -1427,7 +1427,7 @@ ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC)
14271427
14281428 /* Check module dependencies */
14291429 if (module -> deps ) {
1430- zend_module_dep * dep = module -> deps ;
1430+ const zend_module_dep * dep = module -> deps ;
14311431
14321432 while (dep -> name ) {
14331433 if (dep -> type == MODULE_DEP_REQUIRED ) {
@@ -1485,7 +1485,7 @@ static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func
14851485try_again :
14861486 m = (zend_module_entry * )(* b1 )-> pData ;
14871487 if (!m -> module_started && m -> deps ) {
1488- zend_module_dep * dep = m -> deps ;
1488+ const zend_module_dep * dep = m -> deps ;
14891489 while (dep -> name ) {
14901490 if (dep -> type == MODULE_DEP_REQUIRED || dep -> type == MODULE_DEP_OPTIONAL ) {
14911491 b2 = b1 + 1 ;
@@ -1530,7 +1530,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
15301530
15311531 /* Check module dependencies */
15321532 if (module -> deps ) {
1533- zend_module_dep * dep = module -> deps ;
1533+ const zend_module_dep * dep = module -> deps ;
15341534
15351535 while (dep -> name ) {
15361536 if (dep -> type == MODULE_DEP_CONFLICTS ) {
@@ -1627,9 +1627,9 @@ ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_
16271627}
16281628
16291629/* registers all functions in *library_functions in the function hash */
1630- ZEND_API int zend_register_functions (zend_class_entry * scope , zend_function_entry * functions , HashTable * function_table , int type TSRMLS_DC )
1630+ ZEND_API int zend_register_functions (zend_class_entry * scope , const zend_function_entry * functions , HashTable * function_table , int type TSRMLS_DC )
16311631{
1632- zend_function_entry * ptr = functions ;
1632+ const zend_function_entry * ptr = functions ;
16331633 zend_function function , * reg_function ;
16341634 zend_internal_function * internal_function = (zend_internal_function * )& function ;
16351635 int count = 0 , unload = 0 ;
@@ -1660,11 +1660,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
16601660
16611661 while (ptr -> fname ) {
16621662 internal_function -> handler = ptr -> handler ;
1663- internal_function -> function_name = ptr -> fname ;
1663+ internal_function -> function_name = ( char * ) ptr -> fname ;
16641664 internal_function -> scope = scope ;
16651665 internal_function -> prototype = NULL ;
16661666 if (ptr -> arg_info ) {
1667- internal_function -> arg_info = ptr -> arg_info + 1 ;
1667+ internal_function -> arg_info = ( zend_arg_info * ) ptr -> arg_info + 1 ;
16681668 internal_function -> num_args = ptr -> num_args ;
16691669 /* Currently you cannot denote that the function can accept less arguments than num_args */
16701670 if (ptr -> arg_info [0 ].required_num_args == -1 ) {
@@ -1857,9 +1857,9 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
18571857/* count=-1 means erase all functions, otherwise,
18581858 * erase the first count functions
18591859 */
1860- ZEND_API void zend_unregister_functions (zend_function_entry * functions , int count , HashTable * function_table TSRMLS_DC )
1860+ ZEND_API void zend_unregister_functions (const zend_function_entry * functions , int count , HashTable * function_table TSRMLS_DC )
18611861{
1862- zend_function_entry * ptr = functions ;
1862+ const zend_function_entry * ptr = functions ;
18631863 int i = 0 ;
18641864 HashTable * target_function_table = function_table ;
18651865
@@ -2112,7 +2112,7 @@ static zend_object_value display_disabled_class(zend_class_entry *class_type TSR
21122112 return retval ;
21132113}
21142114
2115- static zend_function_entry disabled_class_new [] = {
2115+ static const zend_function_entry disabled_class_new [] = {
21162116 { NULL , NULL , NULL }
21172117};
21182118
@@ -2486,7 +2486,7 @@ ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *f
24862486}
24872487
24882488
2489- ZEND_API char * zend_get_module_version (char * module_name )
2489+ ZEND_API const char * zend_get_module_version (const char * module_name )
24902490{
24912491 char * lname ;
24922492 int name_len = strlen (module_name );
0 commit comments