]> granicus.if.org Git - php/commitdiff
Initialize variable with fixed value for avoiding compile warnings
authorXinchen Hui <laruence@php.net>
Sun, 7 Aug 2011 11:13:27 +0000 (11:13 +0000)
committerXinchen Hui <laruence@php.net>
Sun, 7 Aug 2011 11:13:27 +0000 (11:13 +0000)
ext/phar/phar.c
ext/phar/phar_object.c
ext/phar/stream.c
ext/phar/util.c

index a5cbab73e36de3f587fc69952690365693da22ca..70035c7a45a72196622833bdedd5dbac971b5de1 100644 (file)
@@ -667,7 +667,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
        php_uint32 manifest_len, manifest_count, manifest_flags, manifest_index, tmp_len, sig_flags;
        php_uint16 manifest_ver;
        long offset;
-       int register_alias, sig_len, temp_alias = 0;
+       int sig_len, register_alias = 0, temp_alias = 0;
        char *signature = NULL;
 
        if (pphar) {
@@ -3393,6 +3393,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
                res = phar_orig_compile_file(file_handle, type TSRMLS_CC);
        } zend_catch {
                failed = 1;
+               res = NULL;
        } zend_end_try();
 
        if (name) {
index 83272210a1deae5cfab064c876a12f1a04752005..01c9cc2e30f195a07c307d128ce5a1c1aad63e77 100644 (file)
@@ -661,7 +661,7 @@ PHP_METHOD(Phar, webPhar)
        char *fname, *basename, *path_info, *mime_type = NULL, *entry, *pt;
        int fname_len, entry_len, code, index_php_len = 0, not_cgi;
        phar_archive_data *phar = NULL;
-       phar_entry_info *info;
+       phar_entry_info *info = NULL;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!saz", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite) == FAILURE) {
                return;
@@ -888,7 +888,7 @@ PHP_METHOD(Phar, webPhar)
 
                        zend_bailout();
                } else {
-                       char *tmp, sa;
+                       char *tmp = NULL, sa = '\0';
                        sapi_header_line ctr = {0};
                        ctr.response_code = 301;
                        ctr.line_len = sizeof("HTTP/1.1 301 Moved Permanently")+1;
index f9bf3f3e01e79583a8cc56abb64c73fc4c58997c..cf2c536206a10a8312eefb6556bdef496091beff 100644 (file)
@@ -421,6 +421,8 @@ static int phar_stream_seek(php_stream *stream, off_t offset, int whence, off_t
                case SEEK_SET :
                        temp = data->zero + offset;
                        break;
+               default :
+                       temp = 0;
        }
        if (temp > data->zero + (off_t) entry->uncompressed_filesize) {
                *newoffset = -1;
index c33fdf2944af9449723111bcd5ecd020b97943b6..4706571b06225869a7eee2fe5846f8b7117f43cf 100644 (file)
@@ -154,6 +154,9 @@ int phar_seek_efp(phar_entry_info *entry, off_t offset, int whence, off_t positi
                case SEEK_SET:
                        temp = eoffset + offset;
                        break;
+               default:
+                       temp = 0;
+                       break;
        }
 
        if (temp > eoffset + (off_t) entry->uncompressed_filesize) {
@@ -1203,7 +1206,7 @@ int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, ch
        phar_archive_data *fd, **fd_ptr;
        char *my_realpath, *save;
        int save_len;
-       ulong fhash, ahash;
+       ulong fhash, ahash = 0;
 
        phar_request_initialize(TSRMLS_C);