Skip to content

Commit

Permalink
And now 721 warnings...
Browse files Browse the repository at this point in the history
  • Loading branch information
abc-codefab committed Jul 5, 2016
1 parent 8ce86d4 commit b96f497
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
10 changes: 5 additions & 5 deletions LFWebAPIKit/NSData+LFHTTPFormExtensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ + (id)dataAsWWWURLEncodedFormFromDictionary:(NSDictionary *)formDictionary
NSMutableString *combinedDataString = [NSMutableString string];
NSEnumerator *enumerator = [formDictionary keyEnumerator];

id key = [enumerator nextObject];
NSString *key = [enumerator nextObject];
if (key) {
id value = [formDictionary objectForKey:key];
[combinedDataString appendString:[NSString stringWithFormat:@"%@=%@", [(NSString*)key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
NSString *value = [[formDictionary objectForKey:key] description];
[combinedDataString appendString:[NSString stringWithFormat:@"%@=%@", [key stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]], [value stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]]]];

while ((key = [enumerator nextObject])) {
value = [formDictionary objectForKey:key];
[combinedDataString appendString:[NSString stringWithFormat:@"&%@=%@", [(NSString*)key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
value = [[formDictionary objectForKey:key] description];
[combinedDataString appendString:[NSString stringWithFormat:@"%@=%@", [key stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]], [value stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]]]];
}
}

Expand Down
8 changes: 1 addition & 7 deletions Source/OFUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,7 @@

NSString *OFEscapedURLStringFromNSStringWithExtraEscapedChars(NSString *inStr, NSString *inEscChars)
{
CFStringRef escaped = CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)inStr, NULL, (CFStringRef)inEscChars, kCFStringEncodingUTF8);

#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
return (NSString *)[(NSString*)escaped autorelease];
#else
return (NSString *)[NSMakeCollectable(escaped) autorelease];
#endif
return [inStr stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet characterSetWithCharactersInString:inEscChars]];
}

NSString *OFGenerateUUIDString(void)
Expand Down
18 changes: 8 additions & 10 deletions Source/ObjectiveFlickr.m
Original file line number Diff line number Diff line change
Expand Up @@ -516,18 +516,16 @@ - (BOOL)callAPIMethodWithGET:(NSString *)inMethodName arguments:(NSDictionary *)
NSMutableString *combinedDataString = [NSMutableString string];
NSEnumerator *enumerator = [formDictionary keyEnumerator];

id key = [enumerator nextObject];
NSString *key = [enumerator nextObject];
if (key) {
id value = [formDictionary objectForKey:key];
[combinedDataString appendString:[NSString stringWithFormat:@"%@=%@",
[(NSString*)key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
OFEscapedURLStringFromNSStringWithExtraEscapedChars([value description], kEscapeChars)]];
NSString *value = [[formDictionary objectForKey:key] description];
[combinedDataString appendString:[NSString stringWithFormat:@"%@=%@", [key stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]], [value stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]]]];

while ((key = [enumerator nextObject])) {
value = [formDictionary objectForKey:key];
[combinedDataString appendString:[NSString stringWithFormat:@"&%@=%@", [(NSString*)key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], OFEscapedURLStringFromNSStringWithExtraEscapedChars([value description], kEscapeChars)]];
}
}
while ((key = [enumerator nextObject])) {
value = [[formDictionary objectForKey:key] description];
[combinedDataString appendString:[NSString stringWithFormat:@"%@=%@", [key stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]], [value stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]]]];
}
}

return [combinedDataString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];
}
Expand Down

0 comments on commit b96f497

Please sign in to comment.