[PHP-CVS] cvs: php-src(PHP_5_0) /ext/standard php_var.h var_unserializer.c var_unserializer.re
sesser Sat Jan 15 13:49:26 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard php_var.h var_unserializer.c var_unserializer.re Log: MFH http://cvs.php.net/diff.php/php-src/ext/standard/php_var.h?r1=1.27.2.1&r2=1.27.2.2&ty=u Index: php-src/ext/standard/php_var.h diff -u php-src/ext/standard/php_var.h:1.27.2.1 php-src/ext/standard/php_var.h:1.27.2.2 --- php-src/ext/standard/php_var.h:1.27.2.1 Fri Sep 24 18:05:35 2004 +++ php-src/ext/standard/php_var.h Sat Jan 15 13:49:25 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_var.h,v 1.27.2.1 2004/09/24 22:05:35 helly Exp $ */ +/* $Id: php_var.h,v 1.27.2.2 2005/01/15 18:49:25 sesser Exp $ */ #ifndef PHP_VAR_H #define PHP_VAR_H @@ -41,6 +41,7 @@ struct php_unserialize_data { void *first; + void *first_dtor; }; typedef struct php_unserialize_data php_unserialize_data_t; @@ -54,7 +55,8 @@ zend_hash_destroy(&(var_hash)) #define PHP_VAR_UNSERIALIZE_INIT(var_hash) \ - (var_hash).first = 0 + (var_hash).first = 0; \ + (var_hash).first_dtor = 0 #define PHP_VAR_UNSERIALIZE_DESTROY(var_hash) \ var_destroy(&(var_hash)) http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.38.2.4&r2=1.38.2.5&ty=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.38.2.4 php-src/ext/standard/var_unserializer.c:1.38.2.5 --- php-src/ext/standard/var_unserializer.c:1.38.2.4Fri Dec 3 11:10:29 2004 +++ php-src/ext/standard/var_unserializer.c Sat Jan 15 13:49:25 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.38.2.4 2004/12/03 16:10:29 sesser Exp $ */ +/* $Id: var_unserializer.c,v 1.38.2.5 2005/01/15 18:49:25 sesser Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -56,6 +56,29 @@ var_hash->data[var_hash->used_slots++] = *rval; } +static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) +{ + var_entries *var_hash = var_hashx->first, *prev = NULL; + + while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { + prev = var_hash; + var_hash = var_hash->next; + } + + if (!var_hash) { + var_hash = emalloc(sizeof(var_entries)); + var_hash->used_slots = 0; + var_hash->next = 0; + + if (!var_hashx->first) + var_hashx->first = var_hash; + else + prev->next = var_hash; + } + + var_hash->data[var_hash->used_slots++] = *rval; +} + PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) { int i; @@ -93,6 +116,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) { void *next; + int i; var_entries *var_hash = var_hashx->first; while (var_hash) { @@ -100,6 +124,17 @@ efree(var_hash); var_hash = next; } + + var_hash = var_hashx->first_dtor; + + while (var_hash) { + for (i = 0; i < var_hash->used_slots; i++) { + zval_ptr_dtor(&var_hash->data[i]); + } + next = var_hash->next; + efree(var_hash); + var_hash = next; + } } /* }}} */ @@ -205,14 +240,14 @@ switch (Z_TYPE_P(key)) { case IS_LONG: - if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) { - var_replace(var_hash, old_data, rval); + if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); } zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); break; case IS_STRING: - if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)) { - var_replace(var_hash, old_data, rval); + if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); } zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); break; http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.27.2.4&r2=1.27.2.5&ty=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard
[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re
sesser Sat Jan 15 13:30:17 2005 EDT Modified files: /php-src/ext/standard var_unserializer.c var_unserializer.re Log: and use it... http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.47&r2=1.48&ty=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.47 php-src/ext/standard/var_unserializer.c:1.48 --- php-src/ext/standard/var_unserializer.c:1.47Sat Jan 15 13:18:08 2005 +++ php-src/ext/standard/var_unserializer.c Sat Jan 15 13:30:16 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.47 2005/01/15 18:18:08 sesser Exp $ */ +/* $Id: var_unserializer.c,v 1.48 2005/01/15 18:30:16 sesser Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -241,14 +241,14 @@ switch (Z_TYPE_P(key)) { case IS_LONG: - if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) { - var_replace(var_hash, old_data, rval); + if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); } zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); break; case IS_STRING: - if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)) { - var_replace(var_hash, old_data, rval); + if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); } zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); break; http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.36&r2=1.37&ty=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.36 php-src/ext/standard/var_unserializer.re:1.37 --- php-src/ext/standard/var_unserializer.re:1.36 Sat Jan 15 13:18:08 2005 +++ php-src/ext/standard/var_unserializer.reSat Jan 15 13:30:16 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: var_unserializer.re,v 1.36 2005/01/15 18:18:08 sesser Exp $ */ +/* $Id: var_unserializer.re,v 1.37 2005/01/15 18:30:16 sesser Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -244,14 +244,14 @@ switch (Z_TYPE_P(key)) { case IS_LONG: - if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) { - var_replace(var_hash, old_data, rval); + if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); } zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); break; case IS_STRING: - if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)) { - var_replace(var_hash, old_data, rval); + if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); } zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard php_var.h var_unserializer.c var_unserializer.re
sesser Sat Jan 15 13:44:30 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/standard php_var.h var_unserializer.c var_unserializer.re Log: MFH http://cvs.php.net/diff.php/php-src/ext/standard/php_var.h?r1=1.21.4.4&r2=1.21.4.5&ty=u Index: php-src/ext/standard/php_var.h diff -u php-src/ext/standard/php_var.h:1.21.4.4 php-src/ext/standard/php_var.h:1.21.4.5 --- php-src/ext/standard/php_var.h:1.21.4.4 Fri Sep 24 17:57:18 2004 +++ php-src/ext/standard/php_var.h Sat Jan 15 13:44:29 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_var.h,v 1.21.4.4 2004/09/24 21:57:18 helly Exp $ */ +/* $Id: php_var.h,v 1.21.4.5 2005/01/15 18:44:29 sesser Exp $ */ #ifndef PHP_VAR_H #define PHP_VAR_H @@ -41,6 +41,7 @@ struct php_unserialize_data { void *first; + void *first_dtor; }; typedef struct php_unserialize_data php_unserialize_data_t; @@ -54,7 +55,8 @@ zend_hash_destroy(&(var_hash)) #define PHP_VAR_UNSERIALIZE_INIT(var_hash) \ - (var_hash).first = 0 + (var_hash).first = 0; \ + (var_hash).first_dtor = 0 #define PHP_VAR_UNSERIALIZE_DESTROY(var_hash) \ var_destroy(&(var_hash)) http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.18.4.14&r2=1.18.4.15&ty=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.18.4.14 php-src/ext/standard/var_unserializer.c:1.18.4.15 --- php-src/ext/standard/var_unserializer.c:1.18.4.14 Fri Dec 3 11:09:19 2004 +++ php-src/ext/standard/var_unserializer.c Sat Jan 15 13:44:29 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.18.4.14 2004/12/03 16:09:19 sesser Exp $ */ +/* $Id: var_unserializer.c,v 1.18.4.15 2005/01/15 18:44:29 sesser Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -56,6 +56,30 @@ var_hash->data[var_hash->used_slots++] = *rval; } +static inline void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) +{ + var_entries *var_hash = var_hashx->first_dtor, *prev = NULL; + + while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { + prev = var_hash; + var_hash = var_hash->next; + } + + if (!var_hash) { + var_hash = emalloc(sizeof(var_entries)); + var_hash->used_slots = 0; + var_hash->next = 0; + + if (!var_hashx->first_dtor) + var_hashx->first_dtor = var_hash; + else + prev->next = var_hash; + } + + (*rval)->refcount++; + var_hash->data[var_hash->used_slots++] = *rval; +} + PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) { int i; @@ -93,6 +117,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) { void *next; + int i; var_entries *var_hash = var_hashx->first; while (var_hash) { @@ -100,6 +125,17 @@ efree(var_hash); var_hash = next; } + + var_hash = var_hashx->first_dtor; + + while (var_hash) { + for (i = 0; i < var_hash->used_slots; i++) { + zval_ptr_dtor(&var_hash->data[i]); + } + next = var_hash->next; + efree(var_hash); + var_hash = next; + } } /* }}} */ @@ -205,14 +241,14 @@ switch (Z_TYPE_P(key)) { case IS_LONG: - if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) { - var_replace(var_hash, old_data, rval); + if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); } zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); break; case IS_STRING: - if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)) { - var_replace(var_hash, old_data, rval); + if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); } zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); break; http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.11.4.8&r2=1.11.4.9&ty=u Index: php-
[PHP-CVS] cvs: php-src /ext/standard php_var.h var_unserializer.c var_unserializer.re
sesser Sat Jan 15 13:18:09 2005 EDT Modified files: /php-src/ext/standard php_var.h var_unserializer.c var_unserializer.re Log: Restore unserialize() speed http://cvs.php.net/diff.php/php-src/ext/standard/php_var.h?r1=1.28&r2=1.29&ty=u Index: php-src/ext/standard/php_var.h diff -u php-src/ext/standard/php_var.h:1.28 php-src/ext/standard/php_var.h:1.29 --- php-src/ext/standard/php_var.h:1.28 Sun Sep 5 12:29:04 2004 +++ php-src/ext/standard/php_var.h Sat Jan 15 13:18:08 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_var.h,v 1.28 2004/09/05 16:29:04 helly Exp $ */ +/* $Id: php_var.h,v 1.29 2005/01/15 18:18:08 sesser Exp $ */ #ifndef PHP_VAR_H #define PHP_VAR_H @@ -41,6 +41,7 @@ struct php_unserialize_data { void *first; + void *first_dtor; }; typedef struct php_unserialize_data php_unserialize_data_t; @@ -54,7 +55,8 @@ zend_hash_destroy(&(var_hash)) #define PHP_VAR_UNSERIALIZE_INIT(var_hash) \ - (var_hash).first = 0 + (var_hash).first = 0; \ + (var_hash).first_dtor = 0 #define PHP_VAR_UNSERIALIZE_DESTROY(var_hash) \ var_destroy(&(var_hash)) http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.46&r2=1.47&ty=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.46 php-src/ext/standard/var_unserializer.c:1.47 --- php-src/ext/standard/var_unserializer.c:1.46Fri Dec 3 11:02:48 2004 +++ php-src/ext/standard/var_unserializer.c Sat Jan 15 13:18:08 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.46 2004/12/03 16:02:48 sesser Exp $ */ +/* $Id: var_unserializer.c,v 1.47 2005/01/15 18:18:08 sesser Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -56,6 +56,30 @@ var_hash->data[var_hash->used_slots++] = *rval; } +static inline void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) +{ + var_entries *var_hash = var_hashx->first_dtor, *prev = NULL; + + while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { + prev = var_hash; + var_hash = var_hash->next; + } + + if (!var_hash) { + var_hash = emalloc(sizeof(var_entries)); + var_hash->used_slots = 0; + var_hash->next = 0; + + if (!var_hashx->first_dtor) + var_hashx->first_dtor = var_hash; + else + prev->next = var_hash; + } + + (*rval)->refcount++; + var_hash->data[var_hash->used_slots++] = *rval; +} + PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) { int i; @@ -93,6 +117,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) { void *next; + int i; var_entries *var_hash = var_hashx->first; while (var_hash) { @@ -100,6 +125,17 @@ efree(var_hash); var_hash = next; } + + var_hash = var_hashx->first_dtor; + + while (var_hash) { + for (i = 0; i < var_hash->used_slots; i++) { + zval_ptr_dtor(&var_hash->data[i]); + } + next = var_hash->next; + efree(var_hash); + var_hash = next; + } } /* }}} */ http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.re?r1=1.35&r2=1.36&ty=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.35 php-src/ext/standard/var_unserializer.re:1.36 --- php-src/ext/standard/var_unserializer.re:1.35 Fri Dec 3 11:02:48 2004 +++ php-src/ext/standard/var_unserializer.reSat Jan 15 13:18:08 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: var_unserializer.re,v 1.35 2004/12/03 16:02:48 sesser Exp $ */ +/* $Id: var_unserializer.re,v 1.36 2005/01/15 18:18:08 sesser Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -54,6 +54,30 @@ var_hash->data[var_hash->used_slots++] = *rval; } +static inline void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) +{ + var_entries *var_hash = var_hashx->first_dtor, *prev = NULL; + + while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { + prev = var_hash; + var_hash = var_hash->next; + } + + if (!var_hash) { + var_hash = emalloc(sizeof(var_entries)); + var_hash->used_slots = 0; + var_hash->next = 0; + + if (!var_hashx->first_dtor) + var_hashx->first_dtor = var_hash; + else + prev->next = var_hash; + } + + (*rval)
[PHP-CVS] Hi
Important informations! -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard streamsfuncs.c
sniper Fri Jan 14 23:50:26 2005 EDT Modified files: /php-src/ext/standard streamsfuncs.c Log: CS fix http://cvs.php.net/diff.php/php-src/ext/standard/streamsfuncs.c?r1=1.51&r2=1.52&ty=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.51 php-src/ext/standard/streamsfuncs.c:1.52 --- php-src/ext/standard/streamsfuncs.c:1.51Fri Jan 14 04:02:02 2005 +++ php-src/ext/standard/streamsfuncs.c Fri Jan 14 23:50:26 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: streamsfuncs.c,v 1.51 2005/01/14 09:02:02 dmitry Exp $ */ +/* $Id: streamsfuncs.c,v 1.52 2005/01/15 04:50:26 sniper Exp $ */ #include "php.h" #include "php_globals.h" @@ -260,11 +260,12 @@ &tv, &errstr TSRMLS_CC) && clistream) { - if (peername) {Z_TYPE_P(peername) = IS_STRING;} + if (peername) { + Z_TYPE_P(peername) = IS_STRING; + } php_stream_to_zval(clistream, return_value); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "accept failed: %s", errstr ? errstr : "Unknown error"); - RETVAL_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/gd gd.c
sniper Fri Jan 14 23:35:05 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/gd gd.c Log: MFH: ws fix http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.294.2.9&r2=1.294.2.10&ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.294.2.9 php-src/ext/gd/gd.c:1.294.2.10 --- php-src/ext/gd/gd.c:1.294.2.9 Fri Jan 14 18:08:02 2005 +++ php-src/ext/gd/gd.c Fri Jan 14 23:35:05 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.294.2.9 2005/01/14 23:08:02 sniper Exp $ */ +/* $Id: gd.c,v 1.294.2.10 2005/01/15 04:35:05 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3070,7 +3070,7 @@ #ifdef ENABLE_GD_TTF #if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX -/* {{{ proto array imageftbbox(int size, int angle, string font_file, string text[, array extrainfo]) +/* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo]) Give the bounding box of a text using fonts via freetype2 */ PHP_FUNCTION(imageftbbox) { @@ -3078,7 +3078,7 @@ } /* }}} */ -/* {{{ proto array imagefttext(resource im, int size, int angle, int x, int y, int col, string font_file, string text, [array extrainfo]) +/* {{{ proto array imagefttext(resource im, float size, float angle, int x, int y, int col, string font_file, string text [, array extrainfo]) Write text to the image using fonts via freetype2 */ PHP_FUNCTION(imagefttext) { @@ -3087,7 +3087,7 @@ /* }}} */ #endif -/* {{{ proto array imagettfbbox(int size, int angle, string font_file, string text) +/* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text) Give the bounding box of a text using TrueType fonts */ PHP_FUNCTION(imagettfbbox) { @@ -3095,7 +3095,7 @@ } /* }}} */ -/* {{{ proto array imagettftext(resource im, int size, int angle, int x, int y, int col, string font_file, string text) +/* {{{ proto array imagettftext(resource im, float size, float angle, int x, int y, int col, string font_file, string text) Write text to the image using a TrueType font */ PHP_FUNCTION(imagettftext) { @@ -3153,36 +3153,36 @@ } #if HAVE_GD_STRINGFTEX - if (extended && EXT) { - /* parse extended info */ + if (extended && EXT) { + /* parse extended info */ - HashPosition pos; + HashPosition pos; - convert_to_array_ex(EXT); + convert_to_array_ex(EXT); - /* walk the assoc array */ - zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), &pos); - do { - zval ** item; - char * key; - ulong num_key; + /* walk the assoc array */ + zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), &pos); + do { + zval ** item; + char * key; + ulong num_key; - if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING) { - continue; - } + if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING) { + continue; + } - if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void **) &item, &pos) == FAILURE) { - continue; - } + if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void **) &item, &pos) == FAILURE) { + continue; + } - if (strcmp("linespacing", key) == 0){ - convert_to_double_ex(item); - strex.flags |= gdFTEX_LINESPACE; - strex.linespacing = Z_DVAL_PP(item); - } + if (strcmp("linespacing", key) == 0){ + convert_to_double_ex(item); + strex.flags |= gdFTEX_LINESPACE; + strex.linespacing = Z_DVAL_PP(item); + } - } while (zend_hash_move_forward_ex(HASH_OF(*EXT), &pos) == SUCCESS); - } + } while (zend_hash_move_forward_ex(HASH_OF(*EXT), &pos) == SUCCESS); + } #endif ptsize = Z_DVAL_PP(PTSIZE); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd gd.c
sniper Fri Jan 14 23:34:30 2005 EDT Modified files: /php-src/ext/gd gd.c Log: ws fix http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.304&r2=1.305&ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.304 php-src/ext/gd/gd.c:1.305 --- php-src/ext/gd/gd.c:1.304 Fri Jan 14 18:07:46 2005 +++ php-src/ext/gd/gd.c Fri Jan 14 23:34:30 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.304 2005/01/14 23:07:46 sniper Exp $ */ +/* $Id: gd.c,v 1.305 2005/01/15 04:34:30 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -3070,7 +3070,7 @@ #ifdef ENABLE_GD_TTF #if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX -/* {{{ proto array imageftbbox(int size, int angle, string font_file, string text[, array extrainfo]) +/* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo]) Give the bounding box of a text using fonts via freetype2 */ PHP_FUNCTION(imageftbbox) { @@ -3078,7 +3078,7 @@ } /* }}} */ -/* {{{ proto array imagefttext(resource im, int size, int angle, int x, int y, int col, string font_file, string text, [array extrainfo]) +/* {{{ proto array imagefttext(resource im, float size, float angle, int x, int y, int col, string font_file, string text [, array extrainfo]) Write text to the image using fonts via freetype2 */ PHP_FUNCTION(imagefttext) { @@ -3087,7 +3087,7 @@ /* }}} */ #endif -/* {{{ proto array imagettfbbox(int size, int angle, string font_file, string text) +/* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text) Give the bounding box of a text using TrueType fonts */ PHP_FUNCTION(imagettfbbox) { @@ -3095,7 +3095,7 @@ } /* }}} */ -/* {{{ proto array imagettftext(resource im, int size, int angle, int x, int y, int col, string font_file, string text) +/* {{{ proto array imagettftext(resource im, float size, float angle, int x, int y, int col, string font_file, string text) Write text to the image using a TrueType font */ PHP_FUNCTION(imagettftext) { @@ -3153,36 +3153,36 @@ } #if HAVE_GD_STRINGFTEX - if (extended && EXT) { - /* parse extended info */ + if (extended && EXT) { + /* parse extended info */ - HashPosition pos; + HashPosition pos; - convert_to_array_ex(EXT); + convert_to_array_ex(EXT); - /* walk the assoc array */ - zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), &pos); - do { - zval ** item; - char * key; - ulong num_key; + /* walk the assoc array */ + zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), &pos); + do { + zval ** item; + char * key; + ulong num_key; - if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING) { - continue; - } + if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING) { + continue; + } - if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void **) &item, &pos) == FAILURE) { - continue; - } + if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void **) &item, &pos) == FAILURE) { + continue; + } - if (strcmp("linespacing", key) == 0){ - convert_to_double_ex(item); - strex.flags |= gdFTEX_LINESPACE; - strex.linespacing = Z_DVAL_PP(item); - } + if (strcmp("linespacing", key) == 0){ + convert_to_double_ex(item); + strex.flags |= gdFTEX_LINESPACE; + strex.linespacing = Z_DVAL_PP(item); + } - } while (zend_hash_move_forward_ex(HASH_OF(*EXT), &pos) == SUCCESS); - } + } while (zend_hash_move_forward_ex(HASH_OF(*EXT), &pos) == SUCCESS); + } #endif ptsize = Z_DVAL_PP(PTSIZE); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/standard streamsfuncs.c
sniper Fri Jan 14 23:51:03 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard streamsfuncs.c Log: MFH: cs fix http://cvs.php.net/diff.php/php-src/ext/standard/streamsfuncs.c?r1=1.35.2.9&r2=1.35.2.10&ty=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.35.2.9 php-src/ext/standard/streamsfuncs.c:1.35.2.10 --- php-src/ext/standard/streamsfuncs.c:1.35.2.9Fri Jan 14 03:51:43 2005 +++ php-src/ext/standard/streamsfuncs.c Fri Jan 14 23:51:03 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: streamsfuncs.c,v 1.35.2.9 2005/01/14 08:51:43 dmitry Exp $ */ +/* $Id: streamsfuncs.c,v 1.35.2.10 2005/01/15 04:51:03 sniper Exp $ */ #include "php.h" #include "php_globals.h" @@ -227,11 +227,12 @@ &tv, &errstr TSRMLS_CC) && clistream) { - if (peername) {Z_TYPE_P(peername) = IS_STRING;} + if (peername) { + Z_TYPE_P(peername) = IS_STRING; + } php_stream_to_zval(clistream, return_value); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "accept failed: %s", errstr ? errstr : "Unknown error"); - RETVAL_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /main php.h
sniper Fri Jan 14 15:44:39 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/main php.h Log: MFH: - Fix another generated header include http://cvs.php.net/diff.php/php-src/main/php.h?r1=1.203.2.4&r2=1.203.2.5&ty=u Index: php-src/main/php.h diff -u php-src/main/php.h:1.203.2.4 php-src/main/php.h:1.203.2.5 --- php-src/main/php.h:1.203.2.4Sun Nov 28 07:44:42 2004 +++ php-src/main/php.h Fri Jan 14 15:44:39 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php.h,v 1.203.2.4 2004/11/28 12:44:42 sesser Exp $ */ +/* $Id: php.h,v 1.203.2.5 2005/01/14 20:44:39 sniper Exp $ */ #ifndef PHP_H #define PHP_H @@ -101,7 +101,7 @@ #endif #if HAVE_BUILD_DEFS_H -#include "build-defs.h" +#include #endif /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd gd.c
sniper Fri Jan 14 23:35:41 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd gd.c Log: MFH: ws & proto fix http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.221.2.51&r2=1.221.2.52&ty=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.221.2.51 php-src/ext/gd/gd.c:1.221.2.52 --- php-src/ext/gd/gd.c:1.221.2.51 Fri Jan 14 18:08:48 2005 +++ php-src/ext/gd/gd.c Fri Jan 14 23:35:40 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.221.2.51 2005/01/14 23:08:48 sniper Exp $ */ +/* $Id: gd.c,v 1.221.2.52 2005/01/15 04:35:40 sniper Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -2952,7 +2952,7 @@ #ifdef ENABLE_GD_TTF #if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX -/* {{{ proto array imageftbbox(int size, int angle, string font_file, string text[, array extrainfo]) +/* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo]) Give the bounding box of a text using fonts via freetype2 */ PHP_FUNCTION(imageftbbox) { @@ -2960,7 +2960,7 @@ } /* }}} */ -/* {{{ proto array imagefttext(int im, int size, int angle, int x, int y, int col, string font_file, string text, [array extrainfo]) +/* {{{ proto array imagefttext(resource im, float size, float angle, int x, int y, int col, string font_file, string text [, array extrainfo]) Write text to the image using fonts via freetype2 */ PHP_FUNCTION(imagefttext) { @@ -2969,8 +2969,7 @@ /* }}} */ #endif - -/* {{{ proto array imagettfbbox(int size, int angle, string font_file, string text) +/* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text) Give the bounding box of a text using TrueType fonts */ PHP_FUNCTION(imagettfbbox) { @@ -2978,7 +2977,7 @@ } /* }}} */ -/* {{{ proto array imagettftext(int im, int size, int angle, int x, int y, int col, string font_file, string text) +/* {{{ proto array imagettftext(resource im, float size, float angle, int x, int y, int col, string font_file, string text) Write text to the image using a TrueType font */ PHP_FUNCTION(imagettftext) { @@ -3036,38 +3035,40 @@ } #if HAVE_GD_STRINGFTEX - if (extended && EXT) { - /* parse extended info */ - - HashPosition pos; + if (extended && EXT) { + /* parse extended info */ - convert_to_array_ex(EXT); + HashPosition pos; - /* walk the assoc array */ - zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), &pos); - do { - zval ** item; - char * key; - ulong num_key; + convert_to_array_ex(EXT); - if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING) - continue; + /* walk the assoc array */ + zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), &pos); + do { + zval ** item; + char * key; + ulong num_key; - if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void**)&item, &pos) == FAILURE) - continue; - - if (strcmp("linespacing", key) == 0) { - convert_to_double_ex(item); - strex.flags |= gdFTEX_LINESPACE; - strex.linespacing = Z_DVAL_PP(item); - } + if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING) { + continue; + } + + if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void**)&item, &pos) == FAILURE) { + continue; + } + + if (strcmp("linespacing", key) == 0){ + convert_to_double_ex(item); + strex.flags |= gdFTEX_LINESPACE; + strex.linespacing = Z_DVAL_PP(item); + } - } while(zend_hash_move_forward_ex(HASH_OF(*EXT), &pos) == SUCCESS); - } + } while(zend_hash_move_forward_ex(HASH_OF(*EXT), &pos) == SUCCESS); + } #endif ptsize = Z_DVAL_PP(PTSIZE); - angle = Z_DVAL_PP(ANGLE) * (M_PI/180); /* convert to radians */ + angle = Z_DVAL_PP(ANGLE) * (M_PI / 180); /* convert to radians */ str = (unsigned char *) Z_STRVAL_PP(C);
Re: [PHP-CVS] cvs: php-src(PHP_5_0) /ext/standard streamsfuncs.c
On Fri, 14 Jan 2005, Dmitry Stogov wrote: > dmitryFri Jan 14 03:51:43 2005 EDT > > Modified files: (Branch: PHP_5_0) > /php-src/ext/standard streamsfuncs.c > Log: > Fixed SIGSEGV with ext/standard/tests/network/tcp4loop.phpt and > ext/standard/tests/network/unixloop.phpt > > > http://cvs.php.net/diff.php/php-src/ext/standard/streamsfuncs.c?r1=1.35.2.8&r2=1.35.2.9&ty=u > Index: php-src/ext/standard/streamsfuncs.c > diff -u php-src/ext/standard/streamsfuncs.c:1.35.2.8 > php-src/ext/standard/streamsfuncs.c:1.35.2.9 > --- php-src/ext/standard/streamsfuncs.c:1.35.2.8 Tue Jan 4 10:31:34 2005 > +++ php-src/ext/standard/streamsfuncs.c Fri Jan 14 03:51:43 2005 > @@ -17,7 +17,7 @@ >+--+ > */ > > -/* $Id: streamsfuncs.c,v 1.35.2.8 2005/01/04 15:31:34 wez Exp $ */ > +/* $Id: streamsfuncs.c,v 1.35.2.9 2005/01/14 08:51:43 dmitry Exp $ */ > > #include "php.h" > #include "php_globals.h" > @@ -227,7 +227,7 @@ > &tv, &errstr > TSRMLS_CC) && clistream) { > > - Z_TYPE_P(peername) = IS_STRING; > + if (peername) {Z_TYPE_P(peername) = IS_STRING;} Please adhere to the coding standards: if (peername) { Z_TYPE_P(peername) = IS_STRING; } regards, Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /sapi/apache_hooks php_apache.c
sniper Fri Jan 14 15:45:11 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/sapi/apache_hooks php_apache.c Log: MFH: - Fix another generated header include http://cvs.php.net/diff.php/php-src/sapi/apache_hooks/php_apache.c?r1=1.17&r2=1.17.2.1&ty=u Index: php-src/sapi/apache_hooks/php_apache.c diff -u php-src/sapi/apache_hooks/php_apache.c:1.17 php-src/sapi/apache_hooks/php_apache.c:1.17.2.1 --- php-src/sapi/apache_hooks/php_apache.c:1.17 Sun May 30 13:53:12 2004 +++ php-src/sapi/apache_hooks/php_apache.c Fri Jan 14 15:45:11 2005 @@ -17,7 +17,7 @@ | David Sklar <[EMAIL PROTECTED]> | +--+ */ -/* $Id: php_apache.c,v 1.17 2004/05/30 17:53:12 zeev Exp $ */ +/* $Id: php_apache.c,v 1.17.2.1 2005/01/14 20:45:11 sniper Exp $ */ #include "php_apache_http.h" @@ -25,7 +25,7 @@ #include "zend.h" #include "ap_compat.h" #else -#include "build-defs.h" +#include #endif #ifdef ZTS -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php