Skip to content

Commit f89f66d

Browse files
committed
removed warning; WS
1 parent 7b44890 commit f89f66d

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

phpdbg_bp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execut
992992

993993
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], &position);
994994
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], (void*)&bp, &position) == SUCCESS;
995-
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], &position)) {
995+
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], &position)) {
996996
zval *retval = NULL;
997997
int orig_interactive = CG(interactive);
998998
zval **orig_retval = EG(return_value_ptr_ptr);

phpdbg_help.c

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ void pretty_print(char *text TSRMLS_DC)
6363

6464
/* First pass calculates a safe size for the pretty print version */
6565
for (p = text; *p; p++) {
66-
if ( UNEXPECTED(p[0] == '*') && p[1] == '*' ) {
66+
if (UNEXPECTED(p[0] == '*') && p[1] == '*') {
6767
size += bold_escape_len - 2;
6868
p++;
69-
} else if ( UNEXPECTED(p[0] == '$') && p[1] == 'P' ) {
69+
} else if (UNEXPECTED(p[0] == '$') && p[1] == 'P') {
7070
size += prompt_escape_len - 2;
7171
p++;
72-
} else if ( UNEXPECTED(p[0] == '\\') ) {
72+
} else if (UNEXPECTED(p[0] == '\\')) {
7373
p++;
7474
}
7575
}
@@ -87,29 +87,29 @@ void pretty_print(char *text TSRMLS_DC)
8787
* first blank.
8888
*/
8989
for (p = text, q = new; *p; p++) {
90-
if ( UNEXPECTED(*p == ' ') ) {
90+
if (UNEXPECTED(*p == ' ')) {
9191
last_new_blank = q;
9292
last_blank_count = line_count++;
9393
*q++ = ' ';
94-
} else if ( UNEXPECTED(*p == '\n') ) {
94+
} else if (UNEXPECTED(*p == '\n')) {
9595
last_new_blank = NULL;
9696
*q++ = *p;
9797
last_blank_count = 0;
9898
line_count = 0;
99-
} else if ( UNEXPECTED(p[0] == '*') && p[1] == '*' ) {
99+
} else if (UNEXPECTED(p[0] == '*') && p[1] == '*') {
100100
if (bold_escape_len) {
101101
in_bold = !in_bold;
102102
memcpy (q, in_bold ? bold_on_escape : bold_off_escape, bold_escape_len);
103103
q += bold_escape_len;
104104
/* bold on/off has zero print width so line count is unchanged */
105105
}
106106
p++;
107-
} else if ( UNEXPECTED(p[0] == '$') && p[1] == 'P' ) {
107+
} else if (UNEXPECTED(p[0] == '$') && p[1] == 'P') {
108108
memcpy (q, prompt_escape, prompt_escape_len);
109109
q += prompt_escape_len;
110110
line_count += prompt_len;
111111
p++;
112-
} else if ( UNEXPECTED(p[0] == '\\') ) {
112+
} else if (UNEXPECTED(p[0] == '\\')) {
113113
p++;
114114
*q++ = *p;
115115
line_count++;
@@ -131,16 +131,15 @@ void pretty_print(char *text TSRMLS_DC)
131131
phpdbg_error("Output overrun of %lu bytes", ((q-new) - size));
132132
}
133133

134-
(void) phpdbg_write("%s\n", new);
134+
phpdbg_write("%s\n", new);
135135
efree(new);
136136
} /* }}} */
137137

138138
/* {{{ summary_print. Print a summary line giving, the command, its alias and tip */
139139
void summary_print(phpdbg_command_t const * const cmd TSRMLS_DC)
140140
{
141141
char *summary;
142-
spprintf(&summary, 0, "Command: **%s** Alias: **%c** **%s**\n",
143-
cmd->name, cmd->alias, cmd->tip);
142+
spprintf(&summary, 0, "Command: **%s** Alias: **%c** **%s**\n", cmd->name, cmd->alias, cmd->tip);
144143
pretty_print(summary TSRMLS_CC);
145144
efree(summary);
146145
}
@@ -172,10 +171,10 @@ static char *get_help(const char * const key TSRMLS_DC)
172171
* will be used to generate a help message but non-unique one will be used to list alternatives.
173172
*/
174173
static int get_command(
175-
const char *key, size_t len, /* pointer and length of key */
176-
phpdbg_command_t const **command, /* address of first matching command */
177-
phpdbg_command_t const * const commands /* command table to be scanned */
178-
TSRMLS_DC)
174+
const char *key, size_t len, /* pointer and length of key */
175+
phpdbg_command_t const **command, /* address of first matching command */
176+
phpdbg_command_t const * commands /* command table to be scanned */
177+
TSRMLS_DC)
179178
{
180179
const phpdbg_command_t *c;
181180
unsigned int num_matches = 0;
@@ -270,18 +269,15 @@ PHPDBG_HELP(aliases) /* {{{ */
270269
for(c_sub = c->subs; c_sub->alias; c_sub++) {
271270
if (c_sub->alias) {
272271
phpdbg_writeln(" %c %c %s %-*s %s",
273-
c->alias, c_sub->alias, c->name, len, c_sub->name, c_sub->tip);
272+
c->alias, c_sub->alias, (char *)c->name, len, c_sub->name, c_sub->tip);
274273
}
275274
}
276275
}
277276
}
278277
}
279278

280279
/* Print out aliases for help as this one comes last, with the added text on how aliases are used */
281-
(void) get_command( "h", 1, & c, phpdbg_prompt_commands TSRMLS_CC);
282-
/* In function ‘phpdbg_do_help_aliases’:
283-
274:2: warning: passing argument 3 of ‘get_command’ from incompatible pointer type [enabled by default]
284-
180:12: note: expected ‘struct phpdbg_command_t **’ but argument is of type ‘const struct phpdbg_command_t **’ */
280+
get_command("h", 1, &c, phpdbg_prompt_commands TSRMLS_CC);
285281
phpdbg_writeln(" %c %-20s %s\n", c->alias, c->name, c->tip);
286282

287283
len = 20 - 1 - c->name_len;

phpdbg_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#ifdef _WIN32
3232
# include "win32/time.h"
3333
#elif defined(HAVE_SYS_IOCTL_H)
34-
# include "sys/ioctl.h"
34+
# include "sys/ioctl.h"
3535
#endif
3636

3737
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
@@ -391,7 +391,7 @@ PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */
391391
PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D) /* {{{ */
392392
{
393393
int columns;
394-
#ifdef _win32
394+
#ifdef _WIN32
395395
CONSOLE_SCREEN_BUFFER_INFO csbi;
396396

397397
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);

0 commit comments

Comments
 (0)