summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-01-29 11:59:37 +0800
committerXinchen Hui <laruence@php.net>2015-01-29 11:59:37 +0800
commita1d9ceac7adb411e2b54ad8bd993c28261d5ae85 (patch)
treee4736be8c87731230d4759b8909801878623c7ad
parente727d640f70aa7092c7274343d02873eb174ef1b (diff)
downloadphp-git-a1d9ceac7adb411e2b54ad8bd993c28261d5ae85.tar.gz
Fixed annoying warnings
-rw-r--r--Zend/zend_inheritance.c2
-rw-r--r--ext/opcache/Optimizer/zend_optimizer_internal.h15
2 files changed, 13 insertions, 4 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index ab188f2cfb..d02e1ab42c 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -212,7 +212,7 @@ static zend_function *do_inherit_method(zend_function *old_function, zend_class_
}
/* }}} */
-static int zend_do_perform_type_hint_check(zend_function *fe, zend_arg_info *fe_arg_info, zend_function *proto, zend_arg_info *proto_arg_info) /* {{{ */
+static int zend_do_perform_type_hint_check(const zend_function *fe, zend_arg_info *fe_arg_info, const zend_function *proto, zend_arg_info *proto_arg_info) /* {{{ */
{
if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) {
/* Only one has a type hint and the other one doesn't */
diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h
index cff6b7fb3e..2bdffcaac3 100644
--- a/ext/opcache/Optimizer/zend_optimizer_internal.h
+++ b/ext/opcache/Optimizer/zend_optimizer_internal.h
@@ -32,10 +32,19 @@
#define INV_COND_EX(op) ((op) == ZEND_JMPZ ? ZEND_JMPNZ_EX : ZEND_JMPZ_EX)
#define INV_EX_COND_EX(op) ((op) == ZEND_JMPZ_EX ? ZEND_JMPNZ_EX : ZEND_JMPZ_EX)
-#define MAKE_NOP(opline) { (opline)->opcode = ZEND_NOP; memset(&(opline)->result, 0, sizeof((opline)->result)); memset(&(opline)->op1, 0, sizeof((opline)->op1)); memset(&(opline)->op2, 0, sizeof((opline)->op2));(opline)->result_type=(opline)->op1_type=(opline)->op2_type=IS_UNUSED; (opline)->handler = zend_opcode_handlers[ZEND_NOP]; }
-#define RESULT_USED(op) (((op->result_type & IS_VAR) && !(op->result_type & EXT_TYPE_UNUSED)) || op->result_type == IS_TMP_VAR)
+#undef MAKE_NOP
+
+#define MAKE_NOP(opline) do { \
+ (opline)->opcode = ZEND_NOP; \
+ memset(&(opline)->result, 0, sizeof((opline)->result)); \
+ memset(&(opline)->op1, 0, sizeof((opline)->op1)); \
+ memset(&(opline)->op2, 0, sizeof((opline)->op2)); \
+ (opline)->result_type = (opline)->op1_type = (opline)->op2_type=IS_UNUSED; \
+ (opline)->handler = zend_opcode_handlers[ZEND_NOP]; \
+} while (0);
+#define RESULT_USED(op) (((op->result_type & IS_VAR) && !(op->result_type & EXT_TYPE_UNUSED)) || op->result_type == IS_TMP_VAR)
#define RESULT_UNUSED(op) ((op->result_type & EXT_TYPE_UNUSED) != 0)
-#define SAME_VAR(op1, op2) ((((op1 ## _type & IS_VAR) && (op2 ## _type & IS_VAR)) || (op1 ## _type == IS_TMP_VAR && op2 ## _type == IS_TMP_VAR)) && op1.var == op2.var)
+#define SAME_VAR(op1, op2) ((((op1 ## _type & IS_VAR) && (op2 ## _type & IS_VAR)) || (op1 ## _type == IS_TMP_VAR && op2 ## _type == IS_TMP_VAR)) && op1.var == op2.var)
typedef struct _zend_optimizer_ctx {
zend_arena *arena;