com php-src: fix C89 compat: ext/spl/spl_dllist.c
| From: | Anatol Belski | Date: | Tue, 19 Mar 2013 14:13:27 +0000 |
| Subject: | com php-src: fix C89 compat: ext/spl/spl_dllist.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71624@lists.php.net to get a copy of this message | ||
Commit: b3d82845dbdd00d7d9293247331cd08862ec30a2
Author: Anatol Belski <ab@php.net> Tue, 19 Mar 2013 15:13:27 +0100
Parents: ce04268bb9de5eb1c6f7794889ae5661d2c87b91
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b3d82845dbdd00d7d9293247331cd08862ec30a2
Log:
fix C89 compat
Changed paths:
M ext/spl/spl_dllist.c
Diff:
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index 3ac2201..8361086 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -1260,12 +1260,12 @@ SPL_METHOD(SplDoublyLinkedList, add)
/* If index is the last entry+1 then we do a push because we're not inserting before any
entry */
spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
} else {
- /* Get the element we want to insert before */
- element = spl_ptr_llist_offset(intern->llist, index, intern->flags &
SPL_DLLIST_IT_LIFO);
-
/* Create the new element we want to insert */
spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element));
+ /* Get the element we want to insert before */
+ element = spl_ptr_llist_offset(intern->llist, index, intern->flags &
SPL_DLLIST_IT_LIFO);
+
elem->data = value;
elem->rc = 1;
/* connect to the neighbours */