Skip to content

Commit

Permalink
Fixed some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Zorn committed Aug 11, 2012
1 parent f87a37f commit 1a53946
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Classes/KKKeychain.m
Expand Up @@ -57,16 +57,16 @@ + (BOOL)setString:(NSString*)string forKey:(NSString*)key
[addDict setObject:data forKey:(id)kSecValueData];

res = SecItemAdd((CFDictionaryRef)addDict, NULL);
NSAssert1(res == errSecSuccess, @"Recieved %d from SecItemAdd!", res);
NSAssert1(res == errSecSuccess, @"Recieved %ld from SecItemAdd!", res);
}
} else if (res == errSecSuccess) {
// Modify an existing one
// Actually pull it now of the keychain at this point.
NSDictionary *attributeDict = [NSDictionary dictionaryWithObject:data forKey:(id)kSecValueData];
res = SecItemUpdate((CFDictionaryRef)existsQueryDictionary, (CFDictionaryRef)attributeDict);
NSAssert1(res == errSecSuccess, @"SecItemUpdated returned %d!", res);
NSAssert1(res == errSecSuccess, @"SecItemUpdated returned %ld!", res);
} else {
NSAssert1(NO, @"Received %d from SecItemCopyMatching!", res);
NSAssert1(NO, @"Received %ld from SecItemCopyMatching!", res);
}
return YES;
}
Expand All @@ -92,7 +92,7 @@ + (NSString*)getStringForKey:(NSString*)key
NSString *string = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
return string;
} else {
NSAssert1(res == errSecItemNotFound, @"SecItemCopyMatching returned %d!", res);
NSAssert1(res == errSecItemNotFound, @"SecItemCopyMatching returned %ld!", res);
}

return nil;
Expand Down
34 changes: 22 additions & 12 deletions Classes/unzip.c
Expand Up @@ -607,11 +607,14 @@ local int unzlocal_GetCurrentFileInfoInternal (file,


/* we check the magic */
if (err==UNZ_OK)
if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
if (err==UNZ_OK) {
if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) {
err=UNZ_ERRNO;
else if (uMagic!=0x02014b50)
}
else if (uMagic!=0x02014b50) {
err=UNZ_BADZIPFILE;
}
}

if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK)
err=UNZ_ERRNO;
Expand Down Expand Up @@ -687,11 +690,13 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
else
uSizeRead = extraFieldBufferSize;

if (lSeek!=0)
if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
if (lSeek!=0) {
if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) {
lSeek=0;
else
} else {
err=UNZ_ERRNO;
}
}
if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead)
err=UNZ_ERRNO;
Expand All @@ -712,11 +717,13 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
else
uSizeRead = commentBufferSize;

if (lSeek!=0)
if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
if (lSeek!=0) {
if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) {
lSeek=0;
else
} else {
err=UNZ_ERRNO;
}
}
if ((file_info.size_file_comment>0) && (commentBufferSize>0))
if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
err=UNZ_ERRNO;
Expand Down Expand Up @@ -976,11 +983,14 @@ local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
return UNZ_ERRNO;


if (err==UNZ_OK)
if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
if (err==UNZ_OK) {
if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) {
err=UNZ_ERRNO;
else if (uMagic!=0x04034b50)
}
else if (uMagic!=0x04034b50) {
err=UNZ_BADZIPFILE;
}
}

if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
err=UNZ_ERRNO;
Expand Down

0 comments on commit 1a53946

Please sign in to comment.