Skip to content

Commit

Permalink
2nd phase in back-substitution those macro's
Browse files Browse the repository at this point in the history
I've got pretty much everything now...
  • Loading branch information
Jeroen van Wolffelaar committed Sep 25, 2001
1 parent 0ddd124 commit 6cfba2a
Show file tree
Hide file tree
Showing 43 changed files with 719 additions and 719 deletions.
530 changes: 265 additions & 265 deletions ext/cpdf/cpdf.c

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ext/dba/dba.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}

for(hptr = handler; hptr->name &&
strcasecmp(hptr->name, (*args[2])->value.str.val); hptr++);
strcasecmp(hptr->name, Z_STRVAL_PP(args[2])); hptr++);

if(!hptr->name) {
php_error(E_WARNING, "no such handler: %s", (*args[2])->value.str.val);
php_error(E_WARNING, "no such handler: %s", Z_STRVAL_PP(args[2]));
FREENOW;
RETURN_FALSE;
}

switch((*args[1])->value.str.val[0]) {
switch(Z_STRVAL_PP(args[1])[0]) {
case 'c':
modenr = DBA_CREAT;
break;
Expand All @@ -332,14 +332,14 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
modenr = DBA_TRUNC;
break;
default:
php_error(E_WARNING, "illegal DBA mode: %s", (*args[1])->value.str.val);
php_error(E_WARNING, "illegal DBA mode: %s", Z_STRVAL_PP(args[1]));
FREENOW;
RETURN_FALSE;
}

info = malloc(sizeof(*info));
memset(info, 0, sizeof(info));
info->path = strdup((*args[0])->value.str.val);
info->path = strdup(Z_STRVAL_PP(args[0]));
info->mode = modenr;
info->argc = ac - 3;
info->argv = args + 3;
Expand Down
2 changes: 1 addition & 1 deletion ext/dba/dba_db2.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ DBA_OPEN_FUNC(db2)

if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}

if(!db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) {
Expand Down
2 changes: 1 addition & 1 deletion ext/dba/dba_db3.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ DBA_OPEN_FUNC(db3)

if (info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}

if (db_create(&dbp, NULL, 0) == 0 &&
Expand Down
2 changes: 1 addition & 1 deletion ext/dba/dba_dbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ DBA_OPEN_FUNC(dbm)

if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}

if(info->mode == DBA_TRUNC) {
Expand Down
2 changes: 1 addition & 1 deletion ext/dba/dba_gdbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ DBA_OPEN_FUNC(gdbm)

if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}

dbf = gdbm_open(info->path, 0, gmode, filemode, NULL);
Expand Down
2 changes: 1 addition & 1 deletion ext/dba/dba_ndbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ DBA_OPEN_FUNC(ndbm)

if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}

dbf = dbm_open(info->path, gmode, filemode);
Expand Down
46 changes: 23 additions & 23 deletions ext/dbx/dbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,24 +237,24 @@ ZEND_FUNCTION(dbx_connect)
}
if (ZEND_NUM_ARGS()==number_of_arguments+1) {
convert_to_long_ex(arguments[5]);
if ((*arguments[5])->value.lval!=0) persistent=1;
if (Z_LVAL_PP(arguments[5])!=0) persistent=1;
}

