diff options
Diffstat (limited to 'ext/phar/stream.c')
-rw-r--r-- | ext/phar/stream.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 5aa6aa43ea..a500758420 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -213,11 +213,11 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha if (idata->internal_file->uncompressed_filesize == 0 && idata->internal_file->compressed_filesize == 0 && (pzoption = zend_hash_str_find(pharcontext, "compress", sizeof("compress")-1)) != NULL - && Z_TYPE_P(pzoption) == IS_LONG - && (Z_LVAL_P(pzoption) & ~PHAR_ENT_COMPRESSION_MASK) == 0 + && Z_TYPE_P(pzoption) == IS_INT + && (Z_IVAL_P(pzoption) & ~PHAR_ENT_COMPRESSION_MASK) == 0 ) { idata->internal_file->flags &= ~PHAR_ENT_COMPRESSION_MASK; - idata->internal_file->flags |= Z_LVAL_P(pzoption); + idata->internal_file->flags |= Z_IVAL_P(pzoption); } if ((pzoption = zend_hash_str_find(pharcontext, "metadata", sizeof("metadata")-1)) != NULL) { if (Z_TYPE(idata->internal_file->metadata) != IS_UNDEF) { @@ -377,7 +377,7 @@ static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRML got = php_stream_read(data->fp, buf, MIN(count, entry->uncompressed_filesize - data->position)); data->position = php_stream_tell(data->fp) - data->zero; - stream->eof = (data->position == (off_t) entry->uncompressed_filesize); + stream->eof = (data->position == (php_off_t) entry->uncompressed_filesize); return got; } @@ -386,12 +386,12 @@ static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRML /** * Used for fseek($fp) on a phar file handle */ -static int phar_stream_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) /* {{{ */ +static int phar_stream_seek(php_stream *stream, php_off_t offset, int whence, php_off_t *newoffset TSRMLS_DC) /* {{{ */ { phar_entry_data *data = (phar_entry_data *)stream->abstract; phar_entry_info *entry; int res; - off_t temp; + php_off_t temp; if (data->internal_file->link) { entry = phar_get_link_source(data->internal_file TSRMLS_CC); @@ -412,7 +412,7 @@ static int phar_stream_seek(php_stream *stream, off_t offset, int whence, off_t default: temp = 0; } - if (temp > data->zero + (off_t) entry->uncompressed_filesize) { + if (temp > data->zero + (php_off_t) entry->uncompressed_filesize) { *newoffset = -1; return -1; } @@ -440,7 +440,7 @@ static size_t phar_stream_write(php_stream *stream, const char *buf, size_t coun return -1; } data->position = php_stream_tell(data->fp); - if (data->position > (off_t)data->internal_file->uncompressed_filesize) { + if (data->position > (php_off_t)data->internal_file->uncompressed_filesize) { data->internal_file->uncompressed_filesize = data->position; } data->internal_file->compressed_filesize = data->internal_file->uncompressed_filesize; |