Solved some type conversion warnings; replaced #warning with // TODO
This commit is contained in:
+1
-1
@@ -121,7 +121,7 @@ static voidpf file_build_ioposix(FILE *file, const char *filename)
|
|||||||
return NULL;
|
return NULL;
|
||||||
ioposix = (FILE_IOPOSIX*)malloc(sizeof(FILE_IOPOSIX));
|
ioposix = (FILE_IOPOSIX*)malloc(sizeof(FILE_IOPOSIX));
|
||||||
ioposix->file = file;
|
ioposix->file = file;
|
||||||
ioposix->filenameLength = strlen(filename) + 1;
|
ioposix->filenameLength = (int) (strlen(filename) + 1);
|
||||||
ioposix->filename = (char*)malloc(ioposix->filenameLength * sizeof(char));
|
ioposix->filename = (char*)malloc(ioposix->filenameLength * sizeof(char));
|
||||||
strncpy(ioposix->filename, filename, ioposix->filenameLength);
|
strncpy(ioposix->filename, filename, ioposix->filenameLength);
|
||||||
return (voidpf)ioposix;
|
return (voidpf)ioposix;
|
||||||
|
|||||||
+5
-5
@@ -646,14 +646,14 @@ local int unzGoToNextDisk(unzFile file)
|
|||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return UNZ_PARAMERROR;
|
return UNZ_PARAMERROR;
|
||||||
pfile_in_zip_read_info = s->pfile_in_zip_read;
|
pfile_in_zip_read_info = s->pfile_in_zip_read;
|
||||||
number_disk_next = s->number_disk;
|
number_disk_next = (int) s->number_disk;
|
||||||
|
|
||||||
if ((pfile_in_zip_read_info != NULL) && (pfile_in_zip_read_info->rest_read_uncompressed > 0))
|
if ((pfile_in_zip_read_info != NULL) && (pfile_in_zip_read_info->rest_read_uncompressed > 0))
|
||||||
/* We are currently reading a file and we need the next sequential disk */
|
/* We are currently reading a file and we need the next sequential disk */
|
||||||
number_disk_next += 1;
|
number_disk_next += 1;
|
||||||
else
|
else
|
||||||
/* Goto the disk for the current file */
|
/* Goto the disk for the current file */
|
||||||
number_disk_next = s->cur_file_info.disk_num_start;
|
number_disk_next = (int) s->cur_file_info.disk_num_start;
|
||||||
|
|
||||||
if (number_disk_next != s->number_disk)
|
if (number_disk_next != s->number_disk)
|
||||||
{
|
{
|
||||||
@@ -1390,8 +1390,8 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, unsigned len)
|
|||||||
uInt total_bytes_read = 0;
|
uInt total_bytes_read = 0;
|
||||||
|
|
||||||
if (pfile_in_zip_read_info->stream.next_in != NULL)
|
if (pfile_in_zip_read_info->stream.next_in != NULL)
|
||||||
bytes_not_read = pfile_in_zip_read_info->read_buffer + UNZ_BUFSIZE -
|
bytes_not_read = (uInt) (pfile_in_zip_read_info->read_buffer + UNZ_BUFSIZE -
|
||||||
pfile_in_zip_read_info->stream.next_in;
|
pfile_in_zip_read_info->stream.next_in);
|
||||||
bytes_to_read -= bytes_not_read;
|
bytes_to_read -= bytes_not_read;
|
||||||
if (bytes_not_read > 0)
|
if (bytes_not_read > 0)
|
||||||
memcpy(pfile_in_zip_read_info->read_buffer, pfile_in_zip_read_info->stream.next_in, bytes_not_read);
|
memcpy(pfile_in_zip_read_info->read_buffer, pfile_in_zip_read_info->stream.next_in, bytes_not_read);
|
||||||
@@ -1407,7 +1407,7 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, unsigned len)
|
|||||||
ZLIB_FILEFUNC_SEEK_SET) != 0)
|
ZLIB_FILEFUNC_SEEK_SET) != 0)
|
||||||
return UNZ_ERRNO;
|
return UNZ_ERRNO;
|
||||||
|
|
||||||
bytes_read = ZREAD64(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream,
|
bytes_read = (int) ZREAD64(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream,
|
||||||
pfile_in_zip_read_info->read_buffer + bytes_not_read + total_bytes_read,
|
pfile_in_zip_read_info->read_buffer + bytes_not_read + total_bytes_read,
|
||||||
bytes_to_read - total_bytes_read);
|
bytes_to_read - total_bytes_read);
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -510,7 +510,7 @@ local int zipGoToFirstDisk(zipFile file)
|
|||||||
return err;
|
return err;
|
||||||
number_disk_next = 0;
|
number_disk_next = 0;
|
||||||
if (zi->number_disk_with_CD > 0)
|
if (zi->number_disk_with_CD > 0)
|
||||||
number_disk_next = zi->number_disk_with_CD - 1;
|
number_disk_next = (int) (zi->number_disk_with_CD - 1);
|
||||||
err = zipGoToSpecificDisk(file, number_disk_next, (zi->append == APPEND_STATUS_ADDINZIP));
|
err = zipGoToSpecificDisk(file, number_disk_next, (zi->append == APPEND_STATUS_ADDINZIP));
|
||||||
if ((err == ZIP_ERRNO) && (zi->append == APPEND_STATUS_ADDINZIP))
|
if ((err == ZIP_ERRNO) && (zi->append == APPEND_STATUS_ADDINZIP))
|
||||||
err = zipGoToSpecificDisk(file, number_disk_next, 0);
|
err = zipGoToSpecificDisk(file, number_disk_next, 0);
|
||||||
@@ -535,7 +535,7 @@ local int zipGoToNextDisk(zipFile file)
|
|||||||
if (zi->disk_size == 0)
|
if (zi->disk_size == 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
number_disk_next = zi->number_disk + 1;
|
number_disk_next = (int) (zi->number_disk + 1);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -661,14 +661,14 @@ extern zipFile ZEXPORT zipOpen4(const void *pathname, int append, ZPOS64_T disk_
|
|||||||
zip64_internal ziinit;
|
zip64_internal ziinit;
|
||||||
zip64_internal* zi;
|
zip64_internal* zi;
|
||||||
ZPOS64_T byte_before_the_zipfile; /* byte before the zipfile, (>0 for sfx)*/
|
ZPOS64_T byte_before_the_zipfile; /* byte before the zipfile, (>0 for sfx)*/
|
||||||
ZPOS64_T size_central_dir; /* size of the central directory */
|
ZPOS64_T size_central_dir = 0; /* size of the central directory */
|
||||||
ZPOS64_T offset_central_dir; /* offset of start of central directory */
|
ZPOS64_T offset_central_dir = 0; /* offset of start of central directory */
|
||||||
ZPOS64_T number_entry_CD; /* total number of entries in the central dir */
|
ZPOS64_T number_entry_CD = 0; /* total number of entries in the central dir */
|
||||||
ZPOS64_T number_entry;
|
ZPOS64_T number_entry;
|
||||||
ZPOS64_T central_pos;
|
ZPOS64_T central_pos;
|
||||||
ZPOS64_T size_central_dir_to_read;
|
ZPOS64_T size_central_dir_to_read;
|
||||||
uLong uL;
|
uLong uL;
|
||||||
uLong size_comment;
|
uLong size_comment = 0;
|
||||||
size_t buf_size = SIZEDATA_INDATABLOCK;
|
size_t buf_size = SIZEDATA_INDATABLOCK;
|
||||||
void* buf_read;
|
void* buf_read;
|
||||||
int err = ZIP_OK;
|
int err = ZIP_OK;
|
||||||
@@ -1428,7 +1428,7 @@ local int zip64FlushWriteBuffer(zip64_internal* zi)
|
|||||||
max_write = (uInt)size_available;
|
max_write = (uInt)size_available;
|
||||||
}
|
}
|
||||||
|
|
||||||
written = ZWRITE64(zi->z_filefunc, zi->filestream, zi->ci.buffered_data + total_written, max_write);
|
written = (int) ZWRITE64(zi->z_filefunc, zi->filestream, zi->ci.buffered_data + total_written, max_write);
|
||||||
|
|
||||||
if (ZERROR64(zi->z_filefunc,zi->filestream))
|
if (ZERROR64(zi->z_filefunc,zi->filestream))
|
||||||
{
|
{
|
||||||
@@ -1784,7 +1784,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file, ZPOS64_T uncompressed_si
|
|||||||
|
|
||||||
/* Local file header is stored on previous disk, switch to make edits */
|
/* Local file header is stored on previous disk, switch to make edits */
|
||||||
if (zi->ci.number_disk != cur_number_disk)
|
if (zi->ci.number_disk != cur_number_disk)
|
||||||
zipGoToSpecificDisk(file, zi->ci.number_disk, 1);
|
zipGoToSpecificDisk(file, (int) (zi->ci.number_disk), 1);
|
||||||
|
|
||||||
if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET) != 0)
|
if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET) != 0)
|
||||||
err = ZIP_ERRNO;
|
err = ZIP_ERRNO;
|
||||||
@@ -1818,7 +1818,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file, ZPOS64_T uncompressed_si
|
|||||||
|
|
||||||
/* Now switch back again to the disk we were on before */
|
/* Now switch back again to the disk we were on before */
|
||||||
if (zi->ci.number_disk != cur_number_disk)
|
if (zi->ci.number_disk != cur_number_disk)
|
||||||
zipGoToSpecificDisk(file, cur_number_disk, 1);
|
zipGoToSpecificDisk(file, (int) cur_number_disk, 1);
|
||||||
|
|
||||||
if (ZSEEK64(zi->z_filefunc,zi->filestream, cur_pos_inzip, ZLIB_FILEFUNC_SEEK_SET) != 0)
|
if (ZSEEK64(zi->z_filefunc,zi->filestream, cur_pos_inzip, ZLIB_FILEFUNC_SEEK_SET) != 0)
|
||||||
err = ZIP_ERRNO;
|
err = ZIP_ERRNO;
|
||||||
@@ -1877,7 +1877,7 @@ extern int ZEXPORT zipClose(zipFile file, const char* global_comment)
|
|||||||
{
|
{
|
||||||
if ((err == ZIP_OK) && (ldi->filled_in_this_block > 0))
|
if ((err == ZIP_OK) && (ldi->filled_in_this_block > 0))
|
||||||
{
|
{
|
||||||
write = ZWRITE64(zi->z_filefunc, zi->filestream, ldi->data, ldi->filled_in_this_block);
|
write = (int) ZWRITE64(zi->z_filefunc, zi->filestream, ldi->data, ldi->filled_in_this_block);
|
||||||
if (write != ldi->filled_in_this_block)
|
if (write != ldi->filled_in_this_block)
|
||||||
err = ZIP_ERRNO;
|
err = ZIP_ERRNO;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,7 +210,7 @@
|
|||||||
|
|
||||||
- (void) test02ZipAndUnzip5GB {
|
- (void) test02ZipAndUnzip5GB {
|
||||||
|
|
||||||
#warning Remove to enable this test, but be careful: takes 5 minutes and consumes 5 GB of disk space
|
// TODO Remove to enable this test, but be careful: takes 5 minutes and consumes 5 GB of disk space
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NSString *documentsDir= [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
|
NSString *documentsDir= [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
|
||||||
|
|||||||
+3
-3
@@ -253,7 +253,7 @@ local gzFile gz_open(path, fd, mode)
|
|||||||
|
|
||||||
/* save the current position for rewinding (only if reading) */
|
/* save the current position for rewinding (only if reading) */
|
||||||
if (state->mode == GZ_READ) {
|
if (state->mode == GZ_READ) {
|
||||||
state->start = LSEEK(state->fd, 0, SEEK_CUR);
|
state->start = (z_off64_t) LSEEK(state->fd, 0, SEEK_CUR);
|
||||||
if (state->start == -1) state->start = 0;
|
if (state->start == -1) state->start = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,7 +393,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
|
|||||||
/* if within raw area while reading, just go there */
|
/* if within raw area while reading, just go there */
|
||||||
if (state->mode == GZ_READ && state->how == COPY &&
|
if (state->mode == GZ_READ && state->how == COPY &&
|
||||||
state->x.pos + offset >= 0) {
|
state->x.pos + offset >= 0) {
|
||||||
ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
|
ret = (z_off64_t) LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
return -1;
|
return -1;
|
||||||
state->x.have = 0;
|
state->x.have = 0;
|
||||||
@@ -489,7 +489,7 @@ z_off64_t ZEXPORT gzoffset64(file)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* compute and return effective offset in file */
|
/* compute and return effective offset in file */
|
||||||
offset = LSEEK(state->fd, 0, SEEK_CUR);
|
offset = (z_off64_t) LSEEK(state->fd, 0, SEEK_CUR);
|
||||||
if (offset == -1)
|
if (offset == -1)
|
||||||
return -1;
|
return -1;
|
||||||
if (state->mode == GZ_READ) /* reading */
|
if (state->mode == GZ_READ) /* reading */
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ local int gz_load(state, buf, len, have)
|
|||||||
|
|
||||||
*have = 0;
|
*have = 0;
|
||||||
do {
|
do {
|
||||||
ret = read(state->fd, buf + *have, len - *have);
|
ret = (int) read(state->fd, buf + *have, len - *have);
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
break;
|
break;
|
||||||
*have += ret;
|
*have += ret;
|
||||||
|
|||||||
+2
-2
@@ -81,7 +81,7 @@ local int gz_comp(state, flush)
|
|||||||
|
|
||||||
/* write directly if requested */
|
/* write directly if requested */
|
||||||
if (state->direct) {
|
if (state->direct) {
|
||||||
got = write(state->fd, strm->next_in, strm->avail_in);
|
got = (int) write(state->fd, strm->next_in, strm->avail_in);
|
||||||
if (got < 0 || (unsigned)got != strm->avail_in) {
|
if (got < 0 || (unsigned)got != strm->avail_in) {
|
||||||
gz_error(state, Z_ERRNO, zstrerror());
|
gz_error(state, Z_ERRNO, zstrerror());
|
||||||
return -1;
|
return -1;
|
||||||
@@ -98,7 +98,7 @@ local int gz_comp(state, flush)
|
|||||||
if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
|
if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
|
||||||
(flush != Z_FINISH || ret == Z_STREAM_END))) {
|
(flush != Z_FINISH || ret == Z_STREAM_END))) {
|
||||||
have = (unsigned)(strm->next_out - state->x.next);
|
have = (unsigned)(strm->next_out - state->x.next);
|
||||||
if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
|
if (have && ((got = (int) write(state->fd, state->x.next, have)) < 0 ||
|
||||||
(unsigned)got != have)) {
|
(unsigned)got != have)) {
|
||||||
gz_error(state, Z_ERRNO, zstrerror());
|
gz_error(state, Z_ERRNO, zstrerror());
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user