]> granicus.if.org Git - php/commitdiff
Eliminated compiler's warnings and make static analyzer silent
authorXinchen Hui <laruence@php.net>
Tue, 9 Aug 2011 05:11:19 +0000 (05:11 +0000)
committerXinchen Hui <laruence@php.net>
Tue, 9 Aug 2011 05:11:19 +0000 (05:11 +0000)
ext/fileinfo/fileinfo.c
ext/fileinfo/libmagic.patch
ext/fileinfo/libmagic/magic.c

index 1ed82897a41e28da09ec2231e350af417919ac19..6a4b70f25bf2b622145386d4f74dba06eeb92434 100644 (file)
@@ -392,7 +392,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
        long options = 0;
        char *ret_val = NULL, *buffer = NULL;
        int buffer_len;
-       struct php_fileinfo *finfo;
+       struct php_fileinfo *finfo = NULL;
        zval *zfinfo, *zcontext = NULL;
        zval *what;
        char mime_directory[] = "directory";
index 276bb011c5c114e221f14d7f87fd05cc7962cfba..a834c0039f0e83d480a843d3ad9fb2fa2848fb83 100644 (file)
@@ -2020,9 +2020,9 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
 +      if (!stream && inname) {
 +              no_in_stream = 1;
 +#if PHP_API_VERSION < 20100412
-+              stream = php_stream_open_wrapper(inname, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
++              stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
 +#else
-+              stream = php_stream_open_wrapper(inname, "rb", REPORT_ERRORS, NULL);
++              stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS, NULL);
 +#endif
 +      }
 +
index a8bf6d8880f17f752045cbe42b087c36d5b513f2..51cc67209cac67472667d4e9758931b94e160f77 100644 (file)
@@ -291,9 +291,9 @@ file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
        if (!stream && inname) {
                no_in_stream = 1;
 #if PHP_API_VERSION < 20100412
-               stream = php_stream_open_wrapper(inname, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
+               stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
 #else
-               stream = php_stream_open_wrapper(inname, "rb", REPORT_ERRORS, NULL);
+               stream = php_stream_open_wrapper((char *)inname, "rb", REPORT_ERRORS, NULL);
 #endif
        }