Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed warnings when compiling with -Wall against PHP 5.4

  • Loading branch information...
commit 0e562c9628da0cde7d80cc7628afa68478d05df7 1 parent 6f2bb80
Patrick Allaert authored April 30, 2012
7  usefulstuff.c
@@ -542,8 +542,9 @@ int xdebug_format_output_filename(char **filename, char *format, char *script_na
542 542
 			switch (*format)
543 543
 			{
544 544
 				case 'c': /* crc32 of the current working directory */
545  
-					VCWD_GETCWD(cwd, 127);
546  
-					xdebug_str_add(&fname, xdebug_sprintf("%lu", xdebug_crc32(cwd, strlen(cwd))), 1);
  545
+					if (VCWD_GETCWD(cwd, 127)) {
  546
+						xdebug_str_add(&fname, xdebug_sprintf("%lu", xdebug_crc32(cwd, strlen(cwd))), 1);
  547
+					}
547 548
 					break;
548 549
 
549 550
 				case 'p': /* pid */
@@ -601,7 +602,7 @@ int xdebug_format_output_filename(char **filename, char *format, char *script_na
601 602
 				case 'R': { /* $_SERVER['REQUEST_URI'] */
602 603
 					zval **data;
603 604
 					char *char_ptr, *strval;
604  
-					int retval;
  605
+					int retval = FAILURE;
605 606
 
606 607
 					if (PG(http_globals)[TRACK_VARS_SERVER]) {
607 608
 						switch (*format) {
19  xdebug.c
@@ -367,6 +367,8 @@ char *xdebug_env_key(TSRMLS_D)
367 367
 	if (ide_key && *ide_key) {
368 368
 		return ide_key;
369 369
 	}
  370
+
  371
+	return NULL;
370 372
 }
371 373
 
372 374
 void xdebug_env_config(TSRMLS_D)
@@ -1081,11 +1083,11 @@ static void add_used_variables(function_stack_entry *fse, zend_op_array *op_arra
1081 1083
 		int cv_len;
1082 1084
 
1083 1085
 		if (op_array->opcodes[i].XDEBUG_TYPE(op1) == IS_CV) {
1084  
-			cv = zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op1,var), &cv_len);
  1086
+			cv = (char *) zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op1,var), &cv_len);
1085 1087
 			xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(cv));
1086 1088
 		}
1087 1089
 		if (op_array->opcodes[i].XDEBUG_TYPE(op2) == IS_CV) {
1088  
-			cv = zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op2,var), &cv_len);
  1090
+			cv = (char *) zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op2,var), &cv_len);
1089 1091
 			xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(cv));
1090 1092
 		}
1091 1093
 		i++;
@@ -1157,9 +1159,9 @@ static void xdebug_throw_exception_hook(zval *exception TSRMLS_DC)
1157 1159
 
1158 1160
 	if (XG(remote_enabled)) {
1159 1161
 		/* Check if we have a breakpoint on this exception */
1160  
-		if (xdebug_hash_find(XG(context).exception_breakpoints, exception_ce->name, strlen(exception_ce->name), (void *) &extra_brk_info)) {
  1162
+		if (xdebug_hash_find(XG(context).exception_breakpoints, (char *) exception_ce->name, strlen(exception_ce->name), (void *) &extra_brk_info)) {
1161 1163
 			if (xdebug_handle_hit_value(extra_brk_info)) {
1162  
-				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))) {
  1164
+				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))) {
1163 1165
 					XG(remote_enabled) = 0;
1164 1166
 				}
1165 1167
 			}
@@ -1319,7 +1321,7 @@ void xdebug_execute(zend_op_array *op_array TSRMLS_DC)
1319 1321
 			!XG(profiler_enabled) &&
1320 1322
 			(XG(profiler_enable) || xdebug_trigger_enabled(XG(profiler_enable_trigger), "XDEBUG_PROFILE" TSRMLS_CC))
