summaryrefslogtreecommitdiff
path: root/sapi/phpdbg
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-19 08:07:31 +0200
committerAnatol Belski <ab@php.net>2014-08-19 08:07:31 +0200
commit63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc (patch)
treee561a58d6e084c5e4cbdde1f84aed16cf4724383 /sapi/phpdbg
parent1e8273964fbd517a2eb9e560f9cdb4afffa0c034 (diff)
downloadphp-git-63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc.tar.gz
basic macro replacements, all at once
Diffstat (limited to 'sapi/phpdbg')
-rw-r--r--sapi/phpdbg/phpdbg.c16
-rw-r--r--sapi/phpdbg/phpdbg_bp.c8
-rw-r--r--sapi/phpdbg/phpdbg_frame.c6
-rw-r--r--sapi/phpdbg/phpdbg_info.c2
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c2
-rw-r--r--sapi/phpdbg/phpdbg_utils.h6
-rw-r--r--sapi/phpdbg/phpdbg_watch.c10
7 files changed, 25 insertions, 25 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 1fbd18a423..aaed7a3a88 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -87,14 +87,14 @@ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */
REGISTER_STRINGL_CONSTANT("PHPDBG_VERSION", PHPDBG_VERSION, sizeof(PHPDBG_VERSION)-1, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT);
+
+ REGISTER_INT_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT);
return SUCCESS;
} /* }}} */
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c
index a18316a228..35273554f8 100644
--- a/sapi/phpdbg/phpdbg_bp.c
+++ b/sapi/phpdbg/phpdbg_bp.c
@@ -721,12 +721,12 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co
new_break.code = estrndup(expr, expr_len);
new_break.code_len = expr_len;
- Z_STRLEN(pv) = expr_len + sizeof("return ;") - 1;
- Z_STRVAL(pv) = emalloc(Z_STRLEN(pv) + 1);
+ Z_STRSIZE(pv) = expr_len + sizeof("return ;") - 1;
+ Z_STRVAL(pv) = emalloc(Z_STRSIZE(pv) + 1);
memcpy(Z_STRVAL(pv), "return ", sizeof("return ") - 1);
memcpy(Z_STRVAL(pv) + sizeof("return ") - 1, expr, expr_len);
- Z_STRVAL(pv)[Z_STRLEN(pv) - 1] = ';';
- Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0';
+ Z_STRVAL(pv)[Z_STRSIZE(pv) - 1] = ';';
+ Z_STRVAL(pv)[Z_STRSIZE(pv)] = '\0';
Z_TYPE(pv) = IS_STRING;
new_break.ops = zend_compile_string(
diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c
index a235fe8cb0..67fa6a267f 100644
--- a/sapi/phpdbg/phpdbg_frame.c
+++ b/sapi/phpdbg/phpdbg_frame.c
@@ -114,7 +114,7 @@ static void phpdbg_dump_prototype(zval **tmp TSRMLS_DC) /* {{{ */
(void **)&class);
} else {
zend_get_object_classname(*class, (const char **)&Z_STRVAL_PP(class),
- (zend_uint *)&Z_STRLEN_PP(class) TSRMLS_CC);
+ (zend_uint *)&Z_STRSIZE_PP(class) TSRMLS_CC);
}
if (is_class == SUCCESS) {
@@ -186,14 +186,14 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */
if (zend_hash_get_current_data_ex(Z_ARRVAL(zbacktrace),
(void**)&tmp, &position) == FAILURE) {
- phpdbg_write("frame #%d: {main} at %s:%ld", i, Z_STRVAL_PP(file), Z_LVAL_PP(line));
+ phpdbg_write("frame #%d: {main} at %s:%ld", i, Z_STRVAL_PP(file), Z_IVAL_PP(line));
break;
}
if (user_defined == SUCCESS) {
phpdbg_write("frame #%d: ", i++);
phpdbg_dump_prototype(tmp TSRMLS_CC);
- phpdbg_writeln(" at %s:%ld", Z_STRVAL_PP(file), Z_LVAL_PP(line));
+ phpdbg_writeln(" at %s:%ld", Z_STRVAL_PP(file), Z_IVAL_PP(line));
} else {
phpdbg_write(" => ");
phpdbg_dump_prototype(tmp TSRMLS_CC);
diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c
index 97f88bfa1e..851e93b3c7 100644
--- a/sapi/phpdbg/phpdbg_info.c
+++ b/sapi/phpdbg/phpdbg_info.c
@@ -159,7 +159,7 @@ PHPDBG_INFO(vars) /* {{{ */
switch (Z_TYPE_PP(data)) {
case IS_STRING: phpdbg_write("(string)\t"); break;
- case IS_LONG: phpdbg_write("(integer)\t"); break;
+ case IS_INT: phpdbg_write("(integer)\t"); break;
case IS_DOUBLE: phpdbg_write("(float)\t"); break;
case IS_RESOURCE: phpdbg_write("(resource)\t"); break;
case IS_ARRAY: phpdbg_write("(array)\t"); break;
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index d91ef3f3f5..69ad49ecc6 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -118,7 +118,7 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ *
break;
case NUMERIC_PARAM:
- add_next_index_long(&params, next->num);
+ add_next_index_int(&params, next->num);
break;
case METHOD_PARAM:
diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h
index 56bacfc459..83474cd7ad 100644
--- a/sapi/phpdbg/phpdbg_utils.h
+++ b/sapi/phpdbg/phpdbg_utils.h
@@ -136,10 +136,10 @@ static void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, Ha
} else if (p->nKeyLength) {
Z_TYPE_P(key) = IS_STRING;
Z_STRVAL_P(key) = IS_INTERNED(p->arKey) ? (char*)p->arKey : estrndup(p->arKey, p->nKeyLength - 1);
- Z_STRLEN_P(key) = p->nKeyLength - 1;
+ Z_STRSIZE_P(key) = p->nKeyLength - 1;
} else {
- Z_TYPE_P(key) = IS_LONG;
- Z_LVAL_P(key) = p->h;
+ Z_TYPE_P(key) = IS_INT;
+ Z_IVAL_P(key) = p->h;
}
}
#endif
diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c
index e88622444b..10834fa9a6 100644
--- a/sapi/phpdbg/phpdbg_watch.c
+++ b/sapi/phpdbg/phpdbg_watch.c
@@ -182,11 +182,11 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_
zend_hash_get_current_key_zval_ex(ht, &key, &position);
if (Z_TYPE(key) == IS_STRING) {
- new_watch->name_in_parent = zend_strndup(Z_STRVAL(key), Z_STRLEN(key));
- new_watch->name_in_parent_len = Z_STRLEN(key);
+ new_watch->name_in_parent = zend_strndup(Z_STRVAL(key), Z_STRSIZE(key));
+ new_watch->name_in_parent_len = Z_STRSIZE(key);
} else {
new_watch->name_in_parent = NULL;
- new_watch->name_in_parent_len = asprintf(&new_watch->name_in_parent, "%ld", Z_LVAL(key));
+ new_watch->name_in_parent_len = asprintf(&new_watch->name_in_parent, "%ld", Z_IVAL(key));
}
new_watch->str = NULL;
@@ -238,7 +238,7 @@ static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch, zend_b
if (Z_TYPE(key) == IS_STRING) {
str_len = asprintf(&str, "%.*s%s%s%s", (int)watch->parent->str_len, watch->parent->str, Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"[":"->", phpdbg_get_property_key(Z_STRVAL(key)), Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"]":"");
} else {
- str_len = asprintf(&str, "%.*s%s%li%s", (int)watch->parent->str_len, watch->parent->str, Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"[":"->", Z_LVAL(key), Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"]":"");
+ str_len = asprintf(&str, "%.*s%s%li%s", (int)watch->parent->str_len, watch->parent->str, Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"[":"->", Z_IVAL(key), Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"]":"");
}
if (zend_hash_find(&PHPDBG_G(watchpoints), str, str_len, (void **) &watchpoint) == SUCCESS) {
@@ -338,7 +338,7 @@ static int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *par
watch->flags = 0;
zend_hash_get_current_key_zval_ex(parent, key, &position);
convert_to_string(key);
- watch->str = malloc(i + Z_STRLEN_P(key) + 2);
+ watch->str = malloc(i + Z_STRSIZE_P(key) + 2);
watch->str_len = sprintf(watch->str, "%.*s%s%s", (int)i, input, phpdbg_get_property_key(Z_STRVAL_P(key)), input[len - 1] == ']'?"]":"");
efree(key);
watch->name_in_parent = zend_strndup(last_index, index_len);