From: Pierre Joye Date: Mon, 15 Jun 2009 14:06:30 +0000 (+0000) Subject: - silent compilation warnings (no MFH yet) X-Git-Tag: php-5.4.0alpha1~191^2~3322 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b908c70fa11041665610c7311763ce61b898f7b6;p=php - silent compilation warnings (no MFH yet) --- diff --git a/Zend/zend.h b/Zend/zend.h index d5afb46f3f..a2288df29d 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -268,6 +268,8 @@ typedef union _zstr { extern ZEND_API zstr null_zstr; extern ZEND_API zstr empty_zstr; +/* TODO: get rid of this inline as well or figure out a way to deal with: + Zend\zend_hash.c(343) : warning C4090: 'function' : different 'const' qualifiers */ static inline zstr _to_zstr(void *v) { zstr ret; ret.v = v; diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index a3e366fbef..5b80aa54ca 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -196,7 +196,7 @@ static zval *_get_zval_ptr_var_string_offset(const znode *node, const temp_varia /* T->str_offset.str here is always IS_STRING or IS_UNICODE */ if (Z_TYPE_P(T->str_offset.str) == IS_STRING) { if (((int)T->str_offset.offset<0) - || (Z_STRLEN_P(T->str_offset.str) <= T->str_offset.offset)) { + || ((unsigned int)Z_STRLEN_P(T->str_offset.str) <= T->str_offset.offset)) { Z_STRVAL_P(ptr) = STR_EMPTY_ALLOC(); Z_STRLEN_P(ptr) = 0; } else { @@ -206,7 +206,7 @@ static zval *_get_zval_ptr_var_string_offset(const znode *node, const temp_varia Z_TYPE_P(ptr) = IS_STRING; } else { if (((int)T->str_offset.offset<0) - || (Z_USTRCPLEN_P(T->str_offset.str) <= T->str_offset.offset)) { + || ((unsigned int)Z_USTRCPLEN_P(T->str_offset.str) <= T->str_offset.offset)) { Z_USTRVAL_P(ptr) = USTR_MAKE(""); Z_USTRLEN_P(ptr) = 0; } else { @@ -659,7 +659,7 @@ static inline int zend_assign_to_string_offset(const temp_variable *T, const zva return 0; } - if (T->str_offset.offset >= Z_STRLEN_P(T->str_offset.str)) { + if (T->str_offset.offset >= (unsigned int)Z_STRLEN_P(T->str_offset.str)) { Z_STRVAL_P(T->str_offset.str) = (char *) erealloc(Z_STRVAL_P(T->str_offset.str), T->str_offset.offset+1+1); memset(Z_STRVAL_P(T->str_offset.str) + Z_STRLEN_P(T->str_offset.str), ' ', @@ -696,7 +696,7 @@ static inline int zend_assign_to_string_offset(const temp_variable *T, const zva return 0; } - if (T->str_offset.offset >= Z_USTRLEN_P(T->str_offset.str)) { + if (T->str_offset.offset >= (unsigned int)Z_USTRLEN_P(T->str_offset.str)) { Z_USTRVAL_P(T->str_offset.str) = (UChar *) eurealloc(Z_USTRVAL_P(T->str_offset.str), T->str_offset.offset+1+1); u_memset(Z_USTRVAL_P(T->str_offset.str) + Z_USTRLEN_P(T->str_offset.str), ' ', diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index b31b0b798c..785d5b77c2 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -867,7 +867,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS } } - ZEND_VM_STACK_GROW_IF_NEEDED(fci->param_count + 1); + ZEND_VM_STACK_GROW_IF_NEEDED((int)(fci->param_count + 1)); for (i=0; iparam_count; i++) { zval *param; @@ -1806,7 +1806,7 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */ ex->CVs[ex->op_array->this_var] = (zval**)ex->CVs + ex->op_array->last_var + ex->op_array->this_var; *ex->CVs[ex->op_array->this_var] = EG(This); } - for (i = 0; i < ex->op_array->last_var; i++) { + for (i = 0; i < (zend_uint) ex->op_array->last_var; i++) { if (ex->CVs[i]) { zend_u_hash_quick_update(EG(active_symbol_table), type, diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c index be94c6fee8..f51829f8c8 100644 --- a/Zend/zend_indent.c +++ b/Zend/zend_indent.c @@ -30,10 +30,10 @@ #define zendtext LANG_SCNG(yy_text) #define zendleng LANG_SCNG(yy_leng) -static void handle_whitespace(int *emit_whitespace) /* {{{ */ +static void handle_whitespace(unsigned int *emit_whitespace) /* {{{ */ { unsigned char c; - int i; + unsigned int i; for (c=0; c<128; c++) { if (emit_whitespace[c]>0) { @@ -51,9 +51,9 @@ ZEND_API void zend_indent(void) /* {{{ */ zval token; int token_type; int in_string=0; - int nest_level=0; - int emit_whitespace[256]; - int i; + unsigned int nest_level=0; + unsigned int emit_whitespace[256]; + unsigned int i; TSRMLS_FETCH(); memset(emit_whitespace, 0, sizeof(int)*256); diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c index f3cda5f852..76bd1bd7dd 100644 --- a/Zend/zend_ini_scanner.c +++ b/Zend/zend_ini_scanner.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue May 19 08:46:59 2009 */ +/* Generated by re2c 0.13.5 on Wed Jun 03 09:59:17 2009 */ #line 1 "Zend/zend_ini_scanner.l" /* +----------------------------------------------------------------------+ diff --git a/Zend/zend_ini_scanner_defs.h b/Zend/zend_ini_scanner_defs.h index 009725b282..cf972153eb 100644 --- a/Zend/zend_ini_scanner_defs.h +++ b/Zend/zend_ini_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue May 19 08:46:59 2009 */ +/* Generated by re2c 0.13.5 on Wed Jun 03 09:59:17 2009 */ #line 3 "Zend/zend_ini_scanner_defs.h" enum YYCONDTYPE { diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 6ca0c64de6..7198209d73 100755 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -349,7 +349,8 @@ static int zend_implement_traversable(zend_class_entry *interface, zend_class_en /* {{{ zend_implement_aggregate */ static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) { - int i, t = -1; + unsigned int i; + int t = -1; if (class_type->get_iterator) { if (class_type->type == ZEND_INTERNAL_CLASS) { diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index 678ef5082c..7063cadd4e 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Mon May 25 10:34:14 2009 */ +/* Generated by re2c 0.13.5 on Wed Jun 03 09:59:17 2009 */ #line 1 "Zend/zend_language_scanner.l" /* +----------------------------------------------------------------------+ diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h index e3e345bf0b..39fe3282da 100644 --- a/Zend/zend_language_scanner_defs.h +++ b/Zend/zend_language_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Mon May 04 20:02:45 2009 */ +/* Generated by re2c 0.13.5 on Wed Jun 03 09:59:17 2009 */ #line 3 "Zend/zend_language_scanner_defs.h" enum YYCONDTYPE { diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 6cbfe87c1a..bb5cb1b108 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -274,7 +274,9 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t memset(file_handle->handle.stream.mmap.buf + file_handle->handle.stream.mmap.len, 0, ZEND_MMAP_AHEAD); } +#if HAVE_MMAP return_mapped: +#endif file_handle->type = ZEND_HANDLE_MAPPED; file_handle->handle.stream.mmap.pos = 0; file_handle->handle.stream.mmap.old_handle = file_handle->handle.stream.handle; diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index 6df27ee58f..2ead59d9a7 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -506,9 +506,10 @@ static void Bfree(Bigint *v) /* {{{ */ /* return value is only used as a simple string, so mis-aligned parts * inside the Bigint are not at risk on strict align architectures */ -static char * rv_alloc(int i) /* {{{ */ +static char * rv_alloc(unsigned int i) /* {{{ */ { - int j, k, *r; + unsigned int k; + int j, *r; j = sizeof(ULong); for(k = 0; diff --git a/Zend/zend_strtol.c b/Zend/zend_strtol.c index 844c506467..8bbc3db63f 100644 --- a/Zend/zend_strtol.c +++ b/Zend/zend_strtol.c @@ -40,6 +40,12 @@ #include #include +/* Disable false positive warning about LONG_MIN, we could use INT_MIN but requires + too much code changes for no gain. */ +#ifdef PHP_WIN32 +# pragma warning (disable:4146) +#endif + /* long zend_u_strtol (const UChar *nptr, UChar **endptr, int base) {{{ * Convert a Unicode string to a long integer. * diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 5463c45dbd..e1f54d57c6 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -24,6 +24,9 @@ static zend_uchar zend_user_opcodes[256] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1 static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op); +#ifdef PHP_WIN32 +#pragma warning (disable:4101) +#endif #define ZEND_VM_CONTINUE() return 0 #define ZEND_VM_RETURN() return 1 @@ -650,12 +653,12 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER for (i=0; ilast_brk_cont; i++) { if (EX(op_array)->brk_cont_array[i].start < 0) { continue; - } else if (EX(op_array)->brk_cont_array[i].start > op_num) { + } else if ((zend_uint)EX(op_array)->brk_cont_array[i].start > op_num) { /* further blocks will not be relevant... */ break; - } else if (op_num < EX(op_array)->brk_cont_array[i].brk) { + } else if (op_num < (zend_uint)EX(op_array)->brk_cont_array[i].brk) { if (!catched || - catch_op_num >= EX(op_array)->brk_cont_array[i].brk) { + catch_op_num >= (zend_uint)EX(op_array)->brk_cont_array[i].brk) { zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk]; switch (brk_opline->opcode) { @@ -31283,6 +31286,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER(ZEND_OP static int ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_error_noreturn(E_ERROR, "Invalid opcode %d/%d/%d.", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type); + return 0; }