aboutsummaryrefslogtreecommitdiff
path: root/contrib/minizip/zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/minizip/zip.c')
-rw-r--r--contrib/minizip/zip.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
index a753c17..4e611e1 100644
--- a/contrib/minizip/zip.c
+++ b/contrib/minizip/zip.c
@@ -158,7 +158,7 @@ typedef struct
158#ifndef NOCRYPT 158#ifndef NOCRYPT
159 unsigned long keys[3]; /* keys defining the pseudo-random sequence */ 159 unsigned long keys[3]; /* keys defining the pseudo-random sequence */
160 const z_crc_t* pcrc_32_tab; 160 const z_crc_t* pcrc_32_tab;
161 int crypt_header_size; 161 unsigned crypt_header_size;
162#endif 162#endif
163} curfile64_info; 163} curfile64_info;
164 164
@@ -301,7 +301,7 @@ local int zip64local_putValue (const zlib_filefunc64_32_def* pzlib_filefunc_def,
301 } 301 }
302 } 302 }
303 303
304 if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) 304 if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,(uLong)nbByte)!=(uLong)nbByte)
305 return ZIP_ERRNO; 305 return ZIP_ERRNO;
306 else 306 else
307 return ZIP_OK; 307 return ZIP_OK;
@@ -337,8 +337,8 @@ local uLong zip64local_TmzDateToDosDate(const tm_zip* ptm)
337 else if (year>=80) 337 else if (year>=80)
338 year-=80; 338 year-=80;
339 return 339 return
340 (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | 340 (uLong) (((uLong)(ptm->tm_mday) + (32 * (uLong)(ptm->tm_mon+1)) + (512 * year)) << 16) |
341 ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); 341 (((uLong)ptm->tm_sec/2) + (32 * (uLong)ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
342} 342}
343 343
344 344
@@ -522,7 +522,7 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f
522 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && 522 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
523 ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) 523 ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
524 { 524 {
525 uPosFound = uReadPos+i; 525 uPosFound = uReadPos+(unsigned)i;
526 break; 526 break;
527 } 527 }
528 528
@@ -586,7 +586,7 @@ local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib
586 // Signature "0x07064b50" Zip64 end of central directory locater 586 // Signature "0x07064b50" Zip64 end of central directory locater
587 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) 587 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
588 { 588 {
589 uPosFound = uReadPos+i; 589 uPosFound = uReadPos+(unsigned)i;
590 break; 590 break;
591 } 591 }
592 } 592 }
@@ -637,7 +637,7 @@ local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib
637 return relativeOffset; 637 return relativeOffset;
638} 638}
639 639
640int LoadCentralDirectoryRecord(zip64_internal* pziinit) 640local int LoadCentralDirectoryRecord(zip64_internal* pziinit)
641{ 641{
642 int err=ZIP_OK; 642 int err=ZIP_OK;
643 ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ 643 ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
@@ -955,7 +955,7 @@ extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append)
955 return zipOpen3(pathname,append,NULL,NULL); 955 return zipOpen3(pathname,append,NULL,NULL);
956} 956}
957 957
958int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) 958local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local)
959{ 959{
960 /* write the local header */ 960 /* write the local header */
961 int err; 961 int err;
@@ -1034,8 +1034,8 @@ int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_ex
1034 // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file) 1034 // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file)
1035 zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream); 1035 zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream);
1036 1036
1037 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2); 1037 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)HeaderID,2);
1038 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2); 1038 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)DataSize,2);
1039 1039
1040 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8); 1040 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8);
1041 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8); 1041 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8);
@@ -1516,7 +1516,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s
1516 zip64_internal* zi; 1516 zip64_internal* zi;
1517 ZPOS64_T compressed_size; 1517 ZPOS64_T compressed_size;
1518 uLong invalidValue = 0xffffffff; 1518 uLong invalidValue = 0xffffffff;
1519 short datasize = 0; 1519 unsigned datasize = 0;
1520 int err=ZIP_OK; 1520 int err=ZIP_OK;
1521 1521
1522 if (file == NULL) 1522 if (file == NULL)
@@ -1752,7 +1752,7 @@ extern int ZEXPORT zipCloseFileInZip (zipFile file)
1752 return zipCloseFileInZipRaw (file,0,0); 1752 return zipCloseFileInZipRaw (file,0,0);
1753} 1753}
1754 1754
1755int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) 1755local int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip)
1756{ 1756{
1757 int err = ZIP_OK; 1757 int err = ZIP_OK;
1758 ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writing_offset; 1758 ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writing_offset;
@@ -1774,7 +1774,7 @@ int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eo
1774 return err; 1774 return err;
1775} 1775}
1776 1776
1777int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) 1777local int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1778{ 1778{
1779 int err = ZIP_OK; 1779 int err = ZIP_OK;
1780 1780
@@ -1813,7 +1813,7 @@ int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centra
1813 } 1813 }
1814 return err; 1814 return err;
1815} 1815}
1816int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) 1816local int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1817{ 1817{
1818 int err = ZIP_OK; 1818 int err = ZIP_OK;
1819 1819
@@ -1861,7 +1861,7 @@ int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir,
1861 return err; 1861 return err;
1862} 1862}
1863 1863
1864int Write_GlobalComment(zip64_internal* zi, const char* global_comment) 1864local int Write_GlobalComment(zip64_internal* zi, const char* global_comment)
1865{ 1865{
1866 int err = ZIP_OK; 1866 int err = ZIP_OK;
1867 uInt size_global_comment = 0; 1867 uInt size_global_comment = 0;
@@ -1962,7 +1962,7 @@ extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHe
1962 if(pData == NULL || *dataLen < 4) 1962 if(pData == NULL || *dataLen < 4)
1963 return ZIP_PARAMERROR; 1963 return ZIP_PARAMERROR;
1964 1964
1965 pNewHeader = (char*)ALLOC(*dataLen); 1965 pNewHeader = (char*)ALLOC((unsigned)*dataLen);
1966 pTmp = pNewHeader; 1966 pTmp = pNewHeader;
1967 1967
1968 while(p < (pData + *dataLen)) 1968 while(p < (pData + *dataLen))