Index: TSRM/TSRM.h =================================================================== RCS file: /repository/TSRM/TSRM.h,v retrieving revision 1.50.2.2.2.2 diff -u -p -d -r1.50.2.2.2.2 TSRM.h --- TSRM/TSRM.h 15 Feb 2007 19:11:48 -0000 1.50.2.2.2.2 +++ TSRM/TSRM.h 16 Apr 2007 06:47:30 -0000 @@ -30,6 +30,14 @@ # define TSRM_API #endif +#ifdef _WIN64 +typedef unsigned __int64 tsrm_intptr_t; +typedef __int64 tsrm_uintptr_t; +#else +typedef long tsrm_intptr_t; +typedef unsigned long tsrm_uintptr_t; +#endif + /* Only compile multi-threading functions if we're in ZTS mode */ #ifdef ZTS Index: TSRM/tsrm_win32.c =================================================================== RCS file: /repository/TSRM/tsrm_win32.c,v retrieving revision 1.27.2.1.2.6 diff -u -p -d -r1.27.2.1.2.6 tsrm_win32.c --- TSRM/tsrm_win32.c 2 Apr 2007 20:42:44 -0000 1.27.2.1.2.6 +++ TSRM/tsrm_win32.c 16 Apr 2007 06:47:31 -0000 @@ -228,10 +228,10 @@ TSRM_API FILE *popen_ex(const char *comm proc = process_get(NULL TSRMLS_CC); if (read) { - fno = _open_osfhandle((long)in, _O_RDONLY | mode); + fno = _open_osfhandle((tsrm_intptr_t)in, _O_RDONLY | mode); CloseHandle(out); } else { - fno = _open_osfhandle((long)out, _O_WRONLY | mode); + fno = _open_osfhandle((tsrm_intptr_t)out, _O_WRONLY | mode); CloseHandle(in); } Index: Zend/zend_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_API.c,v retrieving revision 1.296.2.27.2.27 diff -u -p -d -r1.296.2.27.2.27 zend_API.c --- Zend/zend_API.c 9 Apr 2007 07:30:09 -0000 1.296.2.27.2.27 +++ Zend/zend_API.c 16 Apr 2007 06:47:31 -0000 @@ -44,7 +44,7 @@ ZEND_API int zend_get_parameters(int ht, TSRMLS_FETCH(); p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; + arg_count = (int)(zend_uintptr_t) *p; if (param_count>arg_count) { return FAILURE; @@ -82,7 +82,7 @@ ZEND_API int _zend_get_parameters_array( zval *param_ptr; p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; + arg_count = (int)(zend_uintptr_t) *p; if (param_count>arg_count) { return FAILURE; @@ -122,7 +122,7 @@ ZEND_API int zend_get_parameters_ex(int TSRMLS_FETCH(); p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; + arg_count = (int)(zend_uintptr_t) *p; if (param_count>arg_count) { return FAILURE; @@ -145,7 +145,7 @@ ZEND_API int _zend_get_parameters_array_ int arg_count; p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; + arg_count = (int)(zend_uintptr_t) *p; if (param_count>arg_count) { return FAILURE; @@ -187,7 +187,7 @@ ZEND_API int zend_copy_parameters_array( int arg_count; p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; + arg_count = (int)(zend_uintptr_t) *p; if (param_count>arg_count) { return FAILURE; @@ -698,7 +698,7 @@ static int zend_parse_va_args(int num_ar } p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; + arg_count = (int)(zend_uintptr_t) *p; if (num_args > arg_count) { zend_error(E_WARNING, "%s(): could not obtain parameters for parsing", @@ -878,7 +878,7 @@ ZEND_API void zend_update_class_constant zend_update_class_constants(class_type->parent TSRMLS_CC); } #if ZTS - ALLOC_HASHTABLE(CG(static_members)[(long)(class_type->static_members)]); + ALLOC_HASHTABLE(CG(static_members)[(zend_intptr_t)(class_type->static_members)]); #else ALLOC_HASHTABLE(class_type->static_members); #endif Index: Zend/zend_API.h =================================================================== RCS file: /repository/ZendEngine2/zend_API.h,v retrieving revision 1.207.2.8.2.7 diff -u -p -d -r1.207.2.8.2.7 zend_API.h --- Zend/zend_API.h 1 Jan 2007 09:35:45 -0000 1.207.2.8.2.7 +++ Zend/zend_API.h 16 Apr 2007 06:47:31 -0000 @@ -160,7 +160,7 @@ typedef struct _zend_function_entry { INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset, NULL, NULL) #ifdef ZTS -# define CE_STATIC_MEMBERS(ce) (((ce)->type==ZEND_USER_CLASS)?(ce)->static_members:CG(static_members)[(long)(ce)->static_members]) +# define CE_STATIC_MEMBERS(ce) (((ce)->type==ZEND_USER_CLASS)?(ce)->static_members:CG(static_members)[(zend_intptr_t)(ce)->static_members]) #else # define CE_STATIC_MEMBERS(ce) ((ce)->static_members) #endif Index: Zend/zend_alloc.c =================================================================== RCS file: /repository/ZendEngine2/zend_alloc.c,v retrieving revision 1.144.2.3.2.40 diff -u -p -d -r1.144.2.3.2.40 zend_alloc.c --- Zend/zend_alloc.c 9 Apr 2007 15:30:20 -0000 1.144.2.3.2.40 +++ Zend/zend_alloc.c 16 Apr 2007 06:47:32 -0000 @@ -50,6 +50,16 @@ # define ZEND_MM_COOKIES ZEND_DEBUG #endif +#ifdef _WIN64 +# define PTR_FMT "0x%0.16I64x" +/* +#elif sizeof(long) == 8 +# define PTR_FMT "0x%0.16lx" +*/ +#else +# define PTR_FMT "0x%0.8lx" +#endif + #if ZEND_DEBUG void zend_debug_alloc_output(char *format, ...) { @@ -1180,7 +1190,7 @@ static void zend_mm_check_leaks(zend_mm_ repeated = zend_mm_find_leaks(segment, p); total += 1 + repeated; if (repeated) { - zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)repeated); + zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated); } #if ZEND_MM_CACHE } else if (p->magic == MEM_BLOCK_CACHED) { @@ -1221,7 +1231,7 @@ static int zend_mm_check_ptr(zend_mm_hea if (!silent) { zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL); zend_debug_alloc_output("---------------------------------------\n"); - zend_debug_alloc_output("%s(%d) : Block 0x%0.8lX status:\n" ZEND_FILE_LINE_RELAY_CC, (long) ptr); + zend_debug_alloc_output("%s(%d) : Block "PTR_FMT" status:\n" ZEND_FILE_LINE_RELAY_CC, ptr); if (__zend_orig_filename) { zend_debug_alloc_output("%s(%d) : Actual location (location was relayed)\n" ZEND_FILE_LINE_ORIG_RELAY_CC); } @@ -1253,7 +1263,7 @@ static int zend_mm_check_ptr(zend_mm_hea if (p->info._size != ZEND_MM_NEXT_BLOCK(p)->info._prev) { if (!silent) { - zend_debug_alloc_output("Invalid pointer: ((size=0x%0.8X) != (next.prev=0x%0.8X))\n", p->info._size, ZEND_MM_NEXT_BLOCK(p)->info._prev); + zend_debug_alloc_output("Invalid pointer: ((size="PTR_FMT") != (next.prev="PTR_FMT"))\n", p->info._size, ZEND_MM_NEXT_BLOCK(p)->info._prev); had_problems = 1; } else { return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); @@ -1262,7 +1272,7 @@ static int zend_mm_check_ptr(zend_mm_hea if (p->info._prev != ZEND_MM_GUARD_BLOCK && ZEND_MM_PREV_BLOCK(p)->info._size != p->info._prev) { if (!silent) { - zend_debug_alloc_output("Invalid pointer: ((prev=0x%0.8X) != (prev.size=0x%0.8X))\n", p->info._prev, ZEND_MM_PREV_BLOCK(p)->info._size); + zend_debug_alloc_output("Invalid pointer: ((prev="PTR_FMT") != (prev.size="PTR_FMT"))\n", p->info._prev, ZEND_MM_PREV_BLOCK(p)->info._size); had_problems = 1; } else { return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); Index: Zend/zend_builtin_functions.c =================================================================== RCS file: /repository/ZendEngine2/zend_builtin_functions.c,v retrieving revision 1.277.2.12.2.16 diff -u -p -d -r1.277.2.12.2.16 zend_builtin_functions.c --- Zend/zend_builtin_functions.c 24 Feb 2007 02:17:23 -0000 1.277.2.12.2.16 +++ Zend/zend_builtin_functions.c 16 Apr 2007 06:47:32 -0000 @@ -172,14 +172,14 @@ ZEND_FUNCTION(func_num_args) int arg_count; p = EG(argument_stack).top_element-1-1; - arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */ + arg_count = (int)(zend_uintptr_t) *p; /* this is the amount of arguments passed to func_num_args(); */ p -= 1+arg_count; if (*p) { zend_error(E_ERROR, "func_num_args(): Can't be used as a function parameter"); } --p; if (p>=EG(argument_stack).elements) { - RETURN_LONG((ulong) *p); + RETURN_LONG((long)(zend_uintptr_t) *p); } else { zend_error(E_WARNING, "func_num_args(): Called from the global scope - no function context"); RETURN_LONG(-1); @@ -210,7 +210,7 @@ ZEND_FUNCTION(func_get_arg) } p = EG(argument_stack).top_element-1-1; - arg_count = (ulong) *p; /* this is the amount of arguments passed to func_get_arg(); */ + arg_count = (int)(zend_uintptr_t) *p; /* this is the amount of arguments passed to func_get_arg(); */ p -= 1+arg_count; if (*p) { zend_error(E_ERROR, "func_get_arg(): Can't be used as a function parameter"); @@ -220,7 +220,7 @@ ZEND_FUNCTION(func_get_arg) zend_error(E_WARNING, "func_get_arg(): Called from the global scope - no function context"); RETURN_FALSE; } - arg_count = (ulong) *p; + arg_count = (int)(zend_uintptr_t) *p; if (requested_offset>=arg_count) { zend_error(E_WARNING, "func_get_arg(): Argument %ld not passed to function", requested_offset); @@ -244,7 +244,7 @@ ZEND_FUNCTION(func_get_args) int i; p = EG(argument_stack).top_element-1-1; - arg_count = (ulong) *p; /* this is the amount of arguments passed to func_get_args(); */ + arg_count = (int)(zend_uintptr_t) *p; /* this is the amount of arguments passed to func_get_args(); */ p -= 1+arg_count; if (*p) { zend_error(E_ERROR, "func_get_args(): Can't be used as a function parameter"); @@ -255,7 +255,7 @@ ZEND_FUNCTION(func_get_args) zend_error(E_WARNING, "func_get_args(): Called from the global scope - no function context"); RETURN_FALSE; } - arg_count = (ulong) *p; + arg_count = (int)(zend_uintptr_t) *p; array_init(return_value); @@ -1655,7 +1655,7 @@ static zval *debug_backtrace_get_args(vo { void **p = *curpos - 2; zval *arg_array, **arg; - int arg_count = (ulong) *p; + int arg_count = (int)(zend_uintptr_t) *p; *curpos -= (arg_count+2); Index: Zend/zend_compile.c =================================================================== RCS file: /repository/ZendEngine2/zend_compile.c,v retrieving revision 1.647.2.27.2.34 diff -u -p -d -r1.647.2.27.2.34 zend_compile.c --- Zend/zend_compile.c 4 Apr 2007 00:42:42 -0000 1.647.2.27.2.34 +++ Zend/zend_compile.c 16 Apr 2007 06:47:33 -0000 @@ -4189,7 +4189,7 @@ ZEND_API void zend_initialize_class_data CG(static_members) = realloc(CG(static_members), (n+1)*sizeof(HashTable*)); CG(static_members)[n] = NULL; } - ce->static_members = (HashTable*)n; + ce->static_members = (HashTable*)(zend_intptr_t)n; #else ce->static_members = NULL; #endif Index: Zend/zend_execute.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.716.2.12.2.18 diff -u -p -d -r1.716.2.12.2.18 zend_execute.c --- Zend/zend_execute.c 13 Apr 2007 14:41:36 -0000 1.716.2.12.2.18 +++ Zend/zend_execute.c 16 Apr 2007 06:47:33 -0000 @@ -104,15 +104,15 @@ static inline void zend_pzval_unlock_fre #define FREE_OP(should_free) \ if (should_free.var) { \ - if ((long)should_free.var & 1L) { \ - zval_dtor((zval*)((long)should_free.var & ~1L)); \ + if ((zend_uintptr_t)should_free.var & 1L) { \ + zval_dtor((zval*)((zend_uintptr_t)should_free.var & ~1L)); \ } else { \ zval_ptr_dtor(&should_free.var); \ } \ } #define FREE_OP_IF_VAR(should_free) \ - if (should_free.var != NULL && (((long)should_free.var & 1L) == 0)) { \ + if (should_free.var != NULL && (((zend_uintptr_t)should_free.var & 1L) == 0)) { \ zval_ptr_dtor(&should_free.var); \ } @@ -121,9 +121,9 @@ static inline void zend_pzval_unlock_fre zval_ptr_dtor(&should_free.var); \ } -#define TMP_FREE(z) (zval*)(((long)(z)) | 1L) +#define TMP_FREE(z) (zval*)(((zend_uintptr_t)(z)) | 1L) -#define IS_TMP_FREE(should_free) ((long)should_free.var & 1L) +#define IS_TMP_FREE(should_free) ((zend_uintptr_t)should_free.var & 1L) #define INIT_PZVAL_COPY(z,v) \ (z)->value = (v)->value; \ Index: Zend/zend_execute.h =================================================================== RCS file: /repository/ZendEngine2/zend_execute.h,v retrieving revision 1.84.2.4.2.6 diff -u -p -d -r1.84.2.4.2.6 zend_execute.h --- Zend/zend_execute.h 10 Jan 2007 15:58:07 -0000 1.84.2.4.2.6 +++ Zend/zend_execute.h 16 Apr 2007 06:47:33 -0000 @@ -146,7 +146,7 @@ ZEND_API int zval_update_constant_ex(zva static inline void zend_ptr_stack_clear_multiple(TSRMLS_D) { void **p = EG(argument_stack).top_element-2; - int delete_count = (ulong) *p; + int delete_count = (int)(zend_uintptr_t) *p; EG(argument_stack).top -= (delete_count+2); while (--delete_count>=0) { @@ -160,7 +160,7 @@ static inline void zend_ptr_stack_clear_ static inline int zend_ptr_stack_get_arg(int requested_arg, void **data TSRMLS_DC) { void **p = EG(argument_stack).top_element-2; - int arg_count = (ulong) *p; + int arg_count = (int)(zend_uintptr_t) *p; if (requested_arg>arg_count) { return FAILURE; Index: Zend/zend_execute_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute_API.c,v retrieving revision 1.331.2.20.2.17 diff -u -p -d -r1.331.2.20.2.17 zend_execute_API.c --- Zend/zend_execute_API.c 15 Mar 2007 16:44:12 -0000 1.331.2.20.2.17 +++ Zend/zend_execute_API.c 16 Apr 2007 06:47:33 -0000 @@ -451,7 +451,7 @@ ZEND_API int zend_is_true(zval *op) ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC) { zval *p = *pp; - zend_bool inline_change = (zend_bool) (unsigned long) arg; + zend_bool inline_change = (zend_bool) (zend_uintptr_t) arg; zval const_value; if (Z_TYPE_P(p) == IS_CONSTANT) { @@ -867,7 +867,7 @@ int zend_call_function(zend_fcall_info * if (fci->no_separation) { if(i) { /* hack to clean up the stack */ - zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) (long) i, NULL); + zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) (zend_uintptr_t) i, NULL); zend_ptr_stack_clear_multiple(TSRMLS_C); } @@ -908,7 +908,7 @@ int zend_call_function(zend_fcall_info * fci->param_count = 2; } - zend_ptr_stack_2_push(&EG(argument_stack), (void *) (long) fci->param_count, NULL); + zend_ptr_stack_2_push(&EG(argument_stack), (void *) (zend_uintptr_t) fci->param_count, NULL); original_function_state_ptr = EG(function_state_ptr); EG(function_state_ptr) = &EX(function_state); Index: Zend/zend_ini.c =================================================================== RCS file: /repository/ZendEngine2/zend_ini.c,v retrieving revision 1.39.2.2.2.7 diff -u -p -d -r1.39.2.2.2.7 zend_ini.c --- Zend/zend_ini.c 6 Mar 2007 21:08:05 -0000 1.39.2.2.2.7 +++ Zend/zend_ini.c 16 Apr 2007 06:47:34 -0000 @@ -225,7 +225,7 @@ static int zend_ini_refresh_cache(zend_i ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) { - zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(long) stage TSRMLS_CC); + zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(zend_intptr_t) stage TSRMLS_CC); } #endif Index: Zend/zend_opcode.c =================================================================== RCS file: /repository/ZendEngine2/zend_opcode.c,v retrieving revision 1.110.2.6.2.2 diff -u -p -d -r1.110.2.6.2.2 zend_opcode.c --- Zend/zend_opcode.c 15 Feb 2007 10:38:28 -0000 1.110.2.6.2.2 +++ Zend/zend_opcode.c 16 Apr 2007 06:47:34 -0000 @@ -160,7 +160,7 @@ ZEND_API int zend_cleanup_class_data(zen zend_hash_destroy(CE_STATIC_MEMBERS(*pce)); FREE_HASHTABLE(CE_STATIC_MEMBERS(*pce)); #ifdef ZTS - CG(static_members)[(long)((*pce)->static_members)] = NULL; + CG(static_members)[(zend_intptr_t)((*pce)->static_members)] = NULL; #else (*pce)->static_members = NULL; #endif Index: Zend/zend_types.h =================================================================== RCS file: /repository/ZendEngine2/zend_types.h,v retrieving revision 1.6.2.2.2.1 diff -u -p -d -r1.6.2.2.2.1 zend_types.h --- Zend/zend_types.h 1 Jan 2007 09:35:47 -0000 1.6.2.2.2.1 +++ Zend/zend_types.h 16 Apr 2007 06:47:34 -0000 @@ -28,6 +28,14 @@ typedef unsigned int zend_uint; typedef unsigned long zend_ulong; typedef unsigned short zend_ushort; +#ifdef _WIN64 +typedef unsigned __int64 zend_intptr_t; +typedef __int64 zend_uintptr_t; +#else +typedef long zend_intptr_t; +typedef unsigned long zend_uintptr_t; +#endif + typedef unsigned int zend_object_handle; typedef struct _zend_object_handlers zend_object_handlers; Index: Zend/zend_vm_def.h =================================================================== RCS file: /repository/ZendEngine2/zend_vm_def.h,v retrieving revision 1.59.2.29.2.42 diff -u -p -d -r1.59.2.29.2.42 zend_vm_def.h --- Zend/zend_vm_def.h 5 Apr 2007 23:48:42 -0000 1.59.2.29.2.42 +++ Zend/zend_vm_def.h 16 Apr 2007 06:47:34 -0000 @@ -1857,7 +1857,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_help } } - zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL); + zend_ptr_stack_2_push(&EG(argument_stack), (void *)(zend_uintptr_t)opline->extended_value, NULL); EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; @@ -1900,7 +1900,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_help ulong arg_count; p = (zval **) EG(argument_stack).top_element-2; - arg_count = (ulong) *p; + arg_count = (ulong)(zend_uintptr_t) *p; while (arg_count>0) { zend_verify_arg_type(EX(function_state).function, ++i, *(p-arg_count) TSRMLS_CC); Index: Zend/zend_vm_execute.h =================================================================== RCS file: /repository/ZendEngine2/zend_vm_execute.h,v retrieving revision 1.62.2.30.2.42 diff -u -p -d -r1.62.2.30.2.42 zend_vm_execute.h --- Zend/zend_vm_execute.h 5 Apr 2007 23:48:42 -0000 1.62.2.30.2.42 +++ Zend/zend_vm_execute.h 16 Apr 2007 06:47:37 -0000 @@ -145,7 +145,7 @@ static int zend_do_fcall_common_helper_S } } - zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL); + zend_ptr_stack_2_push(&EG(argument_stack), (void *)(zend_uintptr_t)opline->extended_value, NULL); EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; @@ -188,7 +188,7 @@ static int zend_do_fcall_common_helper_S ulong arg_count; p = (zval **) EG(argument_stack).top_element-2; - arg_count = (ulong) *p; + arg_count = (ulong)(zend_uintptr_t) *p; while (arg_count>0) { zend_verify_arg_type(EX(function_state).function, ++i, *(p-arg_count) TSRMLS_CC); Index: ext/standard/proc_open.c =================================================================== RCS file: /repository/php-src/ext/standard/proc_open.c,v retrieving revision 1.36.2.1.2.14 diff -u -p -d -r1.36.2.1.2.14 proc_open.c --- ext/standard/proc_open.c 2 Apr 2007 20:44:30 -0000 1.36.2.1.2.14 +++ ext/standard/proc_open.c 16 Apr 2007 06:47:38 -0000 @@ -946,7 +946,7 @@ PHP_FUNCTION(proc_open) break; } #ifdef PHP_WIN32 - stream = php_stream_fopen_from_fd(_open_osfhandle((long)descriptors[i].parentend, + stream = php_stream_fopen_from_fd(_open_osfhandle((zend_intptr_t)descriptors[i].parentend, descriptors[i].mode_flags), mode_string, NULL); #else stream = php_stream_fopen_from_fd(descriptors[i].parentend, mode_string, NULL); Index: main/SAPI.c =================================================================== RCS file: /repository/php-src/main/SAPI.c,v retrieving revision 1.202.2.7.2.9 diff -u -p -d -r1.202.2.7.2.9 SAPI.c --- main/SAPI.c 27 Feb 2007 03:28:17 -0000 1.202.2.7.2.9 +++ main/SAPI.c 16 Apr 2007 06:47:38 -0000 @@ -541,7 +541,7 @@ SAPI_API int sapi_header_op(sapi_header_ switch (op) { case SAPI_HEADER_SET_STATUS: - sapi_update_response_code((long) arg TSRMLS_CC); + sapi_update_response_code((int)(zend_intptr_t) arg TSRMLS_CC); return SUCCESS; case SAPI_HEADER_REPLACE: Index: main/main.c =================================================================== RCS file: /repository/php-src/main/main.c,v retrieving revision 1.640.2.23.2.33 diff -u -p -d -r1.640.2.23.2.33 main.c --- main/main.c 6 Apr 2007 13:58:48 -0000 1.640.2.23.2.33 +++ main/main.c 16 Apr 2007 06:47:39 -0000 @@ -974,7 +974,7 @@ static void php_message_handler_for_zend if (message==ZMSG_MEMORY_LEAK_DETECTED) { zend_leak_info *t = (zend_leak_info *) data; - snprintf(memory_leak_buf, 512, "%s(%d) : Freeing 0x%.8lX (%zu bytes), script=%s\n", t->filename, t->lineno, (unsigned long)t->addr, t->size, SAFE_FILENAME(SG(request_info).path_translated)); + snprintf(memory_leak_buf, 512, "%s(%d) : Freeing 0x%.8lX (%zu bytes), script=%s\n", t->filename, t->lineno, (zend_uintptr_t)t->addr, t->size, SAFE_FILENAME(SG(request_info).path_translated)); if (t->orig_filename) { char relay_buf[512]; @@ -982,7 +982,7 @@ static void php_message_handler_for_zend strlcat(memory_leak_buf, relay_buf, sizeof(memory_leak_buf)); } } else { - unsigned long leak_count = (unsigned long) data; + unsigned long leak_count = (zend_uintptr_t) data; snprintf(memory_leak_buf, 512, "Last leak repeated %ld time%s\n", leak_count, (leak_count>1?"s":"")); } Index: main/php_ini.c =================================================================== RCS file: /repository/php-src/main/php_ini.c,v retrieving revision 1.136.2.4.2.7 diff -u -p -d -r1.136.2.4.2.7 php_ini.c --- main/php_ini.c 24 Feb 2007 02:17:28 -0000 1.136.2.4.2.7 +++ main/php_ini.c 16 Apr 2007 06:47:39 -0000 @@ -142,7 +142,7 @@ PHPAPI void display_ini_entries(zend_mod } php_info_print_table_start(); php_info_print_table_header(3, "Directive", "Local Value", "Master Value"); - zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (long) module_number TSRMLS_CC); + zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (zend_intptr_t) module_number TSRMLS_CC); php_info_print_table_end(); } /* }}} */ @@ -590,7 +590,7 @@ PHPAPI int cfg_get_long(char *varname, l zval *tmp, var; if (zend_hash_find(&configuration_hash, varname, strlen(varname) + 1, (void **) &tmp) == FAILURE) { - *result = (long) NULL; + *result = 0; return FAILURE; } var = *tmp; Index: main/streams/plain_wrapper.c =================================================================== RCS file: /repository/php-src/main/streams/plain_wrapper.c,v retrieving revision 1.52.2.6.2.18 diff -u -p -d -r1.52.2.6.2.18 plain_wrapper.c --- main/streams/plain_wrapper.c 9 Apr 2007 15:38:41 -0000 1.52.2.6.2.18 +++ main/streams/plain_wrapper.c 16 Apr 2007 06:47:39 -0000 @@ -223,9 +223,9 @@ PHPAPI php_stream *_php_stream_fopen_fro } #elif defined(PHP_WIN32) { - long handle = _get_osfhandle(self->fd); + zend_uintptr_t handle = _get_osfhandle(self->fd); - if (handle != 0xFFFFFFFF) { + if (handle != (zend_uintptr_t)INVALID_HANDLE_VALUE) { self->is_pipe = GetFileType((HANDLE)handle) == FILE_TYPE_PIPE; } } @@ -261,9 +261,9 @@ PHPAPI php_stream *_php_stream_fopen_fro } #elif defined(PHP_WIN32) { - long handle = _get_osfhandle(self->fd); + zend_uintptr_t handle = _get_osfhandle(self->fd); - if (handle != 0xFFFFFFFF) { + if (handle != (zend_uintptr_t)INVALID_HANDLE_VALUE) { self->is_pipe = GetFileType((HANDLE)handle) == FILE_TYPE_PIPE; } } @@ -601,7 +601,7 @@ static int php_stdiop_set_option(php_str return -1; } - if ((long) ptrparam == PHP_STREAM_LOCK_SUPPORTED) { + if ((zend_uintptr_t) ptrparam == PHP_STREAM_LOCK_SUPPORTED) { return 0; } Index: win32/select.c =================================================================== RCS file: /repository/php-src/win32/select.c,v retrieving revision 1.10.2.2.2.1 diff -u -p -d -r1.10.2.2.2.1 select.c --- win32/select.c 1 Jan 2007 09:36:13 -0000 1.10.2.2.2.1 +++ win32/select.c 16 Apr 2007 06:47:39 -0000 @@ -63,8 +63,8 @@ PHPAPI int php_select(int max_fd, fd_set /* build an array of handles for non-sockets */ for (i = 0; i < max_fd; i++) { if (SAFE_FD_ISSET(i, rfds) || SAFE_FD_ISSET(i, wfds) || SAFE_FD_ISSET(i, efds)) { - handles[n_handles] = (HANDLE)_get_osfhandle(i); - if ((DWORD)handles[n_handles] == 0xffffffff) { + handles[n_handles] = (HANDLE)(zend_uintptr_t)_get_osfhandle(i); + if (handles[n_handles] == INVALID_HANDLE_VALUE) { /* socket */ if (SAFE_FD_ISSET(i, rfds)) { FD_SET((uint)i, &sock_read); Index: win32/build/config.w32 =================================================================== RCS file: /repository/php-src/win32/build/config.w32,v retrieving revision 1.40.2.8.2.8 diff -u -p -d -r1.40.2.8.2.8 config.w32 --- win32/build/config.w32 10 Apr 2007 06:22:28 -0000 1.40.2.8.2.8 +++ win32/build/config.w32 16 Apr 2007 06:47:39 -0000 @@ -126,8 +126,7 @@ if (VCVERS >= 14) { // disable annoying warnings. In addition, time_t defaults // to 64-bit. Ask for 32-bit. if (X64) { - ADD_FLAG('CFLAGS', ' /wd4996 '); -// ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 '); + ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 '); } else { ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 '); }