if ((*arguments[0])->type == IS_LONG) {
if (!module_identifier_exists((*arguments[0])->value.lval)) {
zend_error(E_WARNING, "dbx: module '%ld' not loaded or not supported.\n", (*arguments[0])->value.lval);
if (Z_TYPE_PP(arguments[0]) == IS_LONG) {
if (!module_identifier_exists(Z_LVAL_PP(arguments[0]))) {
zend_error(E_WARNING, "dbx: module '%ld' not loaded or not supported.\n", Z_LVAL_PP(arguments[0]));
return;
}
module_identifier = (*arguments[0])->value.lval;
module_identifier = Z_LVAL_PP(arguments[0]);
} else {
convert_to_string_ex(arguments[0]);
if (!module_exists((*arguments[0])->value.str.val)) {
zend_error(E_WARNING, "dbx: module '%s' not loaded.\n", (*arguments[0])->value.str.val);
if (!module_exists(Z_STRVAL_PP(arguments[0]))) {
zend_error(E_WARNING, "dbx: module '%s' not loaded.\n", Z_STRVAL_PP(arguments[0]));
return;
}
module_identifier=get_module_identifier((*arguments[0])->value.str.val);
module_identifier=get_module_identifier(Z_STRVAL_PP(arguments[0]));
if (!module_identifier) {
zend_error(E_WARNING, "dbx: unsupported module '%s'.\n", (*arguments[0])->value.str.val);
zend_error(E_WARNING, "dbx: unsupported module '%s'.\n", Z_STRVAL_PP(arguments[0]));
return;
}
}
Expand All @@ -268,7 +268,7 @@ ZEND_FUNCTION(dbx_connect)
convert_to_string_ex(arguments[3]);
convert_to_string_ex(arguments[4]);
MAKE_STD_ZVAL(db_name);
ZVAL_STRING(db_name, (*arguments[2])->value.str.val, 1);
ZVAL_STRING(db_name, Z_STRVAL_PP(arguments[2]), 1);
if (persistent) {
result = switch_dbx_pconnect(&rv_dbx_handle, arguments[1], arguments[2], arguments[3], arguments[4], INTERNAL_FUNCTION_PARAM_PASSTHRU, &dbx_module);
} else {
Expand Down Expand Up @@ -367,7 +367,7 @@ ZEND_FUNCTION(dbx_query)
/* parameter overrides */
if (ZEND_NUM_ARGS()>2) {
convert_to_long_ex(arguments[2]);
info_flags = (*arguments[2])->value.lval;
info_flags = Z_LVAL_PP(arguments[2]);
/* fieldnames are needed for association! */
if (info_flags & DBX_RESULT_ASSOC) {
info_flags |= DBX_RESULT_INFO;
Expand Down Expand Up @@ -554,8 +554,8 @@ ZEND_FUNCTION(dbx_compare)
WRONG_PARAM_COUNT;
}

if ((*arguments[0])->type != IS_ARRAY
|| (*arguments[1])->type != IS_ARRAY) {
if (Z_TYPE_PP(arguments[0]) != IS_ARRAY
|| Z_TYPE_PP(arguments[1]) != IS_ARRAY) {
zend_error(E_WARNING, "Wrong argument type for compare");
RETURN_LONG(0);
}
Expand All @@ -565,27 +565,27 @@ ZEND_FUNCTION(dbx_compare)
if (number_of_arguments>3) {
convert_to_long_ex(arguments[3]); /* comparison type and direction*/
/* direction */
if ((*arguments[3])->value.lval & DBX_CMP_DESC) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_DESC) {
comparison_direction=DBX_CMP_DESC;
}
if ((*arguments[3])->value.lval & DBX_CMP_ASC) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_ASC) {
comparison_direction=DBX_CMP_ASC;
}
/* type */
if ((*arguments[3])->value.lval & DBX_CMP_NUMBER) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_NUMBER) {
comparison_type=DBX_CMP_NUMBER;
}
if ((*arguments[3])->value.lval & DBX_CMP_TEXT) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_TEXT) {
comparison_type=DBX_CMP_TEXT;
}
if ((*arguments[3])->value.lval & DBX_CMP_NATIVE) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_NATIVE) {
comparison_type=DBX_CMP_NATIVE;
}
}

if (zend_hash_find((*arguments[0])->value.ht, (*arguments[2])->value.str.val, (*arguments[2])->value.str.len+1, (void **) &zv_a)==FAILURE
|| zend_hash_find((*arguments[1])->value.ht, (*arguments[2])->value.str.val, (*arguments[2])->value.str.len+1, (void **) &zv_b)==FAILURE) {
zend_error(E_WARNING, "Field '%s' not available in result-object", (*arguments[2])->value.str.val);
if (zend_hash_find(Z_ARRVAL_PP(arguments[0]), Z_STRVAL_PP(arguments[2]), Z_STRLEN_PP(arguments[2])+1, (void **) &zv_a)==FAILURE
|| zend_hash_find(Z_ARRVAL_PP(arguments[1]), Z_STRVAL_PP(arguments[2]), Z_STRLEN_PP(arguments[2])+1, (void **) &zv_b)==FAILURE) {
zend_error(E_WARNING, "Field '%s' not available in result-object", Z_STRVAL_PP(arguments[2]));
RETURN_LONG(0);
}

Expand Down Expand Up @@ -639,8 +639,8 @@ ZEND_FUNCTION(dbx_sort)
WRONG_PARAM_COUNT;
}

if ((*arguments[0])->type != IS_OBJECT
|| (*arguments[1])->type != IS_STRING) {
if (Z_TYPE_PP(arguments[0]) != IS_OBJECT
|| Z_TYPE_PP(arguments[1]) != IS_STRING) {
zend_error(E_WARNING, "Wrong argument type for sort");
RETURN_LONG(0);
}
Expand Down
8 changes: 4 additions & 4 deletions ext/fbsql/php_fbsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,17 +463,17 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistant)
if (argc >= 1)
{
convert_to_string_ex(argv[0]);
hostName = (*argv[0])->value.str.val;
hostName = Z_STRVAL_PP(argv[0]);
}
if (argc >= 2)
{
convert_to_string_ex(argv[1]);
userName = (*argv[1])->value.str.val;
userName = Z_STRVAL_PP(argv[1]);
}
if (argc == 3)
{
convert_to_string_ex(argv[2]);
userPassword = (*argv[2])->value.str.val;
userPassword = Z_STRVAL_PP(argv[2]);
}

if (hostName == NULL) hostName = FB_SQL_G(hostName);
Expand Down Expand Up @@ -1896,7 +1896,7 @@ PHP_FUNCTION(fbsql_warnings)
if (argc >= 1)
{
convert_to_long_ex(argv[0]);
FB_SQL_G(generateWarnings) = (*argv[0])->value.lval != 0;
FB_SQL_G(generateWarnings) = Z_LVAL_PP(argv[0]) != 0;
}
RETURN_BOOL(FB_SQL_G(generateWarnings));
}
Expand Down
8 changes: 4 additions & 4 deletions ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,12 +2124,12 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
npoints = Z_LVAL_PP(NPOINTS);
col = Z_LVAL_PP(COL);

