]> granicus.if.org Git - php/commitdiff
Fix some compiler warnings
authorBob Weinand <bobwei9@hotmail.com>
Sat, 11 Oct 2014 22:30:09 +0000 (00:30 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Sat, 11 Oct 2014 22:30:09 +0000 (00:30 +0200)
phpdbg.h
phpdbg_cmd.c
phpdbg_set.c
phpdbg_watch.c

index e567e221fa6ea83b397159c579fa6e7c94dbdc51..a3835f3c06470353f4ba5abc6b5e4f714f6bab2c 100644 (file)
--- a/phpdbg.h
+++ b/phpdbg.h
 #define PHPDBG_DEFAULT_PROMPT "prompt>"
 /* }}} */
 
+/* Hey, apple. One shouldn't define *functions* from the standard C library as marcos. */
+#ifdef memcpy
+#define memcpy_tmp(...) memcpy(__VA_ARGS__)
+#undef memcpy
+#define memcpy(...) memcpy_tmp(__VA_ARGS__)
+#endif
+
 #if !defined(PHPDBG_WEBDATA_TRANSFER_H) && !defined(PHPDBG_WEBHELPER_H)
 
 #ifdef ZTS
index 3eb4f722341a6a0d037a778f79e835ed5b26fa01..f649bdecf6dfce4f199dba4b8b41ce03ce574047 100644 (file)
@@ -836,7 +836,7 @@ readline:
 
                                while ((bytes = read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len)) > 0 || (errno == EINTR && bytes < 0)) {
                                        int i;
-                                       if (bytes <= 0) {
+                                       if (bytes <= 0) { 
                                                continue;
                                        }
 
index 7e164995fd95de6c65fe927eeaa44a136a3b3c70..fc7e788fa03a22449448f854eda62f88da924ede 100644 (file)
@@ -215,7 +215,7 @@ PHPDBG_SET(stepping) /* {{{ */
                phpdbg_writeln("setstepping", "type=\"%s\"", "Stepping %s", PHPDBG_G(flags) & PHPDBG_STEP_OPCODE ? "opcode" : "line");
        } else switch (param->type) {
                case STR_PARAM: {
-                       if ((param->len == sizeof("opcode") - 1) && memcmp(param->str, "opcode", sizeof("opcode") == SUCCESS)) {
+                       if ((param->len == sizeof("opcode") - 1) && memcmp(param->str, "opcode", sizeof("opcode")) == SUCCESS) {
                                PHPDBG_G(flags) |= PHPDBG_STEP_OPCODE;
                        } else if ((param->len == sizeof("line")-1) && memcmp(param->str, "line", sizeof("line")) == SUCCESS) {
                                PHPDBG_G(flags) &= ~PHPDBG_STEP_OPCODE;
index af1bcc97155a11dc7c0d907af83a010ddc9e743a..de6cddf5b3cb016160ed88606f94857218147ea8 100644 (file)
@@ -303,7 +303,7 @@ static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname
 }
 
 PHPDBG_API int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *parent, size_t i, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC), zend_bool silent TSRMLS_DC) {
-       phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_watchpoint_parse_wrapper, 0, callback TSRMLS_CC);
+       return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_watchpoint_parse_wrapper, 0, callback TSRMLS_CC);
 }
 
 static int phpdbg_watchpoint_parse_symtables(char *input, size_t len, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC) TSRMLS_DC) {