Skip to content

Commit

Permalink
updated several types for osx Compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
V01dZer0 committed Feb 24, 2014
1 parent 1287700 commit 1442274
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions ZipArchive.h
Expand Up @@ -17,7 +17,7 @@
files processed (as an integer from 0 to 100), the number of files processed so far and the
total number of files in the archive is called after each file is processed.
*/
typedef void(^ZipArchiveProgressUpdateBlock)(int percentage, int filesProcessed, int numFiles);
typedef void(^ZipArchiveProgressUpdateBlock)(int percentage, int filesProcessed, unsigned long numFiles);

/**
@protocol
Expand Down Expand Up @@ -65,12 +65,12 @@ typedef void(^ZipArchiveProgressUpdateBlock)(int percentage, int filesProcessed,

@interface ZipArchive : NSObject {
@private
void* _zipFile;
void* _unzFile;
void* _zipFile;
void* _unzFile;

int _numFiles;
NSString* _password;
id _delegate;
unsigned long _numFiles;
NSString* _password;
id _delegate;
ZipArchiveProgressUpdateBlock _progressBlock;

NSArray* _unzippedFiles;
Expand All @@ -81,7 +81,7 @@ typedef void(^ZipArchiveProgressUpdateBlock)(int percentage, int filesProcessed,

/** a delegate object conforming to ZipArchiveDelegate protocol */
@property (nonatomic, retain) id<ZipArchiveDelegate> delegate;
@property (nonatomic, readonly) int numFiles;
@property (nonatomic, readonly) unsigned long numFiles;
@property (nonatomic, copy) ZipArchiveProgressUpdateBlock progressBlock;

/**
Expand Down
4 changes: 2 additions & 2 deletions ZipArchive.m
Expand Up @@ -144,7 +144,7 @@ -(BOOL) addFileToZip:(NSString*) file newname:(NSString*) newname;
{
data = [ NSData dataWithContentsOfFile:file];
uLong crcValue = crc32( 0L,NULL, 0L );
crcValue = crc32( crcValue, (const Bytef*)[data bytes], [data length] );
crcValue = crc32( crcValue, (const Bytef*)[data bytes], (unsigned int)[data length] );
ret = zipOpenNewFileInZip3( _zipFile,
(const char*) [newname cStringUsingEncoding:self.stringEncoding],
&zipInfo,
Expand All @@ -168,7 +168,7 @@ -(BOOL) addFileToZip:(NSString*) file newname:(NSString*) newname;
{
data = [ NSData dataWithContentsOfFile:file];
}
unsigned int dataLen = [data length];
unsigned int dataLen = (unsigned int)[data length];
ret = zipWriteInFileInZip( _zipFile, (const void*)[data bytes], dataLen);
if( ret!=Z_OK )
{
Expand Down

0 comments on commit 1442274

Please sign in to comment.