if ((*POINTS)->type != IS_ARRAY) {
if (Z_TYPE_PP(POINTS) != IS_ARRAY) {
php_error(E_WARNING, "2nd argument to imagepolygon not an array");
RETURN_FALSE;
}

nelem = zend_hash_num_elements((*POINTS)->value.ht);
nelem = zend_hash_num_elements(Z_ARRVAL_PP(POINTS));
if (nelem < 6) {
php_error(E_WARNING, "you must have at least 3 points in your array");
RETURN_FALSE;
Expand All @@ -2143,12 +2143,12 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
points = (gdPointPtr) emalloc(npoints * sizeof(gdPoint));

for (i = 0; i < npoints; i++) {
if (zend_hash_index_find((*POINTS)->value.ht, (i * 2), (void **) &var) == SUCCESS) {
if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2), (void **) &var) == SUCCESS) {
SEPARATE_ZVAL((var));
convert_to_long(*var);
points[i].x = Z_LVAL_PP(var);
}
if (zend_hash_index_find((*POINTS)->value.ht, (i * 2) + 1, (void **) &var) == SUCCESS) {
if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2) + 1, (void **) &var) == SUCCESS) {
SEPARATE_ZVAL(var);
convert_to_long(*var);
points[i].y = Z_LVAL_PP(var);
Expand Down
Loading

0 comments on commit 6cfba2a

Please sign in to comment.