From c994c8ccb69098b33b65521950cfc2d108f36d60 Mon Sep 17 00:00:00 2001 From: Vladimir Kelin Date: Thu, 20 Feb 2020 22:33:21 +0300 Subject: [PATCH] Fix the bug with gzFile: you should use it without `*` pointer. Otherwise the compiler will give the error: "Incompatible pointer types initializing 'gzFile *' (aka 'struct gzFile_s **') with an expression of type 'gzFile' (aka 'struct gzFile_s *')" --- Classes/NVHGzipFile.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/NVHGzipFile.m b/Classes/NVHGzipFile.m index 4830c35..f1f9139 100644 --- a/Classes/NVHGzipFile.m +++ b/Classes/NVHGzipFile.m @@ -26,7 +26,7 @@ typedef NS_ENUM(NSInteger, NVHGzipFileErrorType) @interface NVHGzipFile () -@property (nonatomic,assign) CGFloat fileSizeFraction; +@property (nonatomic,assign) double fileSizeFraction; @end @@ -103,7 +103,7 @@ - (NSInteger)inflateGzip:(NSString *)sourcePath // Convert source path into something a C library can handle const char *sourceCString = [sourcePath cStringUsingEncoding:NSASCIIStringEncoding]; - gzFile *sourceGzFile = gzopen(sourceCString, "rb"); + gzFile sourceGzFile = gzopen(sourceCString, "rb"); unsigned int bufferLength = 1024*256; //Thats like 256Kb void *buffer = malloc(bufferLength); @@ -221,7 +221,7 @@ - (NSInteger)deflateToGzip:(NSString *)destinationPath // Convert destination path into something a C library can handle const char *destinationCString = [destinationPath cStringUsingEncoding:NSASCIIStringEncoding]; - gzFile *destinationGzFile = gzopen(destinationCString, "wb"); + gzFile destinationGzFile = gzopen(destinationCString, "wb"); unsigned int bufferLength = 1024*256; //Thats like 256Kb void *buffer = malloc(bufferLength);