From de57a1f8719229bea5f02329e327bb8b98830ef6 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Tue, 31 Oct 2006 22:13:09 +0000 Subject: [PATCH] cleaning some warnings (char* -> zstr) --- ext/bz2/bz2.c | 10 +++++----- ext/gd/gd.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index 23150e3f28..efd7af37a3 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -477,7 +477,7 @@ static PHP_FUNCTION(bzerror) 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 @@ static PHP_FUNCTION(bzcompress) 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 @@ static PHP_FUNCTION(bzcompress) } if (source_type == IS_UNICODE) { - efree(source); + efree(source.s); } } /* }}} */ diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 9e490c8ea6..8009969027 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -3205,7 +3205,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) 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 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) } 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 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) 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 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) } if (str_type == IS_UNICODE) { - efree(str); + efree(str.s); } RETURN_TRUE; -- 2.40.0