@@ -63,13 +63,13 @@ void pretty_print(char *text TSRMLS_DC)
63
63
64
64
/* First pass calculates a safe size for the pretty print version */
65
65
for (p = text ; * p ; p ++ ) {
66
- if ( UNEXPECTED (p [0 ] == '*' ) && p [1 ] == '*' ) {
66
+ if (UNEXPECTED (p [0 ] == '*' ) && p [1 ] == '*' ) {
67
67
size += bold_escape_len - 2 ;
68
68
p ++ ;
69
- } else if ( UNEXPECTED (p [0 ] == '$' ) && p [1 ] == 'P' ) {
69
+ } else if (UNEXPECTED (p [0 ] == '$' ) && p [1 ] == 'P' ) {
70
70
size += prompt_escape_len - 2 ;
71
71
p ++ ;
72
- } else if ( UNEXPECTED (p [0 ] == '\\' ) ) {
72
+ } else if (UNEXPECTED (p [0 ] == '\\' )) {
73
73
p ++ ;
74
74
}
75
75
}
@@ -87,29 +87,29 @@ void pretty_print(char *text TSRMLS_DC)
87
87
* first blank.
88
88
*/
89
89
for (p = text , q = new ; * p ; p ++ ) {
90
- if ( UNEXPECTED (* p == ' ' ) ) {
90
+ if (UNEXPECTED (* p == ' ' )) {
91
91
last_new_blank = q ;
92
92
last_blank_count = line_count ++ ;
93
93
* q ++ = ' ' ;
94
- } else if ( UNEXPECTED (* p == '\n' ) ) {
94
+ } else if (UNEXPECTED (* p == '\n' )) {
95
95
last_new_blank = NULL ;
96
96
* q ++ = * p ;
97
97
last_blank_count = 0 ;
98
98
line_count = 0 ;
99
- } else if ( UNEXPECTED (p [0 ] == '*' ) && p [1 ] == '*' ) {
99
+ } else if (UNEXPECTED (p [0 ] == '*' ) && p [1 ] == '*' ) {
100
100
if (bold_escape_len ) {
101
101
in_bold = !in_bold ;
102
102
memcpy (q , in_bold ? bold_on_escape : bold_off_escape , bold_escape_len );
103
103
q += bold_escape_len ;
104
104
/* bold on/off has zero print width so line count is unchanged */
105
105
}
106
106
p ++ ;
107
- } else if ( UNEXPECTED (p [0 ] == '$' ) && p [1 ] == 'P' ) {
107
+ } else if (UNEXPECTED (p [0 ] == '$' ) && p [1 ] == 'P' ) {
108
108
memcpy (q , prompt_escape , prompt_escape_len );
109
109
q += prompt_escape_len ;
110
110
line_count += prompt_len ;
111
111
p ++ ;
112
- } else if ( UNEXPECTED (p [0 ] == '\\' ) ) {
112
+ } else if (UNEXPECTED (p [0 ] == '\\' )) {
113
113
p ++ ;
114
114
* q ++ = * p ;
115
115
line_count ++ ;
@@ -131,16 +131,15 @@ void pretty_print(char *text TSRMLS_DC)
131
131
phpdbg_error ("Output overrun of %lu bytes" , ((q - new ) - size ));
132
132
}
133
133
134
- ( void ) phpdbg_write ("%s\n" , new );
134
+ phpdbg_write ("%s\n" , new );
135
135
efree (new );
136
136
} /* }}} */
137
137
138
138
/* {{{ summary_print. Print a summary line giving, the command, its alias and tip */
139
139
void summary_print (phpdbg_command_t const * const cmd TSRMLS_DC )
140
140
{
141
141
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 );
144
143
pretty_print (summary TSRMLS_CC );
145
144
efree (summary );
146
145
}
@@ -172,10 +171,10 @@ static char *get_help(const char * const key TSRMLS_DC)
172
171
* will be used to generate a help message but non-unique one will be used to list alternatives.
173
172
*/
174
173
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 )
179
178
{
180
179
const phpdbg_command_t * c ;
181
180
unsigned int num_matches = 0 ;
@@ -270,18 +269,15 @@ PHPDBG_HELP(aliases) /* {{{ */
270
269
for (c_sub = c -> subs ; c_sub -> alias ; c_sub ++ ) {
271
270
if (c_sub -> alias ) {
272
271
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 );
274
273
}
275
274
}
276
275
}
277
276
}
278
277
}
279
278
280
279
/* 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 );
285
281
phpdbg_writeln (" %c %-20s %s\n" , c -> alias , c -> name , c -> tip );
286
282
287
283
len = 20 - 1 - c -> name_len ;
0 commit comments