]> granicus.if.org Git - php/commitdiff
cleaning some warnings (char* -> zstr)
authorNuno Lopes <nlopess@php.net>
Tue, 31 Oct 2006 22:13:09 +0000 (22:13 +0000)
committerNuno Lopes <nlopess@php.net>
Tue, 31 Oct 2006 22:13:09 +0000 (22:13 +0000)
ext/bz2/bz2.c
ext/gd/gd.c

index 23150e3f28a309e4ea6cfba1e588549c2b2b6313..efd7af37a3127db04bcdb117dec1e3b5137f6278 100644 (file)
@@ -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);
        }
 }
 /* }}} */
index 9e490c8ea628eb7910a9199d70b5c9bbf29db5c5..80099690273b10012a582632812a7611d4026886 100644 (file)
@@ -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;