Permalink
Browse files

Fixed warnings when compiling with -Wall against PHP 5.4

  • Loading branch information...
1 parent 6f2bb80 commit 0e562c9628da0cde7d80cc7628afa68478d05df7 @patrickallaert patrickallaert committed Apr 30, 2012
Showing with 55 additions and 54 deletions.
  1. +4 −3 usefulstuff.c
  2. +12 −7 xdebug.c
  3. +4 −4 xdebug_code_coverage.c
  4. +2 −2 xdebug_handler_dbgp.c
  5. +4 −4 xdebug_stack.c
  6. +1 −1 xdebug_superglobals.c
  7. +27 −32 xdebug_var.c
  8. +1 −1 xdebug_var.h
View
@@ -542,8 +542,9 @@ int xdebug_format_output_filename(char **filename, char *format, char *script_na
switch (*format)
{
case 'c': /* crc32 of the current working directory */
- VCWD_GETCWD(cwd, 127);
- xdebug_str_add(&fname, xdebug_sprintf("%lu", xdebug_crc32(cwd, strlen(cwd))), 1);
+ if (VCWD_GETCWD(cwd, 127)) {
+ xdebug_str_add(&fname, xdebug_sprintf("%lu", xdebug_crc32(cwd, strlen(cwd))), 1);
+ }
break;
case 'p': /* pid */
@@ -601,7 +602,7 @@ int xdebug_format_output_filename(char **filename, char *format, char *script_na
case 'R': { /* $_SERVER['REQUEST_URI'] */
zval **data;
char *char_ptr, *strval;
- int retval;
+ int retval = FAILURE;
if (PG(http_globals)[TRACK_VARS_SERVER]) {
switch (*format) {
View
@@ -367,6 +367,8 @@ char *xdebug_env_key(TSRMLS_D)
if (ide_key && *ide_key) {
return ide_key;
}
+
+ return NULL;
}
void xdebug_env_config(TSRMLS_D)
@@ -1081,11 +1083,11 @@ static void add_used_variables(function_stack_entry *fse, zend_op_array *op_arra
int cv_len;
if (op_array->opcodes[i].XDEBUG_TYPE(op1) == IS_CV) {
- cv = zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op1,var), &cv_len);
+ cv = (char *) zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op1,var), &cv_len);
xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(cv));
}
if (op_array->opcodes[i].XDEBUG_TYPE(op2) == IS_CV) {
- cv = zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op2,var), &cv_len);
+ cv = (char *) zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op2,var), &cv_len);
xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(cv));
}
i++;
@@ -1157,9 +1159,9 @@ static void xdebug_throw_exception_hook(zval *exception TSRMLS_DC)
if (XG(remote_enabled)) {
/* Check if we have a breakpoint on this exception */
- if (xdebug_hash_find(XG(context).exception_breakpoints, exception_ce->name, strlen(exception_ce->name), (void *) &extra_brk_info)) {
+ if (xdebug_hash_find(XG(context).exception_breakpoints, (char *) exception_ce->name, strlen(exception_ce->name), (void *) &extra_brk_info)) {
if (xdebug_handle_hit_value(extra_brk_info)) {
- if (!XG(context).handler->remote_breakpoint(&(XG(context)), XG(stack), Z_STRVAL_P(file), Z_LVAL_P(line), XDEBUG_BREAK, exception_ce->name, Z_STRVAL_P(message))) {
+ if (!XG(context).handler->remote_breakpoint(&(XG(context)), XG(stack), Z_STRVAL_P(file), Z_LVAL_P(line), XDEBUG_BREAK, (char *) exception_ce->name, Z_STRVAL_P(message))) {
XG(remote_enabled) = 0;
}
}
@@ -1319,7 +1321,7 @@ void xdebug_execute(zend_op_array *op_array TSRMLS_DC)
!XG(profiler_enabled) &&
(XG(profiler_enable) || xdebug_trigger_enabled(XG(profiler_enable_trigger), "XDEBUG_PROFILE" TSRMLS_CC))
) {
- if (xdebug_profiler_init(op_array->filename TSRMLS_CC) == SUCCESS) {
+ if (xdebug_profiler_init((char *) op_array->filename TSRMLS_CC) == SUCCESS) {
XG(profiler_enabled) = 1;
}
}
@@ -1445,7 +1447,7 @@ void xdebug_execute_internal(zend_execute_data *current_execute_data, int return
int function_nr = 0;
int restore_error_handler_situation = 0;
- void (*tmp_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
+ void (*tmp_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) = NULL;
XG(level)++;
if (XG(level) == XG(max_nesting_level)) {
@@ -1554,6 +1556,9 @@ static int xdebug_header_handler(sapi_header_struct *h XG_SAPI_HEADER_OP_DC, sap
break;
case SAPI_HEADER_DELETE_ALL:
xdebug_llist_empty(XG(headers), NULL);
+ case SAPI_HEADER_DELETE:
+ case SAPI_HEADER_SET_STATUS:
+ break;
}
#else
xdebug_llist_insert_next(XG(headers), XDEBUG_LLIST_TAIL(XG(headers)), xdstrdup(h->header));
@@ -1857,7 +1862,7 @@ ZEND_DLEXPORT void xdebug_statement_call(zend_op_array *op_array)
lineno = EG(current_execute_data)->opline->lineno;
- file = op_array->filename;
+ file = (char *) op_array->filename;
if (XG(do_code_coverage)) {
xdebug_count_line(file, lineno, 0, 0 TSRMLS_CC);
@@ -61,7 +61,7 @@ int xdebug_common_override_handler(ZEND_OPCODE_HANDLER_ARGS)
cur_opcode = *EG(opline_ptr);
lineno = cur_opcode->lineno;
- file = op_array->filename;
+ file = (char *)op_array->filename;
xdebug_count_line(file, lineno, 0, 0 TSRMLS_CC);
}
@@ -221,7 +221,7 @@ static int xdebug_common_assign_dim_handler(char *op, int do_cc, ZEND_OPCODE_HAN
cur_opcode = *EG(opline_ptr);
next_opcode = cur_opcode + 1;
- file = op_array->filename;
+ file = (char *) op_array->filename;
lineno = cur_opcode->lineno;
if (do_cc && XG(do_code_coverage)) {
@@ -550,7 +550,7 @@ static int prefill_from_function_table(zend_op_array *opa XDEBUG_ZEND_HASH_APPLY
new_filename = va_arg(args, char*);
if (opa->type == ZEND_USER_FUNCTION) {
if (opa->reserved[XG(reserved_offset)] != (void*) 1 /* && opa->filename && strcmp(opa->filename, new_filename) == 0)*/) {
- prefill_from_oparray(opa->filename, opa TSRMLS_CC);
+ prefill_from_oparray((char *) opa->filename, opa TSRMLS_CC);
}
}
@@ -578,7 +578,7 @@ static int prefill_from_class_table(zend_class_entry **class_entry XDEBUG_ZEND_H
void xdebug_prefill_code_coverage(zend_op_array *op_array TSRMLS_DC)
{
if (op_array->reserved[XG(reserved_offset)] != (void*) 1) {
- prefill_from_oparray(op_array->filename, op_array TSRMLS_CC);
+ prefill_from_oparray((char *) op_array->filename, op_array TSRMLS_CC);
}
zend_hash_apply_with_arguments(CG(function_table) XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) prefill_from_function_table, 1, op_array->filename);
@@ -302,7 +302,7 @@ inline static char *fetch_classname_from_zval(zval *z, int *length, zend_class_e
tmp_ce = zend_get_class_entry(z TSRMLS_CC);
if (Z_OBJ_HT_P(z)->get_class_name == NULL ||
- Z_OBJ_HT_P(z)->get_class_name(z, &name, &name_len, 0 TSRMLS_CC) != SUCCESS) {
+ Z_OBJ_HT_P(z)->get_class_name(z, (const char **) &name, &name_len, 0 TSRMLS_CC) != SUCCESS) {
if (!tmp_ce) {
return NULL;
@@ -833,7 +833,7 @@ static xdebug_xml_node* return_stackframe(int nr TSRMLS_DC)
}
xdebug_xml_add_attribute_ex(tmp, "lineno", xdebug_sprintf("%lu", fse_prev->lineno TSRMLS_CC), 0, 1);
} else {
- tmp_filename = zend_get_executed_filename(TSRMLS_C);
+ tmp_filename = (char *) zend_get_executed_filename(TSRMLS_C);
tmp_lineno = zend_get_executed_lineno(TSRMLS_C);
if (check_evaled_code(fse, &tmp_filename, &tmp_lineno, 0 TSRMLS_CC)) {
xdebug_xml_add_attribute_ex(tmp, "type", xdstrdup("eval"), 0, 1);
View
@@ -273,7 +273,7 @@ void xdebug_append_error_description(xdebug_str *str, int html, const char *erro
#endif
if (html) {
- escaped = php_escape_html_entities(buffer, strlen(buffer), &newlen, 0, 0, NULL TSRMLS_CC);
+ escaped = php_escape_html_entities((unsigned char *) buffer, strlen(buffer), &newlen, 0, 0, NULL TSRMLS_CC);
} else {
escaped = estrdup(buffer);
}
@@ -661,7 +661,7 @@ void xdebug_error_cb(int type, const char *error_filename, const uint error_line
if (XG(remote_enabled) && XG(breakpoints_allowed)) {
if (xdebug_hash_find(XG(context).exception_breakpoints, error_type_str, strlen(error_type_str), (void *) &extra_brk_info)) {
if (xdebug_handle_hit_value(extra_brk_info)) {
- if (!XG(context).handler->remote_breakpoint(&(XG(context)), XG(stack), error_filename, error_lineno, XDEBUG_BREAK, error_type_str, buffer)) {
+ if (!XG(context).handler->remote_breakpoint(&(XG(context)), XG(stack), (char *) error_filename, error_lineno, XDEBUG_BREAK, error_type_str, buffer)) {
XG(remote_enabled) = 0;
}
}
@@ -927,8 +927,8 @@ function_stack_entry *xdebug_add_stack_frame(zend_execute_data *zdata, zend_op_a
zend_op *cur_opcode;
zval **param;
int i = 0;
- char *aggr_key;
- int aggr_key_len;
+ char *aggr_key = NULL;
+ int aggr_key_len = 0;
tmp = xdmalloc (sizeof (function_stack_entry));
tmp->var = NULL;
@@ -97,7 +97,7 @@ static int dump_hash_elem_va(void *pDest XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int n
if (hash_key->nKeyLength == 0) {
dump_hash_elem(*((zval **) pDest), name, hash_key->h, NULL, html, str TSRMLS_CC);
} else {
- dump_hash_elem(*((zval **) pDest), name, 0, hash_key->arKey, html, str TSRMLS_CC);
+ dump_hash_elem(*((zval **) pDest), name, 0, (char *) hash_key->arKey, html, str TSRMLS_CC);
}
return SUCCESS;
Oops, something went wrong.

0 comments on commit 0e562c9

Please sign in to comment.