@@ -105,7 +105,7 @@ void zend_accel_move_user_classes(HashTable *src, uint32_t count, zend_script *s
105105{
106106 Bucket * p , * end ;
107107 HashTable * dst ;
108- zend_string * filename ;
108+ const zend_string * filename ;
109109 dtor_func_t orig_dtor ;
110110 zend_class_entry * ce ;
111111
@@ -132,10 +132,10 @@ void zend_accel_move_user_classes(HashTable *src, uint32_t count, zend_script *s
132132 src -> pDestructor = orig_dtor ;
133133}
134134
135- static zend_always_inline void _zend_accel_function_hash_copy (HashTable * target , HashTable * source , bool call_observers )
135+ static zend_always_inline void _zend_accel_function_hash_copy (HashTable * target , const HashTable * source , bool call_observers )
136136{
137137 zend_function * function1 , * function2 ;
138- Bucket * p , * end ;
138+ const Bucket * p , * end ;
139139 zval * t ;
140140
141141 zend_hash_extend (target , target -> nNumUsed + source -> nNumUsed , 0 );
@@ -174,20 +174,20 @@ static zend_always_inline void _zend_accel_function_hash_copy(HashTable *target,
174174 }
175175}
176176
177- static zend_always_inline void zend_accel_function_hash_copy (HashTable * target , HashTable * source )
177+ static zend_always_inline void zend_accel_function_hash_copy (HashTable * target , const HashTable * source )
178178{
179179 _zend_accel_function_hash_copy (target , source , false);
180180}
181181
182- static zend_never_inline void zend_accel_function_hash_copy_notify (HashTable * target , HashTable * source )
182+ static zend_never_inline void zend_accel_function_hash_copy_notify (HashTable * target , const HashTable * source )
183183{
184184 _zend_accel_function_hash_copy (target , source , true);
185185}
186186
187- static zend_always_inline void _zend_accel_class_hash_copy (HashTable * target , HashTable * source , bool call_observers )
187+ static zend_always_inline void _zend_accel_class_hash_copy (HashTable * target , const HashTable * source , bool call_observers )
188188{
189- Bucket * p , * end ;
190- zval * t ;
189+ const Bucket * p , * end ;
190+ const zval * t ;
191191
192192 zend_hash_extend (target , target -> nNumUsed + source -> nNumUsed , 0 );
193193 p = source -> arData ;
@@ -209,7 +209,7 @@ static zend_always_inline void _zend_accel_class_hash_copy(HashTable *target, Ha
209209 * value. */
210210 continue ;
211211 } else if (UNEXPECTED (!ZCG (accel_directives ).ignore_dups )) {
212- zend_class_entry * ce1 = Z_PTR (p -> val );
212+ const zend_class_entry * ce1 = Z_PTR (p -> val );
213213 if (!(ce1 -> ce_flags & ZEND_ACC_ANON_CLASS )) {
214214 CG (in_compilation ) = 1 ;
215215 zend_set_compiled_filename (ce1 -> info .user .filename );
@@ -235,25 +235,25 @@ static zend_always_inline void _zend_accel_class_hash_copy(HashTable *target, Ha
235235 target -> nInternalPointer = 0 ;
236236}
237237
238- static zend_always_inline void zend_accel_class_hash_copy (HashTable * target , HashTable * source )
238+ static zend_always_inline void zend_accel_class_hash_copy (HashTable * target , const HashTable * source )
239239{
240240 _zend_accel_class_hash_copy (target , source , false);
241241}
242242
243- static zend_never_inline void zend_accel_class_hash_copy_notify (HashTable * target , HashTable * source )
243+ static zend_never_inline void zend_accel_class_hash_copy_notify (HashTable * target , const HashTable * source )
244244{
245245 _zend_accel_class_hash_copy (target , source , true);
246246}
247247
248248void zend_accel_build_delayed_early_binding_list (zend_persistent_script * persistent_script )
249249{
250- zend_op_array * op_array = & persistent_script -> script .main_op_array ;
250+ const zend_op_array * op_array = & persistent_script -> script .main_op_array ;
251251 if (!(op_array -> fn_flags & ZEND_ACC_EARLY_BINDING )) {
252252 return ;
253253 }
254254
255- zend_op * end = op_array -> opcodes + op_array -> last ;
256- for (zend_op * opline = op_array -> opcodes ; opline < end ; opline ++ ) {
255+ const zend_op * end = op_array -> opcodes + op_array -> last ;
256+ for (const zend_op * opline = op_array -> opcodes ; opline < end ; opline ++ ) {
257257 if (opline -> opcode == ZEND_DECLARE_CLASS_DELAYED ) {
258258 persistent_script -> num_early_bindings ++ ;
259259 }
@@ -264,7 +264,7 @@ void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persist
264264
265265 for (zend_op * opline = op_array -> opcodes ; opline < end ; opline ++ ) {
266266 if (opline -> opcode == ZEND_DECLARE_CLASS_DELAYED ) {
267- zval * lcname = RT_CONSTANT (opline , opline -> op1 );
267+ const zval * lcname = RT_CONSTANT (opline , opline -> op1 );
268268 early_binding -> lcname = zend_string_copy (Z_STR_P (lcname ));
269269 early_binding -> rtd_key = zend_string_copy (Z_STR_P (lcname + 1 ));
270270 early_binding -> lc_parent_name =
@@ -275,19 +275,19 @@ void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persist
275275 }
276276}
277277
278- void zend_accel_finalize_delayed_early_binding_list (zend_persistent_script * persistent_script )
278+ void zend_accel_finalize_delayed_early_binding_list (const zend_persistent_script * persistent_script )
279279{
280280 if (!persistent_script -> num_early_bindings ) {
281281 return ;
282282 }
283283
284284 zend_early_binding * early_binding = persistent_script -> early_bindings ;
285- zend_early_binding * early_binding_end = early_binding + persistent_script -> num_early_bindings ;
286- zend_op_array * op_array = & persistent_script -> script .main_op_array ;
287- zend_op * opline_end = op_array -> opcodes + op_array -> last ;
285+ const zend_early_binding * early_binding_end = early_binding + persistent_script -> num_early_bindings ;
286+ const zend_op_array * op_array = & persistent_script -> script .main_op_array ;
287+ const zend_op * opline_end = op_array -> opcodes + op_array -> last ;
288288 for (zend_op * opline = op_array -> opcodes ; opline < opline_end ; opline ++ ) {
289289 if (opline -> opcode == ZEND_DECLARE_CLASS_DELAYED ) {
290- zend_string * rtd_key = Z_STR_P (RT_CONSTANT (opline , opline -> op1 ) + 1 );
290+ const zend_string * rtd_key = Z_STR_P (RT_CONSTANT (opline , opline -> op1 ) + 1 );
291291 /* Skip early_binding entries that don't match, maybe their DECLARE_CLASS_DELAYED
292292 * was optimized away. */
293293 while (!zend_string_equals (early_binding -> rtd_key , rtd_key )) {
@@ -310,7 +310,7 @@ void zend_accel_free_delayed_early_binding_list(zend_persistent_script *persiste
310310{
311311 if (persistent_script -> num_early_bindings ) {
312312 for (uint32_t i = 0 ; i < persistent_script -> num_early_bindings ; i ++ ) {
313- zend_early_binding * early_binding = & persistent_script -> early_bindings [i ];
313+ const zend_early_binding * early_binding = & persistent_script -> early_bindings [i ];
314314 zend_string_release (early_binding -> lcname );
315315 zend_string_release (early_binding -> rtd_key );
316316 zend_string_release (early_binding -> lc_parent_name );
@@ -322,7 +322,7 @@ void zend_accel_free_delayed_early_binding_list(zend_persistent_script *persiste
322322}
323323
324324static void zend_accel_do_delayed_early_binding (
325- zend_persistent_script * persistent_script , zend_op_array * op_array )
325+ const zend_persistent_script * persistent_script , zend_op_array * op_array )
326326{
327327 ZEND_ASSERT (!ZEND_MAP_PTR (op_array -> run_time_cache ));
328328 ZEND_ASSERT (op_array -> fn_flags & ZEND_ACC_HEAP_RT_CACHE );
@@ -336,7 +336,7 @@ static void zend_accel_do_delayed_early_binding(
336336 CG (compiled_filename ) = persistent_script -> script .filename ;
337337 CG (in_compilation ) = 1 ;
338338 for (uint32_t i = 0 ; i < persistent_script -> num_early_bindings ; i ++ ) {
339- zend_early_binding * early_binding = & persistent_script -> early_bindings [i ];
339+ const zend_early_binding * early_binding = & persistent_script -> early_bindings [i ];
340340 zend_class_entry * ce = zend_hash_find_ex_ptr (EG (class_table ), early_binding -> lcname , 1 );
341341 if (!ce ) {
342342 zval * zv = zend_hash_find_known_hash (EG (class_table ), early_binding -> rtd_key );
@@ -448,7 +448,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
448448#define ADLER32_SCALAR_DO8 (buf , i ) ADLER32_SCALAR_DO4(buf, i); ADLER32_SCALAR_DO4(buf, i + 4);
449449#define ADLER32_SCALAR_DO16 (buf ) ADLER32_SCALAR_DO8(buf, 0); ADLER32_SCALAR_DO8(buf, 8);
450450
451- static zend_always_inline void adler32_do16_loop (unsigned char * buf , unsigned char * end , unsigned int * s1_out , unsigned int * s2_out )
451+ static zend_always_inline void adler32_do16_loop (unsigned char * buf , const unsigned char * end , unsigned int * s1_out , unsigned int * s2_out )
452452{
453453 unsigned int s1 = * s1_out ;
454454 unsigned int s2 = * s2_out ;
0 commit comments