1321 1323
 		) {
1322  
-			if (xdebug_profiler_init(op_array->filename TSRMLS_CC) == SUCCESS) {
  1324
+			if (xdebug_profiler_init((char *) op_array->filename TSRMLS_CC) == SUCCESS) {
1323 1325
 				XG(profiler_enabled) = 1;
1324 1326
 			}
1325 1327
 		}
@@ -1445,7 +1447,7 @@ void xdebug_execute_internal(zend_execute_data *current_execute_data, int return
1445 1447
 	int                   function_nr = 0;
1446 1448
 
1447 1449
 	int                   restore_error_handler_situation = 0;
1448  
-	void                (*tmp_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
  1450
+	void                (*tmp_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) = NULL;
1449 1451
 
1450 1452
 	XG(level)++;
1451 1453
 	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
1554 1556
 			break;
1555 1557
 			case SAPI_HEADER_DELETE_ALL:
1556 1558
 				xdebug_llist_empty(XG(headers), NULL);
  1559
+			case SAPI_HEADER_DELETE:
  1560
+			case SAPI_HEADER_SET_STATUS:
  1561
+			break;
1557 1562
 		}
1558 1563
 #else
1559 1564
 		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)
1857 1862
 
1858 1863
 	lineno = EG(current_execute_data)->opline->lineno;
1859 1864
 
1860  
-	file = op_array->filename;
  1865
+	file = (char *) op_array->filename;
1861 1866
 
1862 1867
 	if (XG(do_code_coverage)) {
1863 1868
 		xdebug_count_line(file, lineno, 0, 0 TSRMLS_CC);
8  xdebug_code_coverage.c
@@ -61,7 +61,7 @@ int xdebug_common_override_handler(ZEND_OPCODE_HANDLER_ARGS)
61 61
 		cur_opcode = *EG(opline_ptr);
62 62
 		lineno = cur_opcode->lineno;
63 63
 
64  
-		file = op_array->filename;
  64
+		file = (char *)op_array->filename;
65 65
 
66 66
 		xdebug_count_line(file, lineno, 0, 0 TSRMLS_CC);
67 67
 	}
@@ -221,7 +221,7 @@ static int xdebug_common_assign_dim_handler(char *op, int do_cc, ZEND_OPCODE_HAN
221 221
 
222 222
 	cur_opcode = *EG(opline_ptr);
223 223
 	next_opcode = cur_opcode + 1;
224  
-	file = op_array->filename;
  224
+	file = (char *) op_array->filename;
225 225
 	lineno = cur_opcode->lineno;
226 226
 
227 227
 	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
550 550
 	new_filename = va_arg(args, char*);
551 551
 	if (opa->type == ZEND_USER_FUNCTION) {
552 552
 		if (opa->reserved[XG(reserved_offset)] != (void*) 1 /* && opa->filename && strcmp(opa->filename, new_filename) == 0)*/) {
553  
-			prefill_from_oparray(opa->filename, opa TSRMLS_CC);
  553
+			prefill_from_oparray((char *) opa->filename, opa TSRMLS_CC);
554 554
 		}
555 555
 	}
556 556
 
@@ -578,7 +578,7 @@ static int prefill_from_class_table(zend_class_entry **class_entry XDEBUG_ZEND_H
578 578
 void xdebug_prefill_code_coverage(zend_op_array *op_array TSRMLS_DC)
579 579
 {
580 580
 	if (op_array->reserved[XG(reserved_offset)] != (void*) 1) {
581  
-		prefill_from_oparray(op_array->filename, op_array TSRMLS_CC);
  581
+		prefill_from_oparray((char *) op_array->filename, op_array TSRMLS_CC);
582 582
 	}
583 583
 
584 584
 	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);
4  xdebug_handler_dbgp.c
@@ -302,7 +302,7 @@ inline static char *fetch_classname_from_zval(zval *z, int *length, zend_class_e
302 302
 
303 303
 	tmp_ce = zend_get_class_entry(z TSRMLS_CC);
304 304
 	if (Z_OBJ_HT_P(z)->get_class_name == NULL ||
305  
-		Z_OBJ_HT_P(z)->get_class_name(z, &name, &name_len, 0 TSRMLS_CC) != SUCCESS) {
  305
+		Z_OBJ_HT_P(z)->get_class_name(z, (const char **) &name, &name_len, 0 TSRMLS_CC) != SUCCESS) {
306 306
 
307 307
 		if (!tmp_ce) {
308 308
 			return NULL;
@@ -833,7 +833,7 @@ static xdebug_xml_node* return_stackframe(int nr TSRMLS_DC)
833 833
 		}
834 834
 		xdebug_xml_add_attribute_ex(tmp, "lineno",   xdebug_sprintf("%lu", fse_prev->lineno TSRMLS_CC), 0, 1);
835 835
 	} else {
836  
-		tmp_filename = zend_get_executed_filename(TSRMLS_C);
  836
+		tmp_filename = (char *) zend_get_executed_filename(TSRMLS_C);
837 837
 		tmp_lineno = zend_get_executed_lineno(TSRMLS_C);
838 838
 		if (check_evaled_code(fse, &tmp_filename, &tmp_lineno, 0 TSRMLS_CC)) {
839 839
 			xdebug_xml_add_attribute_ex(tmp, "type", xdstrdup("eval"), 0, 1);
8  xdebug_stack.c
@@ -273,7 +273,7 @@ void xdebug_append_error_description(xdebug_str *str, int html, const char *erro
273 273
 #endif
274 274
 
275 275
 	if (html) {
276  
-		escaped = php_escape_html_entities(buffer, strlen(buffer), &newlen, 0, 0, NULL TSRMLS_CC);
  276
+		escaped = php_escape_html_entities((unsigned char *) buffer, strlen(buffer), &newlen, 0, 0, NULL TSRMLS_CC);
277 277
 	} else {
278 278
 		escaped = estrdup(buffer);
279 279
 	}
@@ -661,7 +661,7 @@ void xdebug_error_cb(int type, const char *error_filename, const uint error_line
661 661
 	if (XG(remote_enabled) && XG(breakpoints_allowed)) {
662 662
 		if (xdebug_hash_find(XG(context).exception_breakpoints, error_type_str, strlen(error_type_str), (void *) &extra_brk_info)) {
663 663
 			if (xdebug_handle_hit_value(extra_brk_info)) {
664  
-				if (!XG(context).handler->remote_breakpoint(&(XG(context)), XG(stack), error_filename, error_lineno, XDEBUG_BREAK, error_type_str, buffer)) {
  664
+				if (!XG(context).handler->remote_breakpoint(&(XG(context)), XG(stack), (char *) error_filename, error_lineno, XDEBUG_BREAK, error_type_str, buffer)) {
665 665
 					XG(remote_enabled) = 0;
666 666
 				}
667 667
 			}
@@ -927,8 +927,8 @@ function_stack_entry *xdebug_add_stack_frame(zend_execute_data *zdata, zend_op_a
927 927
 	zend_op              *cur_opcode;
928 928
 	zval                **param;
929 929
 	int                   i = 0;
930  
-	char                 *aggr_key;
931  
-	int                   aggr_key_len;
  930
+	char                 *aggr_key = NULL;
  931
+	int                   aggr_key_len = 0;
932 932
 
933 933
 	tmp = xdmalloc (sizeof (function_stack_entry));
934 934
 	tmp->var           = NULL;
2  xdebug_superglobals.c
@@ -97,7 +97,7 @@ static int dump_hash_elem_va(void *pDest XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int n
97 97
 	if (hash_key->nKeyLength == 0) {
98 98
 		dump_hash_elem(*((zval **) pDest), name, hash_key->h, NULL, html, str TSRMLS_CC);
99 99
 	} else {
100  
-		dump_hash_elem(*((zval **) pDest), name, 0, hash_key->arKey, html, str TSRMLS_CC);
  100
+		dump_hash_elem(*((zval **) pDest), name, 0, (char *) hash_key->arKey, html, str TSRMLS_CC);
101 101
 	}
102 102
 
103 103
 	return SUCCESS;
59  xdebug_var.c
@@ -213,15 +213,15 @@ zval* xdebug_get_php_symbol(char* name, int name_length)
213 213
 
214 214
 char* xdebug_get_property_info(char *mangled_property, int mangled_len, char **property_name, char **class_name)
215 215
 {
216  
-	char *prop_name, *cls_name;
  216
+	const char *prop_name, *cls_name;
217 217
 
218 218
 #if PHP_VERSION_ID >= 50200
219 219
 	zend_unmangle_property_name(mangled_property, mangled_len - 1, &cls_name, &prop_name);
220 220
 #else
221 221
 	zend_unmangle_property_name(mangled_property, &cls_name, &prop_name);
222 222
 #endif
223  
-	*property_name = prop_name;
224  
-	*class_name = cls_name;
  223
+	*property_name = (char *) prop_name;
  224
+	*class_name = (char *) cls_name;
225 225
 	if (cls_name) {
226 226
 		if (cls_name[0] == '*') {
227 227
 			return "protected";
@@ -303,7 +303,7 @@ static int xdebug_array_element_export(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_D
303 303
 			int newlen = 0;
304 304
 			char *tmp, *tmp2;
305 305
 			
306  
-			tmp = php_str_to_str(hash_key->arKey, hash_key->nKeyLength, "'", 1, "\\'", 2, &newlen);
  306
+			tmp = php_str_to_str((char *) hash_key->arKey, hash_key->nKeyLength, "'", 1, "\\'", 2, &newlen);
307 307
 			tmp2 = php_str_to_str(tmp, newlen - 1, "\0", 1, "\\0", 2, &newlen);
308 308
 			if (tmp) {
309 309
 				efree(tmp);
@@ -345,7 +345,7 @@ static int xdebug_object_element_export(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_
345 345
 		options->runtime[level].current_element_nr < options->runtime[level].end_element_nr)
346 346
 	{
347 347
 		if (hash_key->nKeyLength != 0) {
348  
-			modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name, &prop_class_name);
  348
+			modifier = xdebug_get_property_info((char *) hash_key->arKey, hash_key->nKeyLength, &prop_name, &prop_class_name);
349 349
 			if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) {
350 350
 				xdebug_str_add(str, xdebug_sprintf("%s $%s = ", modifier, prop_name), 1);
351 351
 			} else {
@@ -434,7 +434,7 @@ void xdebug_var_export(zval **struc, xdebug_str *str, int level, int debug_zval,
434 434
 				char *class_name;
435 435
 				zend_uint class_name_len;
436 436
 
437  
-				zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC);
  437
+				zend_get_object_classname(*struc, (const char **) &class_name, &class_name_len TSRMLS_CC);
438 438
 				xdebug_str_add(str, xdebug_sprintf("class %s { ", class_name), 1);
439 439
 
440 440
 				if (level <= options->max_depth) {
@@ -460,7 +460,7 @@ void xdebug_var_export(zval **struc, xdebug_str *str, int level, int debug_zval,
460 460
 		case IS_RESOURCE: {
461 461
 			char *type_name;
462 462
 
463  
-			type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
  463
+			type_name = (char *) zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
464 464
 			xdebug_str_add(str, xdebug_sprintf("resource(%ld) of type (%s)", Z_LVAL_PP(struc), type_name ? type_name : "Unknown"), 1);
465 465
 			break;
466 466
 		}
@@ -532,7 +532,7 @@ static void xdebug_var_synopsis(zval **struc, xdebug_str *str, int level, int de
532 532
 			char *class_name;
533 533
 			zend_uint class_name_len;
534 534
 
535  
-			zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC);
  535
+			zend_get_object_classname(*struc, (const char **) &class_name, &class_name_len TSRMLS_CC);
536 536
 			xdebug_str_add(str, xdebug_sprintf("class %s", class_name), 1);
537 537
 			efree(class_name);
538 538
 			break;
@@ -541,7 +541,7 @@ static void xdebug_var_synopsis(zval **struc, xdebug_str *str, int level, int de
541 541
 		case IS_RESOURCE: {
542 542
 			char *type_name;
543 543
 
544  
-			type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
  544
+			type_name = (char *) zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
545 545
 			xdebug_str_add(str, xdebug_sprintf("resource(%ld) of type (%s)", Z_LVAL_PP(struc), type_name ? type_name : "Unknown"), 1);
546 546
 			break;
547 547
 		}
@@ -614,7 +614,7 @@ static int xdebug_array_element_export_text_ansi(zval **zv XDEBUG_ZEND_HASH_APPL
614 614
 			int newlen = 0;
615 615
 			char *tmp, *tmp2;
616 616
 			
617  
-			tmp = php_str_to_str(hash_key->arKey, hash_key->nKeyLength, "'", 1, "\\'", 2, &newlen);
  617
+			tmp = php_str_to_str((char *) hash_key->arKey, hash_key->nKeyLength, "'", 1, "\\'", 2, &newlen);
618 618
 			tmp2 = php_str_to_str(tmp, newlen - 1, "\0", 1, "\\0", 2, &newlen);
619 619
 			if (tmp) {
620 620
 				efree(tmp);
@@ -657,7 +657,7 @@ static int xdebug_object_element_export_text_ansi(zval **zv XDEBUG_ZEND_HASH_APP
657 657
 		xdebug_str_add(str, xdebug_sprintf("%*s", (level * 2), ""), 1);
658 658
 
659 659
 		if (hash_key->nKeyLength != 0) {
660  
-			modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name, &class_name);
  660
+			modifier = xdebug_get_property_info((char *) hash_key->arKey, hash_key->nKeyLength, &prop_name, &class_name);
661 661
 			xdebug_str_add(str, xdebug_sprintf("%s%s%s%s%s $%s %s=>%s\n",
662 662
 			               ANSI_COLOR_MODIFIER, ANSI_COLOR_BOLD, modifier, ANSI_COLOR_BOLD_OFF, ANSI_COLOR_RESET, 
663 663
 			               prop_name, ANSI_COLOR_POINTER, ANSI_COLOR_RESET), 1);
@@ -745,7 +745,7 @@ void xdebug_var_export_text_ansi(zval **struc, xdebug_str *str, int mode, int le
745 745
 				char *class_name;
746 746
 				zend_uint class_name_len;
747 747
 
748  
-				zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC);
  748
+				zend_get_object_classname(*struc, (const char **) &class_name, &class_name_len TSRMLS_CC);
749 749
 				xdebug_str_add(str, xdebug_sprintf("%sclass%s %s%s%s#%d (%s%d%s) {\n", ANSI_COLOR_BOLD, ANSI_COLOR_BOLD_OFF, ANSI_COLOR_OBJECT, class_name, ANSI_COLOR_RESET,
750 750
 							Z_OBJ_HANDLE_PP(struc),
751 751
 							ANSI_COLOR_LONG, myht->nNumOfElements, ANSI_COLOR_RESET), 1);
@@ -769,7 +769,7 @@ void xdebug_var_export_text_ansi(zval **struc, xdebug_str *str, int mode, int le
769 769
 		case IS_RESOURCE: {
770 770
 			char *type_name;
771 771
 
772  
-			type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
  772
+			type_name = (char *) zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
773 773
 			xdebug_str_add(str, xdebug_sprintf("%sresource%s(%s%ld%s) of type (%s)", ANSI_COLOR_BOLD, ANSI_COLOR_BOLD_OFF, 
774 774
 			               ANSI_COLOR_RESOURCE, Z_LVAL_PP(struc), ANSI_COLOR_RESET, type_name ? type_name : "Unknown"), 1);
775 775
 			break;
@@ -843,7 +843,7 @@ static void xdebug_var_synopsis_text_ansi(zval **struc, xdebug_str *str, int mod
843 843
 			char *class_name;
844 844
 			zend_uint class_name_len;
845 845
 
846  
-			zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC);
  846
+			zend_get_object_classname(*struc, (const char **) &class_name, &class_name_len TSRMLS_CC);
847 847
 			xdebug_str_add(str, xdebug_sprintf("class %s", class_name), 1);
848 848
 			break;
849 849
 		}
@@ -851,7 +851,7 @@ static void xdebug_var_synopsis_text_ansi(zval **struc, xdebug_str *str, int mod
851 851
 		case IS_RESOURCE: {
852 852
 			char *type_name;
853 853
 
854  
-			type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
  854
+			type_name = (char *) zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
855 855
 			xdebug_str_add(str, xdebug_sprintf("resource(%s%ld%s) of type (%s)", ANSI_COLOR_LONG, Z_LVAL_PP(struc), ANSI_COLOR_RESET, type_name ? type_name : "Unknown"), 1);
856 856
 			break;
857 857
 		}
@@ -894,11 +894,6 @@ typedef struct
894 894
 	zval *zv;
895 895
 } xdebug_object_item;
896 896
 
897  
-static void xdebug_hash_object_item_dtor(void *data)
898  
-{
899  
-	xdfree(data);
900  
-}
901  
-
902 897
 static int object_item_add_to_merged_hash(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
903 898
 {
904 899
 	HashTable          *merged;
@@ -911,7 +906,7 @@ static int object_item_add_to_merged_hash(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRML
911 906
 	item = xdmalloc(sizeof(xdebug_object_item));
912 907
 	item->type = object_type;
913 908
 	item->zv   = *zv;
914  
-	item->name = hash_key->arKey;
  909
+	item->name = (char *) hash_key->arKey;
915 910
 	item->name_len = hash_key->nKeyLength;
916 911
 
917 912
 	zend_hash_next_index_insert(merged, &item, sizeof(xdebug_object_item*), NULL);
@@ -934,7 +929,7 @@ static int object_item_add_zend_prop_to_merged_hash(zend_property_info *zpp XDEB
934 929
 	item = xdmalloc(sizeof(xdebug_object_item));
935 930
 	item->type = object_type;
936 931
 	item->zv   = ce->static_members_table[zpp->offset];
937  
-	item->name = zpp->name;
  932
+	item->name = (char *) zpp->name;
938 933
 	item->name_len = zpp->name_length;
939 934
 
940 935
 	zend_hash_next_index_insert(merged, &item, sizeof(xdebug_object_item*), NULL);
@@ -1097,7 +1092,7 @@ void xdebug_attach_property_with_contents(zend_property_info *prop_info XDEBUG_Z
1097 1092
 	}
1098 1093
 
1099 1094
 	(*children_count)++;
1100  
-	modifier = xdebug_get_property_info(prop_info->name, prop_info->name_length, &prop_name, &prop_class_name);
  1095
+	modifier = xdebug_get_property_info((char *) prop_info->name, prop_info->name_length, &prop_name, &prop_class_name);
1101 1096
 
1102 1097
 	if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) {
1103 1098
 		contents = xdebug_get_zval_value_xml_node_ex(prop_name, class_entry->static_members_table[prop_info->offset], XDEBUG_VAR_TYPE_STATIC, options TSRMLS_CC);
@@ -1111,14 +1106,14 @@ void xdebug_attach_property_with_contents(zend_property_info *prop_info XDEBUG_Z
1111 1106
 		xdebug_xml_add_attribute_ex(contents, "facet", xdebug_sprintf("static %s", modifier), 0, 1);
1112 1107
 		xdebug_xml_add_child(node, contents);
1113 1108
 	} else {
1114  
-		xdebug_attach_uninitialized_var(node, prop_info->name);
  1109
+		xdebug_attach_uninitialized_var(node, (char *) prop_info->name);
1115 1110
 	}
1116 1111
 }
1117 1112
 #else
1118 1113
 void xdebug_attach_static_var_with_contents(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
1119 1114
 {
1120 1115
 	xdebug_xml_node    *node;
1121  
-	char               *name = hash_key->arKey;
  1116
+	char               *name = (char *) hash_key->arKey;
1122 1117
 	char               *modifier;
1123 1118
 	xdebug_xml_node    *contents = NULL;
1124 1119
 	char               *class_name;
@@ -1151,7 +1146,7 @@ void xdebug_attach_static_var_with_contents(zval **zv XDEBUG_ZEND_HASH_APPLY_TSR
1151 1146
 }
1152 1147
 #endif
1153 1148
 
1154  
-int xdebug_attach_static_vars(xdebug_xml_node *node, xdebug_var_export_options *options, zend_class_entry *ce TSRMLS_DC)
  1149
+void xdebug_attach_static_vars(xdebug_xml_node *node, xdebug_var_export_options *options, zend_class_entry *ce TSRMLS_DC)
1155 1150
 {
1156 1151
 #if PHP_VERSION_ID >= 50400
1157 1152
 	HashTable        *static_members = &ce->properties_info;
@@ -1249,7 +1244,7 @@ void xdebug_var_export_xml_node(zval **struc, char *name, xdebug_xml_node *node,
1249 1244
 			ALLOC_HASHTABLE(merged_hash);
1250 1245
 			zend_hash_init(merged_hash, 128, NULL, NULL, 0);
1251 1246
 
1252  
-			zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC);
  1247
+			zend_get_object_classname(*struc, (const char **) &class_name, &class_name_len TSRMLS_CC);
1253 1248
 			ce = zend_fetch_class(class_name, strlen(class_name), ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
1254 1249
 
1255 1250
 #if PHP_VERSION_ID >= 50400
@@ -1301,7 +1296,7 @@ void xdebug_var_export_xml_node(zval **struc, char *name, xdebug_xml_node *node,
1301 1296
 			char *type_name;
1302 1297
 
1303 1298
 			xdebug_xml_add_attribute(node, "type", "resource");
1304  
-			type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
  1299
+			type_name = (char *) zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
1305 1300
 			xdebug_xml_add_text(node, xdebug_sprintf("resource id='%ld' type='%s'", Z_LVAL_PP(struc), type_name ? type_name : "Unknown"));
1306 1301
 			break;
1307 1302
 		}
@@ -1383,7 +1378,7 @@ static int xdebug_array_element_export_fancy(zval **zv XDEBUG_ZEND_HASH_APPLY_TS
1383 1378
 			xdebug_str_add(str, xdebug_sprintf("%ld <font color='%s'>=&gt;</font> ", hash_key->h, COLOR_POINTER), 1);
1384 1379
 		} else { /* string key */
1385 1380
 			xdebug_str_addl(str, "'", 1, 0);
1386  
-			tmp_str = xdebug_xmlize(hash_key->arKey, hash_key->nKeyLength - 1, &newlen);
  1381
+			tmp_str = xdebug_xmlize((char *) hash_key->arKey, hash_key->nKeyLength - 1, &newlen);
1387 1382
 			xdebug_str_addl(str, tmp_str, newlen, 0);
1388 1383
 			efree(tmp_str);
1389 1384
 			xdebug_str_add(str, xdebug_sprintf("' <font color='%s'>=&gt;</font> ", COLOR_POINTER), 1);
@@ -1420,7 +1415,7 @@ static int xdebug_object_element_export_fancy(zval **zv XDEBUG_ZEND_HASH_APPLY_T
1420 1415
 		xdebug_str_add(str, xdebug_sprintf("%*s", (level * 4) - 2, ""), 1);
1421 1416
 
1422 1417
 		if (hash_key->nKeyLength != 0) {
1423  
-			modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name, &prop_class_name);
  1418
+			modifier = xdebug_get_property_info((char *) hash_key->arKey, hash_key->nKeyLength, &prop_name, &prop_class_name);
1424 1419
 			if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) {
1425 1420
 				xdebug_str_add(str, xdebug_sprintf("<i>%s</i> '%s' <font color='%s'>=&gt;</font> ", modifier, prop_name, COLOR_POINTER), 1);
1426 1421
 			} else {
@@ -1531,7 +1526,7 @@ void xdebug_var_export_fancy(zval **struc, xdebug_str *str, int level, int debug
1531 1526
 		case IS_RESOURCE: {
1532 1527
 			char *type_name;
1533 1528
 
1534  
-			type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
  1529
+			type_name = (char *) zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
1535 1530
 			xdebug_str_add(str, xdebug_sprintf("<b>resource</b>(<i>%ld</i><font color='%s'>,</font> <i>%s</i>)", Z_LVAL_PP(struc), COLOR_RESOURCE, type_name ? type_name : "Unknown"), 1);
1536 1531
 			break;
1537 1532
 		}
@@ -1610,7 +1605,7 @@ static void xdebug_var_synopsis_fancy(zval **struc, xdebug_str *str, int level,
1610 1605
 		case IS_RESOURCE: {
1611 1606
 			char *type_name;
1612 1607
 
1613  
-			type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
  1608
+			type_name = (char *) zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
1614 1609
 			xdebug_str_add(str, xdebug_sprintf("<font color='%s'>resource(%ld, %s)</font>", COLOR_RESOURCE, Z_LVAL_PP(struc), type_name ? type_name : "Unknown"), 1);
1615 1610
 			break;
1616 1611
 		}
2  xdebug_var.h
@@ -72,7 +72,7 @@ char* xdebug_get_zval_value_text_ansi(zval *val, int mode, int debug_zval, xdebu
72 72
 char* xdebug_get_zval_value_xml(char *name, zval *val);
73 73
 char* xdebug_get_zval_value_fancy(char *name, zval *val, int *len, int debug_zval, xdebug_var_export_options *options TSRMLS_DC);
74 74
 
75  
-int xdebug_attach_static_vars(xdebug_xml_node *node, xdebug_var_export_options *options, zend_class_entry *ce TSRMLS_DC);
  75
+void xdebug_attach_static_vars(xdebug_xml_node *node, xdebug_var_export_options *options, zend_class_entry *ce TSRMLS_DC);
76 76
 void xdebug_attach_uninitialized_var(xdebug_xml_node *node, char *name);
77 77
 void xdebug_attach_static_var_with_contents(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
78 78
 #define xdebug_get_zval_value_xml_node(name, val, options) xdebug_get_zval_value_xml_node_ex(name, val, XDEBUG_VAR_TYPE_NORMAL, options)

0 notes on commit 0e562c9

Please sign in to comment.
Something went wrong with that request. Please try again.