Index: utils/ofzip/OFZIP.m ================================================================== --- utils/ofzip/OFZIP.m +++ utils/ofzip/OFZIP.m @@ -19,11 +19,10 @@ #include #import "OFApplication.h" #import "OFArray.h" #import "OFDate.h" -#import "OFDictionary.h" #import "OFFile.h" #import "OFOptionsParser.h" #import "OFSet.h" #import "OFStdIOStream.h" #import "OFZIPArchive.h" @@ -50,11 +49,11 @@ int _exitStatus; } - (OFZIPArchive*)openArchiveWithPath: (OFString*)path; - (void)listFilesInArchive: (OFZIPArchive*)archive; -- (void)extractFiles: (OFArray*)files +- (void)extractFiles: (OFArray OF_GENERIC(OFString*)*)files fromArchive: (OFZIPArchive*)archive; @end OF_APPLICATION_DELEGATE(OFZIP) @@ -108,13 +107,12 @@ - (void)applicationDidFinishLaunching { OFOptionsParser *optionsParser = [OFOptionsParser parserWithOptions: @"fhlnqvx"]; of_unichar_t option, mode = '\0'; - OFArray *remainingArguments; + OFArray OF_GENERIC(OFString*) *remainingArguments, *files; OFZIPArchive *archive; - OFArray *files; while ((option = [optionsParser nextOption]) != '\0') { switch (option) { case 'f': if (_override < 0) @@ -226,12 +224,14 @@ return archive; } - (void)listFilesInArchive: (OFZIPArchive*)archive { - OFEnumerator *enumerator = [[archive entries] objectEnumerator]; + OFEnumerator OF_GENERIC(OFZIPArchiveEntry*) *enumerator; OFZIPArchiveEntry *entry; + + enumerator = [[archive entries] objectEnumerator]; while ((entry = [enumerator nextObject]) != nil) { void *pool = objc_autoreleasePoolPush(); [of_stdout writeLine: [entry fileName]]; @@ -279,23 +279,27 @@ objc_autoreleasePoolPop(pool); } } -- (void)extractFiles: (OFArray*)files +- (void)extractFiles: (OFArray OF_GENERIC(OFString*)*)files fromArchive: (OFZIPArchive*)archive { - OFEnumerator *enumerator = [[archive entries] objectEnumerator]; + OFEnumerator OF_GENERIC(OFZIPArchiveEntry*) *entryEnumerator; OFZIPArchiveEntry *entry; - bool all = ([files count] == 0); - OFMutableSet *missing = [OFMutableSet setWithArray: files]; + bool all; + OFMutableSet OF_GENERIC(OFString*) *missing; + + all = ([files count] == 0); + missing = [OFMutableSet setWithArray: files]; - while ((entry = [enumerator nextObject]) != nil) { + entryEnumerator = [[archive entries] objectEnumerator]; + while ((entry = [entryEnumerator nextObject]) != nil) { void *pool = objc_autoreleasePoolPush(); OFString *fileName = [entry fileName]; OFString *outFileName = [fileName stringByStandardizingPath]; - OFEnumerator *componentEnumerator; + OFEnumerator OF_GENERIC(OFString*) *componentEnumerator; OFString *component, *directory; OFStream *stream; OFFile *output; char buffer[BUFFER_SIZE]; uint64_t written = 0, size = [entry uncompressedSize]; @@ -438,10 +442,11 @@ outer_loop_end: objc_autoreleasePoolPop(pool); } if ([missing count] > 0) { + OFEnumerator OF_GENERIC(OFString*) *enumerator; OFString *file; enumerator = [missing objectEnumerator]; while ((file = [enumerator nextObject]) != nil) [of_stderr writeFormat: