jani Mon Aug 25 19:07:13 2008 UTC Modified files: /php-src/ext/spl spl_array.c Log: - Fix CS, folding tags..etc. PLEASE do not invent your own coding styles. Or commit something as fubar as this.. http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.147&r2=1.148&diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.147 php-src/ext/spl/spl_array.c:1.148 --- php-src/ext/spl/spl_array.c:1.147 Mon Aug 25 18:38:22 2008 +++ php-src/ext/spl/spl_array.c Mon Aug 25 19:07:12 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_array.c,v 1.147 2008/08/25 18:38:22 colder Exp $ */ +/* $Id: spl_array.c,v 1.148 2008/08/25 19:07:12 jani Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -545,7 +545,7 @@ /* {{{ proto bool ArrayObject::offsetExists(mixed $index) U proto bool ArrayIterator::offsetExists(mixed $index) U - Returns whether the requested $index exists. */ + Returns whether the requested $index exists. */ SPL_METHOD(Array, offsetExists) { zval *index; @@ -557,7 +557,7 @@ /* {{{ proto mixed ArrayObject::offsetGet(mixed $index) U proto mixed ArrayIterator::offsetGet(mixed $index) U - Returns the value at the specified $index. */ + Returns the value at the specified $index. */ SPL_METHOD(Array, offsetGet) { zval *index, *value; @@ -570,7 +570,7 @@ /* {{{ proto void ArrayObject::offsetSet(mixed $index, mixed $newval) U proto void ArrayIterator::offsetSet(mixed $index, mixed $newval) U - Sets the value at the specified $index to $newval. */ + Sets the value at the specified $index to $newval. */ SPL_METHOD(Array, offsetSet) { zval *index, *value; @@ -603,7 +603,7 @@ /* {{{ proto void ArrayObject::append(mixed $newval) U proto void ArrayIterator::append(mixed $newval) U - Appends the value (cannot be called for objects). */ + Appends the value (cannot be called for objects). */ SPL_METHOD(Array, append) { zval *value; @@ -616,7 +616,7 @@ /* {{{ proto void ArrayObject::offsetUnset(mixed $index) U proto void ArrayIterator::offsetUnset(mixed $index) U - Unsets the value at the specified $index. */ + Unsets the value at the specified $index. */ SPL_METHOD(Array, offsetUnset) { zval *index; @@ -628,12 +628,12 @@ /* {{{ proto array ArrayObject::getArrayCopy() U proto array ArrayIterator::getArrayCopy() U - Return a copy of the contained array */ + Return a copy of the contained array */ SPL_METHOD(Array, getArrayCopy) { zval *object = getThis(), *tmp; spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - + array_init(return_value); zend_hash_copy(HASH_OF(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC), (copy_ctor_func_t) zval_add_ref, &tmp, sizeof(zval*)); } /* }}} */ @@ -992,7 +992,7 @@ /* {{{ proto void ArrayObject::__construct(array|object ar = array() [, int flags = 0 [, string iterator_class = "ArrayIterator"]]) U proto void ArrayIterator::__construct(array|object ar = array() [, int flags = 0]) U - Cronstructs a new array iterator from a path. */ + Constructs a new array iterator from a path. */ SPL_METHOD(Array, __construct) { zval *object = getThis(); @@ -1129,7 +1129,7 @@ /* }}} */ /* {{{ proto void ArrayIterator::seek(int $position) U - Seek to position. */ + Seek to position. */ SPL_METHOD(Array, seek) { long opos, position; @@ -1213,7 +1213,7 @@ /* {{{ proto int ArrayObject::count() U proto int ArrayIterator::count() U - Return the number of elements in the Iterator. */ + Return the number of elements in the Iterator. */ SPL_METHOD(Array, count) { long count; @@ -1223,7 +1223,8 @@ RETURN_LONG(count); } /* }}} */ -/* {{{ static void spl_array_method */ +/* {{{ static void spl_array_method +*/ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fname_len, int use_arg) { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(getThis() TSRMLS_CC); @@ -1258,32 +1259,32 @@ /* {{{ proto int ArrayObject::asort() U proto int ArrayIterator::asort() U - Sort the entries by values. */ + Sort the entries by values. */ SPL_ARRAY_METHOD(Array, asort, 0) /* }}} */ /* {{{ proto int ArrayObject::ksort() U proto int ArrayIterator::ksort() U - Sort the entries by key. */ + Sort the entries by key. */ SPL_ARRAY_METHOD(Array, ksort, 0) /* }}} */ /* {{{ proto int ArrayObject::uasort(callback cmp_function) U proto int ArrayIterator::uasort(callback cmp_function) U - Sort the entries by values user defined function. */ + Sort the entries by values user defined function. */ SPL_ARRAY_METHOD(Array, uasort, 1) /* }}} */ /* {{{ proto int ArrayObject::uksort(callback cmp_function) U proto int ArrayIterator::uksort(callback cmp_function) U - Sort the entries by key using user defined function. */ + Sort the entries by key using user defined function. */ SPL_ARRAY_METHOD(Array, uksort, 1) /* }}} */ /* {{{ proto int ArrayObject::natsort() U proto int ArrayIterator::natsort() U - Sort the entries by values using "natural order" algorithm. */ + Sort the entries by values using "natural order" algorithm. */ SPL_ARRAY_METHOD(Array, natsort, 0) /* }}} */ /* {{{ proto int ArrayObject::natcasesort() U proto int ArrayIterator::natcasesort() U - Sort the entries by key using case insensitive "natural order" algorithm. */ + Sort the entries by key using case insensitive "natural order" algorithm. */ SPL_ARRAY_METHOD(Array, natcasesort, 0) /* }}} */ /* {{{ proto mixed|NULL ArrayIterator::current() U @@ -1458,7 +1459,8 @@ } /* }}} */ -smart_str spl_array_serialize_helper(spl_array_object *intern, php_serialize_data_t *var_hash_p TSRMLS_DC) { /* {{{ */ +smart_str spl_array_serialize_helper(spl_array_object *intern, php_serialize_data_t *var_hash_p TSRMLS_DC) /* {{{ */ +{ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); zval members, *pmembers; smart_str buf = {0}; @@ -1495,8 +1497,7 @@ /* }}} */ /* {{{ proto string ArrayObject::serialize() - * serialize the object - */ + Serialize the object */ SPL_METHOD(Array, serialize) { zval *object = getThis(); @@ -1524,7 +1525,8 @@ RETURN_NULL(); } /* }}} */ -int spl_array_serialize(zval *object, int *type, zstr *buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) { /* {{{ */ +int spl_array_serialize(zval *object, int *type, zstr *buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +{ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (intern->fptr_serialize) { @@ -1557,7 +1559,8 @@ } /* }}} */ -void spl_array_unserialize_helper(spl_array_object *intern, const unsigned char *buf, zend_uint buf_len, php_unserialize_data_t *var_hash_p TSRMLS_DC) { /* {{{ */ +void spl_array_unserialize_helper(spl_array_object *intern, const unsigned char *buf, zend_uint buf_len, php_unserialize_data_t *var_hash_p TSRMLS_DC) /* {{{ */ +{ const unsigned char *p, *s; zval *pmembers, *pflags = NULL; long flags; @@ -1632,10 +1635,7 @@ /* }}} */ /* {{{ proto void ArrayObject::unserialize(string serialized) - * - * - * unserialize the object - */ + Unserialize the object */ SPL_METHOD(Array, unserialize) { char *buf; @@ -1667,7 +1667,8 @@ } /* }}} */ -int spl_array_unserialize(zval **object, zend_class_entry *ce, int type, const zstr buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) { /* {{{ */ +int spl_array_unserialize(zval **object, zend_class_entry *ce, int type, const zstr buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +{ spl_array_object *intern; object_init_ex(*object, ce);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php