nlopess Tue Oct 31 22:13:10 2006 UTC
Modified files:
/php-src/ext/bz2 bz2.c
/php-src/ext/gd gd.c
Log:
cleaning some warnings (char* -> zstr)
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2.c?r1=1.29&r2=1.30&diff_format=u
Index: php-src/ext/bz2/bz2.c
diff -u php-src/ext/bz2/bz2.c:1.29 php-src/ext/bz2/bz2.c:1.30
--- php-src/ext/bz2/bz2.c:1.29 Sun Oct 8 13:34:20 2006
+++ php-src/ext/bz2/bz2.c Tue Oct 31 22:13:09 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: bz2.c,v 1.29 2006/10/08 13:34:20 bjori Exp $ */
+/* $Id: bz2.c,v 1.30 2006/10/31 22:13:09 nlopess Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -477,7 +477,7 @@
Compresses a string into BZip2 encoded data */
static PHP_FUNCTION(bzcompress)
{
- char *source; /* String to compress */
+ zstr source; /* String to compress */
int source_len;
zend_uchar source_type;
long block_size = 4, /* Block size for compression algorithm
*/
@@ -498,14 +498,14 @@
dest = emalloc(dest_len + 1);
if (source_type == IS_UNICODE) {
- source = zend_unicode_to_ascii((UChar*)source, source_len
TSRMLS_CC);
- if (!source) {
+ source.s = zend_unicode_to_ascii(source.u, source_len
TSRMLS_CC);
+ if (!source.s) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or
ASCII-Unicode string expected, non-ASCII-Unicode string received");
RETURN_FALSE;
}
}
- error = BZ2_bzBuffToBuffCompress(dest, &dest_len, source, source_len,
block_size, 0, work_factor);
+ error = BZ2_bzBuffToBuffCompress(dest, &dest_len, source.s, source_len,
block_size, 0, work_factor);
if (error != BZ_OK) {
efree(dest);
RETVAL_LONG(error);
@@ -520,7 +520,7 @@
}
if (source_type == IS_UNICODE) {
- efree(source);
+ efree(source.s);
}
}
/* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.360&r2=1.361&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.360 php-src/ext/gd/gd.c:1.361
--- php-src/ext/gd/gd.c:1.360 Wed Oct 18 16:04:25 2006
+++ php-src/ext/gd/gd.c Tue Oct 31 22:13:09 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.360 2006/10/18 16:04:25 bjori Exp $ */
+/* $Id: gd.c,v 1.361 2006/10/31 22:13:09 nlopess Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -3205,7 +3205,7 @@
zval *IM;
long size, x, y, col;
zend_uchar str_type;
- char *str;
+ zstr str;
int str_len, i;
gdImagePtr im;
gdFontPtr font;
@@ -3215,8 +3215,8 @@
}
if (str_type == IS_UNICODE) {
- str = zend_unicode_to_ascii((UChar*)str, str_len TSRMLS_CC);
- if (!str) {
+ str.s = zend_unicode_to_ascii(str.u, str_len TSRMLS_CC);
+ if (!str.s) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or
ASCII-Unicode string expected, non-ASCII-Unicode string received. Consider
using the TTF functions for Unicode output");
RETURN_FALSE;
}
@@ -3228,21 +3228,21 @@
switch (mode) {
case 0:
- gdImageChar(im, font, x, y, (int) ((unsigned
char)str[0]), col);
+ gdImageChar(im, font, x, y, (int) ((unsigned
char)str.s[0]), col);
break;
case 1:
- php_gdimagecharup(im, font, x, y, (int) ((unsigned
char)str[0]), col);
+ php_gdimagecharup(im, font, x, y, (int) ((unsigned
char)str.s[0]), col);
break;
case 2:
for (i = 0; (i < str_len); i++) {
- gdImageChar(im, font, x, y, (int) ((unsigned
char)str[i]), col);
+ gdImageChar(im, font, x, y, (int) ((unsigned
char)str.s[i]), col);
x += font->w;
}
break;
case 3: {
for (i = 0; (i < str_len); i++) {
/* php_gdimagecharup(im, font, x, y, (int)
str[i], col); */
- gdImageCharUp(im, font, x, y, (int) ((unsigned
char)str[i]), col);
+ gdImageCharUp(im, font, x, y, (int) ((unsigned
char)str.s[i]), col);
y -= font->w;
}
break;
@@ -3250,7 +3250,7 @@
}
if (str_type == IS_UNICODE) {
- efree(str);
+ efree(str.s);
}
RETURN_TRUE;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php