Skip to content

Commit

Permalink
Get rid of length argument, as it's not used anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Oct 11, 2015
1 parent ab70e95 commit 2926bbd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions xdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -2250,12 +2250,12 @@ PHP_FUNCTION(xdebug_debug_zval)
if (Z_TYPE(args[i]) == IS_STRING) {
XG(active_symbol_table) = EG(current_execute_data)->prev_execute_data->symbol_table;
XG(active_execute_data) = EG(current_execute_data)->prev_execute_data;
debugzval = xdebug_get_php_symbol(Z_STRVAL(args[i]), Z_STRLEN(args[i]) + 1 TSRMLS_CC);
debugzval = xdebug_get_php_symbol(Z_STRVAL(args[i]) TSRMLS_CC);
php_printf("%s: ", Z_STRVAL(args[i]));
#else
if (Z_TYPE_PP(args[i]) == IS_STRING) {
XG(active_symbol_table) = EG(active_symbol_table);
debugzval = xdebug_get_php_symbol(Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i]) + 1 TSRMLS_CC);
debugzval = xdebug_get_php_symbol(Z_STRVAL_PP(args[i]) TSRMLS_CC);
php_printf("%s: ", Z_STRVAL_PP(args[i]));
#endif
if (debugzval) {
Expand Down Expand Up @@ -2321,12 +2321,12 @@ PHP_FUNCTION(xdebug_debug_zval_stdout)
#if PHP_VERSION_ID >= 70000
if (Z_TYPE(args[i]) == IS_STRING) {
XG(active_symbol_table) = EG(current_execute_data)->symbol_table;
debugzval = xdebug_get_php_symbol(Z_STRVAL(args[i]), Z_STRLEN(args[i]) + 1 TSRMLS_CC);
debugzval = xdebug_get_php_symbol(Z_STRVAL(args[i]) TSRMLS_CC);
printf("%s: ", Z_STRVAL(args[i]));
#else
if (Z_TYPE_PP(args[i]) == IS_STRING) {
XG(active_symbol_table) = EG(active_symbol_table);
debugzval = xdebug_get_php_symbol(Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i]) + 1 TSRMLS_CC);
debugzval = xdebug_get_php_symbol(Z_STRVAL_PP(args[i]) TSRMLS_CC);
printf("%s: ", Z_STRVAL_PP(args[i]));
#endif
if (debugzval) {
Expand Down
44 changes: 22 additions & 22 deletions xdebug_handler_dbgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ static void send_message(xdebug_con *context, xdebug_xml_node *message TSRMLS_DC
xdebug_str_ptr_dtor(tmp);
}

static xdebug_xml_node* get_symbol(char* name, int name_length, xdebug_var_export_options *options TSRMLS_DC)
static xdebug_xml_node* get_symbol(char* name, xdebug_var_export_options *options TSRMLS_DC)
{
zval *retval;

retval = xdebug_get_php_symbol(name, name_length TSRMLS_CC);
retval = xdebug_get_php_symbol(name TSRMLS_CC);
#if PHP_VERSION_ID >= 70000
if (retval && Z_TYPE_P(retval) != IS_UNDEF) {
#else
Expand All @@ -283,11 +283,11 @@ static xdebug_xml_node* get_symbol(char* name, int name_length, xdebug_var_expor
return NULL;
}

static int get_symbol_contents(char* name, int name_length, xdebug_xml_node *node, xdebug_var_export_options *options TSRMLS_DC)
static int get_symbol_contents(char* name, xdebug_xml_node *node, xdebug_var_export_options *options TSRMLS_DC)
{
zval *retval;

retval = xdebug_get_php_symbol(name, name_length TSRMLS_CC);
retval = xdebug_get_php_symbol(name TSRMLS_CC);
if (retval) {
xdebug_var_export_xml_node(&retval, name, node, options, 1 TSRMLS_CC);
return 1;
Expand Down Expand Up @@ -1313,11 +1313,11 @@ static int add_constant_node(xdebug_xml_node *node, char *name, zval *const_val,
return FAILURE;
}

static int add_variable_node(xdebug_xml_node *node, char *name, int name_length, int var_only, int non_null, int no_eval, xdebug_var_export_options *options TSRMLS_DC)
static int add_variable_node(xdebug_xml_node *node, char *name, int var_only, int non_null, int no_eval, xdebug_var_export_options *options TSRMLS_DC)
{
xdebug_xml_node *contents;

contents = get_symbol(name, name_length, options TSRMLS_CC);
contents = get_symbol(name, options TSRMLS_CC);
if (contents) {
xdebug_xml_add_child(node, contents);
return SUCCESS;
Expand Down Expand Up @@ -1393,7 +1393,7 @@ DBGP_FUNC(property_get)
RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_PROPERTY_NON_EXISTENT);
}
} else {
if (add_variable_node(*retval, CMD_OPTION('n'), strlen(CMD_OPTION('n')) + 1, 1, 0, 0, options TSRMLS_CC) == FAILURE) {
if (add_variable_node(*retval, CMD_OPTION('n'), 1, 0, 0, options TSRMLS_CC) == FAILURE) {
options->max_data = old_max_data;
RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_PROPERTY_NON_EXISTENT);
}
Expand Down Expand Up @@ -1475,7 +1475,7 @@ DBGP_FUNC(property_set)
new_value = xdebug_base64_decode((unsigned char*) data, strlen(data), &new_length);

if (CMD_OPTION('t')) {
symbol = xdebug_get_php_symbol(CMD_OPTION('n'), strlen(CMD_OPTION('n')) + 1 TSRMLS_CC);
symbol = xdebug_get_php_symbol(CMD_OPTION('n') TSRMLS_CC);

/* Handle result */
if (!symbol) {
Expand Down Expand Up @@ -1546,11 +1546,11 @@ DBGP_FUNC(property_set)
}
}

static int add_variable_contents_node(xdebug_xml_node *node, char *name, int name_length, int var_only, int non_null, int no_eval, xdebug_var_export_options *options TSRMLS_DC)
static int add_variable_contents_node(xdebug_xml_node *node, char *name, int var_only, int non_null, int no_eval, xdebug_var_export_options *options TSRMLS_DC)
{
int contents_found;

contents_found = get_symbol_contents(name, name_length, node, options TSRMLS_CC);
contents_found = get_symbol_contents(name, node, options TSRMLS_CC);
if (contents_found) {
return SUCCESS;
}
Expand Down Expand Up @@ -1612,7 +1612,7 @@ DBGP_FUNC(property_value)
options->max_data = old_max_data;
RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_INVALID_ARGS);
}
if (add_variable_contents_node(*retval, CMD_OPTION('n'), strlen(CMD_OPTION('n')) + 1, 1, 0, 0, options TSRMLS_CC) == FAILURE) {
if (add_variable_contents_node(*retval, CMD_OPTION('n'), 1, 0, 0, options TSRMLS_CC) == FAILURE) {
options->max_data = old_max_data;
RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_PROPERTY_NON_EXISTENT);
}
Expand All @@ -1626,7 +1626,7 @@ static void attach_used_var_with_contents(void *xml, xdebug_hash_element* he, vo
xdebug_xml_node *contents;
TSRMLS_FETCH();

contents = get_symbol(name, strlen(name), options TSRMLS_CC);
contents = get_symbol(name, options TSRMLS_CC);
if (contents) {
xdebug_xml_add_child(node, contents);
} else {
Expand Down Expand Up @@ -1695,15 +1695,15 @@ static int attach_context_vars(xdebug_xml_node *node, xdebug_var_export_options
/* add super globals */
XG(active_symbol_table) = &EG(symbol_table);
XG(active_execute_data) = NULL;
add_variable_node(node, "_COOKIE", sizeof("_COOKIE"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_ENV", sizeof("_ENV"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_FILES", sizeof("_FILES"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_GET", sizeof("_GET"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_POST", sizeof("_POST"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_REQUEST", sizeof("_REQUEST"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_SERVER", sizeof("_SERVER"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_SESSION", sizeof("_SESSION"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "GLOBALS", sizeof("GLOBALS"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_COOKIE", 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_ENV", 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_FILES", 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_GET", 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_POST", 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_REQUEST", 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_SERVER", 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "_SESSION", 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "GLOBALS", 1, 1, 0, options TSRMLS_CC);
XG(active_symbol_table) = NULL;
return 0;
}
Expand Down Expand Up @@ -1781,7 +1781,7 @@ static int attach_context_vars(xdebug_xml_node *node, xdebug_var_export_options

/* Zend engine 2 does not give us $this, eval so we can get it */
if (!xdebug_hash_find(tmp_hash, "this", 4, (void *) &var_name)) {
add_variable_node(node, "this", sizeof("this"), 1, 1, 0, options TSRMLS_CC);
add_variable_node(node, "this", 1, 1, 0, options TSRMLS_CC);
}

xdebug_hash_destroy(tmp_hash);
Expand Down
2 changes: 1 addition & 1 deletion xdebug_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void dump_used_var_with_contents(void *htmlq, xdebug_hash_element* he, vo
#else
XG(active_symbol_table) = EG(active_symbol_table);
#endif
zvar = xdebug_get_php_symbol(name, strlen(name) + 1 TSRMLS_CC);
zvar = xdebug_get_php_symbol(name TSRMLS_CC);
XG(active_symbol_table) = tmp_ht;

formats = select_formats(PG(html_errors) TSRMLS_CC);
Expand Down
2 changes: 1 addition & 1 deletion xdebug_var.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ static zval* fetch_zval_from_symbol_table(zval *parent, char* name, unsigned int
return retval_p;
}

zval* xdebug_get_php_symbol(char* name, int name_length TSRMLS_DC)
zval* xdebug_get_php_symbol(char* name TSRMLS_DC)
{
int found = -1;
int state = 0;
Expand Down
2 changes: 1 addition & 1 deletion xdebug_var.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef struct xdebug_var_export_options {
#define XDEBUG_VAR_TYPE_STATIC 0x01
#define XDEBUG_VAR_TYPE_CONSTANT 0x02

zval* xdebug_get_php_symbol(char* name, int name_length TSRMLS_DC);
zval* xdebug_get_php_symbol(char* name TSRMLS_DC);
char* xdebug_get_property_info(char *mangled_property, int mangled_len, char **property_name, char **class_name);

xdebug_var_export_options* xdebug_var_export_options_from_ini(TSRMLS_D);
Expand Down

0 comments on commit 2926bbd

Please sign in to comment.