Skip to content

Commit

Permalink
Remove all function-like uses of array_init
Browse files Browse the repository at this point in the history
 * From PHP7.3 the array_init-macro is no longer function-like

 * In any case the return type was void and not consistently checked

 * Now consistently just call the macro without trying to check a result

Refs #7
  • Loading branch information
ejn committed Mar 1, 2019
1 parent 84ee76d commit abcac8b
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions ogr.c
Expand Up @@ -2980,10 +2980,7 @@ PHP_FUNCTION(ogr_f_getfieldasintegerlist)
RETURN_NULL();
}

if (array_init(return_value) == FAILURE)
{
RETURN_NULL();
}
array_init(return_value);

_ZVAL_PTR_DTOR(refncount);
ZVAL_LONG(refncount, ncount);
Expand Down Expand Up @@ -3028,10 +3025,7 @@ PHP_FUNCTION(ogr_f_getfieldasdoublelist)
RETURN_NULL();
}

if (array_init(return_value) == FAILURE)
{
RETURN_NULL();
}
array_init(return_value);

_ZVAL_PTR_DTOR(refncount);
ZVAL_DOUBLE(refncount, ncount);
Expand Down Expand Up @@ -3083,10 +3077,7 @@ PHP_FUNCTION(ogr_f_getfieldasstringlist)
RETURN_NULL();
}

if (array_init(return_value) == FAILURE)
{
RETURN_NULL();
}
array_init(return_value);

while (numelements < ncount) {
_ADD_NEXT_INDEX_STRING(return_value, (char *)
Expand Down

0 comments on commit abcac8b

Please sign in to comment.