Skip to content

Commit

Permalink
Add zend_parse_parameters_none() calls for void methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jan 7, 2012
1 parent f9985dc commit 2d07759
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
24 changes: 17 additions & 7 deletions spl_ds_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,28 +202,38 @@ void spl_ds_dll_object_clone_storage(spl_ds_dll_object *obj_orig, spl_ds_dll_obj

SPL_DS_METHOD(DLL, clear)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}

spl_ds_dll_clear(SPL_DS_DLL_GET_LIST());
}

SPL_DS_METHOD(DLL, isEmpty)
{
if (spl_ds_dll_is_empty(SPL_DS_DLL_GET_LIST())) {
RETURN_TRUE;
} else {
RETURN_FALSE;
}
if (zend_parse_parameters_none() == FAILURE) {
return;
}

RETURN_BOOL(spl_ds_dll_is_empty(SPL_DS_DLL_GET_LIST()));
}

SPL_DS_METHOD(DLL, toArray)
{
zval *retval = spl_ds_dll_to_array(SPL_DS_DLL_GET_LIST());

if (zend_parse_parameters_none() == FAILURE) {
return;
}

RETURN_ZVAL(retval, 1, 1);
}

SPL_DS_METHOD(DLL, count)
{
long count = spl_ds_dll_count(SPL_DS_DLL_GET_LIST());
if (zend_parse_parameters_none() == FAILURE) {
return;
}

RETURN_LONG(count);
RETURN_LONG(spl_ds_dll_count(SPL_DS_DLL_GET_LIST()));
}
8 changes: 8 additions & 0 deletions spl_ds_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ SPL_DS_METHOD(Queue, peek)
spl_ds_dll *list;
zval *item;

if (zend_parse_parameters_none() == FAILURE) {
return;
}

list = SPL_DS_DLL_GET_LIST();

if (spl_ds_dll_is_empty(list)) {
Expand All @@ -53,6 +57,10 @@ SPL_DS_METHOD(Queue, pop)
spl_ds_dll *list;
zval *item;

if (zend_parse_parameters_none() == FAILURE) {
return;
}

list = SPL_DS_DLL_GET_LIST();

if (spl_ds_dll_is_empty(list)) {
Expand Down
8 changes: 8 additions & 0 deletions spl_ds_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ SPL_DS_METHOD(Stack, peek)
spl_ds_dll *list;
zval *item;

if (zend_parse_parameters_none() == FAILURE) {
return;
}

list = SPL_DS_DLL_GET_LIST();

if (spl_ds_dll_is_empty(list)) {
Expand All @@ -53,6 +57,10 @@ SPL_DS_METHOD(Stack, pop)
spl_ds_dll *list;
zval *item;

if (zend_parse_parameters_none() == FAILURE) {
return;
}

list = SPL_DS_DLL_GET_LIST();

if (spl_ds_dll_is_empty(list)) {
Expand Down

0 comments on commit 2d07759

Please sign in to comment.