dmitry Mon Apr 16 09:43:53 2007 UTC
Modified files:
/TSRM TSRM.h tsrm_win32.c
/ZendEngine2 zend_API.c zend_API.h zend_alloc.c
zend_builtin_functions.c zend_compile.c zend_execute.c
zend_execute.h zend_execute_API.c zend_ini.c
zend_opcode.c zend_types.h zend_vm_def.h
zend_vm_execute.h
/php-src/ext/standard file.c ftp_fopen_wrapper.c proc_open.c
/php-src/main SAPI.c main.c php_ini.c
/php-src/main/streams plain_wrapper.c
/php-src/win32 select.c
/php-src/win32/build config.w32
Log:
WIN64 support
http://cvs.php.net/viewvc.cgi/TSRM/TSRM.h?r1=1.54&r2=1.55&diff_format=u
Index: TSRM/TSRM.h
diff -u TSRM/TSRM.h:1.54 TSRM/TSRM.h:1.55
--- TSRM/TSRM.h:1.54 Thu Feb 15 19:11:29 2007
+++ TSRM/TSRM.h Mon Apr 16 09:43:52 2007
@@ -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
http://cvs.php.net/viewvc.cgi/TSRM/tsrm_win32.c?r1=1.32&r2=1.33&diff_format=u
Index: TSRM/tsrm_win32.c
diff -u TSRM/tsrm_win32.c:1.32 TSRM/tsrm_win32.c:1.33
--- TSRM/tsrm_win32.c:1.32 Mon Apr 2 20:48:53 2007
+++ TSRM/tsrm_win32.c Mon Apr 16 09:43:52 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_win32.c,v 1.32 2007/04/02 20:48:53 stas Exp $ */
+/* $Id: tsrm_win32.c,v 1.33 2007/04/16 09:43:52 dmitry Exp $ */
#include <stdio.h>
#include <fcntl.h>
@@ -228,10 +228,10 @@
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);
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.426&r2=1.427&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.426 ZendEngine2/zend_API.c:1.427
--- ZendEngine2/zend_API.c:1.426 Thu Feb 8 14:33:16 2007
+++ ZendEngine2/zend_API.c Mon Apr 16 09:43:52 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.426 2007/02/08 14:33:16 helly Exp $ */
+/* $Id: zend_API.c,v 1.427 2007/04/16 09:43:52 dmitry Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -44,7 +44,7 @@
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 @@
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 @@
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 @@
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;
@@ -168,7 +168,7 @@
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;
@@ -957,7 +957,7 @@
return FAILURE;
}
- arg_count = (ulong) *(EG(argument_stack).top_element-2);
+ arg_count = (int)(zend_uintptr_t) *(EG(argument_stack).top_element-2);
if (num_args > arg_count) {
zend_error(E_WARNING, "%v(): could not obtain parameters for
parsing",
@@ -1238,7 +1238,7 @@
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
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.h?r1=1.286&r2=1.287&diff_format=u
Index: ZendEngine2/zend_API.h
diff -u ZendEngine2/zend_API.h:1.286 ZendEngine2/zend_API.h:1.287
--- ZendEngine2/zend_API.h:1.286 Thu Feb 8 14:33:16 2007
+++ ZendEngine2/zend_API.h Mon Apr 16 09:43:52 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.h,v 1.286 2007/02/08 14:33:16 helly Exp $ */
+/* $Id: zend_API.h,v 1.287 2007/04/16 09:43:52 dmitry Exp $ */
#ifndef ZEND_API_H
#define ZEND_API_H
@@ -170,7 +170,7 @@
INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name,
sizeof(class_name)-1, 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
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_alloc.c?r1=1.199&r2=1.200&diff_format=u
Index: ZendEngine2/zend_alloc.c
diff -u ZendEngine2/zend_alloc.c:1.199 ZendEngine2/zend_alloc.c:1.200
--- ZendEngine2/zend_alloc.c:1.199 Mon Apr 9 15:30:37 2007
+++ ZendEngine2/zend_alloc.c Mon Apr 16 09:43:52 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_alloc.c,v 1.199 2007/04/09 15:30:37 dmitry Exp $ */
+/* $Id: zend_alloc.c,v 1.200 2007/04/16 09:43:52 dmitry Exp $ */
#include "zend.h"
#include "zend_alloc.h"
@@ -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, ...)
{
@@ -1178,7 +1188,7 @@
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) {
@@ -1219,7 +1229,7 @@
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);
}
@@ -1251,7 +1261,7 @@
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);
@@ -1260,7 +1270,7 @@
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);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.339&r2=1.340&diff_format=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.339
ZendEngine2/zend_builtin_functions.c:1.340
--- ZendEngine2/zend_builtin_functions.c:1.339 Fri Jan 5 19:00:36 2007
+++ ZendEngine2/zend_builtin_functions.c Mon Apr 16 09:43:52 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_builtin_functions.c,v 1.339 2007/01/05 19:00:36 pollita Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.340 2007/04/16 09:43:52 dmitry Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -171,14 +171,14 @@
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);
@@ -209,7 +209,7 @@
}
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");
@@ -219,7 +219,7 @@
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);
@@ -243,7 +243,7 @@
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");
@@ -254,7 +254,7 @@
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);
@@ -1786,7 +1786,7 @@
{
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);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.744&r2=1.745&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.744 ZendEngine2/zend_compile.c:1.745
--- ZendEngine2/zend_compile.c:1.744 Tue Apr 3 06:32:59 2007
+++ ZendEngine2/zend_compile.c Mon Apr 16 09:43:52 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.744 2007/04/03 06:32:59 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.745 2007/04/16 09:43:52 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -4476,7 +4476,7 @@
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
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.c?r1=1.761&r2=1.762&diff_format=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.761 ZendEngine2/zend_execute.c:1.762
--- ZendEngine2/zend_execute.c:1.761 Fri Apr 13 14:39:34 2007
+++ ZendEngine2/zend_execute.c Mon Apr 16 09:43:52 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.761 2007/04/13 14:39:34 tony2001 Exp $ */
+/* $Id: zend_execute.c,v 1.762 2007/04/16 09:43:52 dmitry Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -105,15 +105,15 @@
#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); \
}
@@ -122,9 +122,9 @@
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; \
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.h?r1=1.106&r2=1.107&diff_format=u
Index: ZendEngine2/zend_execute.h
diff -u ZendEngine2/zend_execute.h:1.106 ZendEngine2/zend_execute.h:1.107
--- ZendEngine2/zend_execute.h:1.106 Wed Jan 10 15:59:55 2007
+++ ZendEngine2/zend_execute.h Mon Apr 16 09:43:52 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.h,v 1.106 2007/01/10 15:59:55 dmitry Exp $ */
+/* $Id: zend_execute.h,v 1.107 2007/04/16 09:43:52 dmitry Exp $ */
#ifndef ZEND_EXECUTE_H
#define ZEND_EXECUTE_H
@@ -156,7 +156,7 @@
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) {
@@ -170,7 +170,7 @@
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;
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.398&r2=1.399&diff_format=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.398
ZendEngine2/zend_execute_API.c:1.399
--- ZendEngine2/zend_execute_API.c:1.398 Thu Mar 8 17:30:28 2007
+++ ZendEngine2/zend_execute_API.c Mon Apr 16 09:43:52 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute_API.c,v 1.398 2007/03/08 17:30:28 helly Exp $ */
+/* $Id: zend_execute_API.c,v 1.399 2007/04/16 09:43:52 dmitry Exp $ */
#include <stdio.h>
#include <signal.h>
@@ -472,7 +472,7 @@
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) {
@@ -933,7 +933,7 @@
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);
}
if (old_func_name) {
@@ -979,7 +979,7 @@
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);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini.c?r1=1.53&r2=1.54&diff_format=u
Index: ZendEngine2/zend_ini.c
diff -u ZendEngine2/zend_ini.c:1.53 ZendEngine2/zend_ini.c:1.54
--- ZendEngine2/zend_ini.c:1.53 Tue Mar 6 21:07:52 2007
+++ ZendEngine2/zend_ini.c Mon Apr 16 09:43:52 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_ini.c,v 1.53 2007/03/06 21:07:52 tony2001 Exp $ */
+/* $Id: zend_ini.c,v 1.54 2007/04/16 09:43:52 dmitry Exp $ */
#include "zend.h"
#include "zend_qsort.h"
@@ -226,7 +226,7 @@
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_uintptr_t) stage TSRMLS_CC);
}
#endif
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_opcode.c?r1=1.127&r2=1.128&diff_format=u
Index: ZendEngine2/zend_opcode.c
diff -u ZendEngine2/zend_opcode.c:1.127 ZendEngine2/zend_opcode.c:1.128
--- ZendEngine2/zend_opcode.c:1.127 Thu Mar 8 17:30:28 2007
+++ ZendEngine2/zend_opcode.c Mon Apr 16 09:43:52 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_opcode.c,v 1.127 2007/03/08 17:30:28 helly Exp $ */
+/* $Id: zend_opcode.c,v 1.128 2007/04/16 09:43:52 dmitry Exp $ */
#include <stdio.h>
@@ -189,7 +189,7 @@
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
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_types.h?r1=1.9&r2=1.10&diff_format=u
Index: ZendEngine2/zend_types.h
diff -u ZendEngine2/zend_types.h:1.9 ZendEngine2/zend_types.h:1.10
--- ZendEngine2/zend_types.h:1.9 Mon Jan 1 09:29:21 2007
+++ ZendEngine2/zend_types.h Mon Apr 16 09:43:52 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_types.h,v 1.9 2007/01/01 09:29:21 sebastian Exp $ */
+/* $Id: zend_types.h,v 1.10 2007/04/16 09:43:52 dmitry Exp $ */
#ifndef ZEND_TYPES_H
#define ZEND_TYPES_H
@@ -28,6 +28,14 @@
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;
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.164&r2=1.165&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.164 ZendEngine2/zend_vm_def.h:1.165
--- ZendEngine2/zend_vm_def.h:1.164 Tue Apr 3 06:32:59 2007
+++ ZendEngine2/zend_vm_def.h Mon Apr 16 09:43:52 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_def.h,v 1.164 2007/04/03 06:32:59 dmitry Exp $ */
+/* $Id: zend_vm_def.h,v 1.165 2007/04/16 09:43:52 dmitry Exp $ */
/* If you change this file, please regenerate the zend_vm_execute.h and
* zend_vm_opcodes.h files by running:
@@ -1909,7 +1909,7 @@
}
}
- 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;
@@ -1953,7 +1953,7 @@
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);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.167&r2=1.168&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.167 ZendEngine2/zend_vm_execute.h:1.168
--- ZendEngine2/zend_vm_execute.h:1.167 Tue Apr 3 06:33:00 2007
+++ ZendEngine2/zend_vm_execute.h Mon Apr 16 09:43:52 2007
@@ -153,7 +153,7 @@
}
}
- 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;
@@ -197,7 +197,7 @@
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);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.486&r2=1.487&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.486 php-src/ext/standard/file.c:1.487
--- php-src/ext/standard/file.c:1.486 Sat Mar 3 19:07:51 2007
+++ php-src/ext/standard/file.c Mon Apr 16 09:43:52 2007
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.486 2007/03/03 19:07:51 helly Exp $ */
+/* $Id: file.c,v 1.487 2007/04/16 09:43:52 dmitry Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -2087,7 +2087,8 @@
int delimiter_len = 1, enclosure_len = 1, escape_len = 1;
long len = -1;
zstr buf;
- int buf_len, argc = ZEND_NUM_ARGS();
+ size_t buf_len;
+ int argc = ZEND_NUM_ARGS();
php_stream *stream;
zval *zstream;
zend_uchar delimiter_free = 0, enclosure_free = 0, escape_free = 0;
@@ -2366,7 +2367,7 @@
/* Hungry? */
if (((e - p) < enclosure_len) && stream) {
/* Feed me! */
- int new_len;
+ size_t new_len;
char *new_buf =
php_stream_get_line(stream, NULL_ZSTR, 0, &new_len);
if (new_buf) {
@@ -2577,7 +2578,7 @@
/* Hungry? */
if (((e - p) < enclosure_len) && stream) {
/* Feed me! */
- int new_len;
+ size_t new_len;
UChar *new_buf =
(UChar*)php_stream_get_line_ex(stream, IS_UNICODE, NULL_ZSTR, 0, 0, &new_len);
if (new_buf) {
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/ftp_fopen_wrapper.c?r1=1.92&r2=1.93&diff_format=u
Index: php-src/ext/standard/ftp_fopen_wrapper.c
diff -u php-src/ext/standard/ftp_fopen_wrapper.c:1.92
php-src/ext/standard/ftp_fopen_wrapper.c:1.93
--- php-src/ext/standard/ftp_fopen_wrapper.c:1.92 Mon Jan 1 09:29:31 2007
+++ php-src/ext/standard/ftp_fopen_wrapper.c Mon Apr 16 09:43:52 2007
@@ -18,7 +18,7 @@
| Sara Golemon <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: ftp_fopen_wrapper.c,v 1.92 2007/01/01 09:29:31 sebastian Exp $ */
+/* $Id: ftp_fopen_wrapper.c,v 1.93 2007/04/16 09:43:52 dmitry Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -585,7 +585,7 @@
php_stream *innerstream = (php_stream *)stream->abstract;
size_t tmp_len;
char *basename;
- size_t basename_len;
+ int basename_len;
if (count != sizeof(php_stream_dirent)) {
return 0;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.55&r2=1.56&diff_format=u
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.55
php-src/ext/standard/proc_open.c:1.56
--- php-src/ext/standard/proc_open.c:1.55 Mon Apr 2 20:48:30 2007
+++ php-src/ext/standard/proc_open.c Mon Apr 16 09:43:52 2007
@@ -15,7 +15,7 @@
| Author: Wez Furlong <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: proc_open.c,v 1.55 2007/04/02 20:48:30 stas Exp $ */
+/* $Id: proc_open.c,v 1.56 2007/04/16 09:43:52 dmitry Exp $ */
#if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
# define _BSD_SOURCE /* linux wants this when XOPEN mode is on */
@@ -945,7 +945,7 @@
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);
http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.c?r1=1.221&r2=1.222&diff_format=u
Index: php-src/main/SAPI.c
diff -u php-src/main/SAPI.c:1.221 php-src/main/SAPI.c:1.222
--- php-src/main/SAPI.c:1.221 Mon Jan 1 09:29:35 2007
+++ php-src/main/SAPI.c Mon Apr 16 09:43:52 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.221 2007/01/01 09:29:35 sebastian Exp $ */
+/* $Id: SAPI.c,v 1.222 2007/04/16 09:43:52 dmitry Exp $ */
#include <ctype.h>
#include <sys/stat.h>
@@ -567,7 +567,7 @@
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:
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.725&r2=1.726&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.725 php-src/main/main.c:1.726
--- php-src/main/main.c:1.725 Sun Apr 8 08:02:02 2007
+++ php-src/main/main.c Mon Apr 16 09:43:52 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.725 2007/04/08 08:02:02 tony2001 Exp $ */
+/* $Id: main.c,v 1.726 2007/04/16 09:43:52 dmitry Exp $ */
/* {{{ includes
*/
@@ -1087,7 +1087,7 @@
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];
@@ -1095,7 +1095,7 @@
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":""));
}
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.148&r2=1.149&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.148 php-src/main/php_ini.c:1.149
--- php-src/main/php_ini.c:1.148 Sat Feb 24 16:25:55 2007
+++ php-src/main/php_ini.c Mon Apr 16 09:43:52 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ini.c,v 1.148 2007/02/24 16:25:55 helly Exp $ */
+/* $Id: php_ini.c,v 1.149 2007/04/16 09:43:52 dmitry Exp $ */
#include "php.h"
#include "ext/standard/info.h"
@@ -142,7 +142,7 @@
}
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();
}
/* }}} */
@@ -586,7 +586,7 @@
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;
http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.84&r2=1.85&diff_format=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.84
php-src/main/streams/plain_wrapper.c:1.85
--- php-src/main/streams/plain_wrapper.c:1.84 Mon Apr 9 15:38:21 2007
+++ php-src/main/streams/plain_wrapper.c Mon Apr 16 09:43:52 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: plain_wrapper.c,v 1.84 2007/04/09 15:38:21 dmitry Exp $ */
+/* $Id: plain_wrapper.c,v 1.85 2007/04/16 09:43:52 dmitry Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -223,9 +223,9 @@
}
#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;
}
}
@@ -262,9 +262,9 @@
}
#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;
}
}
@@ -605,7 +605,7 @@
return -1;
}
- if ((long) ptrparam == PHP_STREAM_LOCK_SUPPORTED) {
+ if ((zend_uintptr_t) ptrparam ==
PHP_STREAM_LOCK_SUPPORTED) {
return 0;
}
http://cvs.php.net/viewvc.cgi/php-src/win32/select.c?r1=1.12&r2=1.13&diff_format=u
Index: php-src/win32/select.c
diff -u php-src/win32/select.c:1.12 php-src/win32/select.c:1.13
--- php-src/win32/select.c:1.12 Mon Jan 1 09:29:37 2007
+++ php-src/win32/select.c Mon Apr 16 09:43:53 2007
@@ -21,7 +21,7 @@
#ifdef PHP_WIN32
-/* $Id: select.c,v 1.12 2007/01/01 09:29:37 sebastian Exp $ */
+/* $Id: select.c,v 1.13 2007/04/16 09:43:53 dmitry Exp $ */
/* Win32 select() will only work with sockets, so we roll our own
implementation here.
* - If you supply only sockets, this simply passes through to winsock
select().
@@ -63,8 +63,8 @@
/* 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(i, &sock_read);
http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.64&r2=1.65&diff_format=u
Index: php-src/win32/build/config.w32
diff -u php-src/win32/build/config.w32:1.64 php-src/win32/build/config.w32:1.65
--- php-src/win32/build/config.w32:1.64 Tue Apr 10 06:22:45 2007
+++ php-src/win32/build/config.w32 Mon Apr 16 09:43:53 2007
@@ -1,5 +1,5 @@
// vim:ft=javascript
-// $Id: config.w32,v 1.64 2007/04/10 06:22:45 dmitry Exp $
+// $Id: config.w32,v 1.65 2007/04/16 09:43:53 dmitry Exp $
// "Master" config file; think of it as a configure.in
// equivalent.
@@ -124,8 +124,7 @@
// fun stuff: MS deprecated ANSI stdio and similar functions
// disable annoying warnings
if (X64) {
- ADD_FLAG('CFLAGS', ' /wd4996 ');
-// ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 ');
+ ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 ');
} else {
ADD_FLAG('CFLAGS', ' /wd4996 ');
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php