diff options
author | Sascha Schumann <sas@php.net> | 1999-05-30 13:28:56 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 1999-05-30 13:28:56 +0000 |
commit | 88029643d05a4ea1f60c8856e857ea63802fb136 (patch) | |
tree | b23ee8d509a0df027ba49d19bdd13a3366860d33 /Zend | |
parent | 31da7331fe0704d6b2c6a2961ef5e09c23018417 (diff) | |
download | php-git-88029643d05a4ea1f60c8856e857ea63802fb136.tar.gz |
* fix some casts
* introduce unary_op_type - cleaner than casting data voids to function ptrs
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_alloc.c | 8 | ||||
-rw-r--r-- | Zend/zend_compile.h | 3 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 2 | ||||
-rw-r--r-- | Zend/zend_indent.c | 2 | ||||
-rw-r--r-- | Zend/zend_opcode.c | 8 |
5 files changed, 12 insertions, 11 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 8f022e1325..eec6b69daa 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -114,7 +114,7 @@ ZEND_API void *_emalloc(size_t size) } if (!p) { - fprintf(stderr,"FATAL: emalloc(): Unable to allocate %d bytes\n", size); + fprintf(stderr,"FATAL: emalloc(): Unable to allocate %ld bytes\n", (long) size); exit(1); HANDLE_UNBLOCK_INTERRUPTIONS(); return (void *)p; @@ -218,7 +218,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size) REMOVE_POINTER_FROM_LIST(p); p = (mem_header *) realloc(p,sizeof(mem_header)+size+PLATFORM_PADDING+END_ALIGNMENT(size)+END_MAGIC_SIZE); if (!p) { - fprintf(stderr,"FATAL: erealloc(): Unable to allocate %d bytes\n", size); + fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size); HANDLE_UNBLOCK_INTERRUPTIONS(); zend_bailout(); ADD_POINTER_TO_LIST(orig); @@ -359,7 +359,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache) /* flush old leak */ if (leak_count>0) { if (!silent && leak_count>1) { - zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (leak_count-1)); + zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (long) (leak_count-1)); } leak_count=0; total_bytes=0; @@ -384,7 +384,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache) } #if ZEND_DEBUG if (!silent && leak_count>1) { - zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (leak_count-1)); + zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (long) (leak_count-1)); } if (had_leaks) { ELS_FETCH(); diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index a439e352fe..4439d16c17 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -219,7 +219,8 @@ void fetch_array_begin(znode *result, znode *varname, znode *first_dim CLS_DC); void fetch_array_dim(znode *result, znode *parent, znode *dim CLS_DC); void do_print(znode *result, znode *arg CLS_DC); void do_echo(znode *arg CLS_DC); -ZEND_API void *get_unary_op(int opcode); +typedef int (*unary_op_type)(zval *, zval *); +ZEND_API unary_op_type get_unary_op(int opcode); ZEND_API void *get_binary_op(int opcode); void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index fcfcd1445b..d934225bfd 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -306,7 +306,7 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n zend_ptr_stack_push(&EG(argument_stack), param); } - zend_ptr_stack_push(&EG(argument_stack), (void *) param_count); + zend_ptr_stack_push(&EG(argument_stack), (void *) (long) param_count); var_uninit(retval); if (function_state.function->type == ZEND_USER_FUNCTION) { diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c index 3c2ff59786..f654fd4193 100644 --- a/Zend/zend_indent.c +++ b/Zend/zend_indent.c @@ -38,7 +38,7 @@ static void handle_whitespace(int *emit_whitespace) for (c=0; c<128; c++) { if (emit_whitespace[c]>0) { for (i=0; i<emit_whitespace[c]; i++) { - zend_write(&c, 1); + zend_write((char *) &c, 1); } } } diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index c1b93a9251..56521aeda6 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -310,17 +310,17 @@ int print_class(zend_class_entry *class_entry) return 0; } -ZEND_API void *get_unary_op(int opcode) +ZEND_API unary_op_type get_unary_op(int opcode) { switch(opcode) { case ZEND_BW_NOT: - return (void *) bitwise_not_function; + return bitwise_not_function; break; case ZEND_BOOL_NOT: - return (void *) boolean_not_function; + return boolean_not_function; break; default: - return (void *) NULL; + return (unary_op_type) NULL; break; } } |