]> granicus.if.org Git - php/commitdiff
- silent compilation warnings (no MFH yet)
authorPierre Joye <pajoye@php.net>
Mon, 15 Jun 2009 14:06:30 +0000 (14:06 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 15 Jun 2009 14:06:30 +0000 (14:06 +0000)
13 files changed:
Zend/zend.h
Zend/zend_execute.c
Zend/zend_execute_API.c
Zend/zend_indent.c
Zend/zend_ini_scanner.c
Zend/zend_ini_scanner_defs.h
Zend/zend_interfaces.c
Zend/zend_language_scanner.c
Zend/zend_language_scanner_defs.h
Zend/zend_stream.c
Zend/zend_strtod.c
Zend/zend_strtol.c
Zend/zend_vm_execute.h

index d5afb46f3f8a789fb3f0954a998624264dc6c9ac..a2288df29d86eb7d8e4e682936979d4c2768cbeb 100644 (file)
@@ -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;
index a3e366fbefda065b4835d788b893e95dd29b22b7..5b80aa54ca07d84291cfba349c631af608075c90 100644 (file)
@@ -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),
                               ' ',
index b31b0b798c023f69d8695b6d8a67e0046e225e12..785d5b77c2233eccdd952746cd37bf26c7a18184 100644 (file)
@@ -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; i<fci->param_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,
index be94c6fee8954dd50a97181fdcf20537737c3457..f51829f8c80cf22f753d5ee3d82b17d03fc190d0 100644 (file)
 #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);
index f3cda5f852d62e31875a0729d27a13b78809c935..76bd1bd7ddc3d3ccb6d10fc870f4575768208bf3 100644 (file)
@@ -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"
 /*
    +----------------------------------------------------------------------+
index 009725b282c3673a3b85cf84b7ec25cf4e02899a..cf972153ebe98f7095025749dbed0fbdce9600e0 100644 (file)
@@ -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 {
index 6ca0c64de69905f4c230c07254311466c5b8063b..7198209d73601962e7f8ec5270140cde4dd6edcd 100755 (executable)
@@ -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) {
index 678ef5082c3c884c4a23270c86848499d52ab55c..7063cadd4eefbdef39f8ae9c435823fa149197ab 100644 (file)
@@ -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"
 /*
    +----------------------------------------------------------------------+
index e3e345bf0b9b2eac10833d412d2454b2565db501..39fe3282da759cb861e6d63f792fb07f6e81892f 100644 (file)
@@ -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 {
index 6cbfe87c1ab0c16c3ac6c031ec6b90dc301bc6ec..bb5cb1b1085a1bdf8e9890e355e1bc9e6240ffce 100644 (file)
@@ -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;
index 6df27ee58f53befc87a191fbf2af103b394aba0d..2ead59d9a7bcc6e29ed4494550bf903e4b93c90d 100644 (file)
@@ -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;
index 844c5064677f476cffa3475693c89b0445dcb210..8bbc3db63f53e4a70093a5ffa214d7760d2f691a 100644 (file)
 #include <unicode/utypes.h>
 #include <unicode/uchar.h>
 
+/* 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.
  *
index 5463c45dbd1674ac56966f22eca56a93b4c40c0c..e1f54d57c646dca58f86c72dbfb1bd4cd7bac5d8 100644 (file)
@@ -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; i<EX(op_array)->last_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;
 }