From: Bob Weinand Date: Sat, 11 Oct 2014 22:30:09 +0000 (+0200) Subject: Fix some compiler warnings X-Git-Tag: php-5.6.3RC1~51^2~52^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1486a9ebf7c42120fb5dd3e12a8de44fe1527ed7;p=php Fix some compiler warnings --- diff --git a/phpdbg.h b/phpdbg.h index e567e221fa..a3835f3c06 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -90,6 +90,13 @@ #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 diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c index 3eb4f72234..f649bdecf6 100644 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@ -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; } diff --git a/phpdbg_set.c b/phpdbg_set.c index 7e164995fd..fc7e788fa0 100644 --- a/phpdbg_set.c +++ b/phpdbg_set.c @@ -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; diff --git a/phpdbg_watch.c b/phpdbg_watch.c index af1bcc9715..de6cddf5b3 100644 --- a/phpdbg_watch.c +++ b/phpdbg_watch.c @@ -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) {