diff --git a/ChangeLog b/ChangeLog index 7968ce3db..bdf518fdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2011-02-23 Richard Frith-Macdonald + + * Source\NSCalendarDate.m: + * Source\NSArray.m: + * Source\NSDebug.m: + * Source\NSCalendar.m: + * Source\NSURLResponse.m: + * Source\NSObject.m: + * Source\NSDecimalNumber.m: + * Source\Additions\GSMime.m: + * Source\NSDateFormatter.m: + * Source\NSDate.m: + * Source\NSDictionary.m: + * Source\NSSet.m: + * Headers\Foundation\NSCalendarDate.h: + * Headers\Foundation\NSDecimalNumber.h: + * Headers\Foundation\NSDate.h: + * Headers\Foundation\NSArray.h: + * Headers\Foundation\NSDictionary.h: + * Headers\Foundation\NSSet.h: + Tweaks to avoid compiler warnings on mingw and to make the + -descriptionWithLocale: method consistently take an id argument + as it now does on OSX. + 2011-02-23 Richard Frith-Macdonald * Source/GSString.m: Fix bugs in upper and lower casing of constant diff --git a/Headers/Foundation/NSArray.h b/Headers/Foundation/NSArray.h index 5ad5485f9..8d60efeed 100644 --- a/Headers/Foundation/NSArray.h +++ b/Headers/Foundation/NSArray.h @@ -107,8 +107,8 @@ extern "C" { - (NSEnumerator*) reverseObjectEnumerator; - (NSString*) description; -- (NSString*) descriptionWithLocale: (NSDictionary*)locale; -- (NSString*) descriptionWithLocale: (NSDictionary*)locale +- (NSString*) descriptionWithLocale: (id)locale; +- (NSString*) descriptionWithLocale: (id)locale indent: (NSUInteger)level; - (BOOL) writeToFile: (NSString*)path atomically: (BOOL)useAuxiliaryFile; diff --git a/Headers/Foundation/NSCalendarDate.h b/Headers/Foundation/NSCalendarDate.h index 94ead4f4f..5ca65fb3c 100644 --- a/Headers/Foundation/NSCalendarDate.h +++ b/Headers/Foundation/NSCalendarDate.h @@ -106,7 +106,7 @@ extern "C" { - (NSString*) descriptionWithCalendarFormat: (NSString*)format; - (NSString*) descriptionWithCalendarFormat: (NSString*)format locale: (NSDictionary*)locale; -- (NSString*) descriptionWithLocale: (NSDictionary*)locale; +- (NSString*) descriptionWithLocale: (id)locale; // Getting and Setting Calendar Formats - (NSString*) calendarFormat; diff --git a/Headers/Foundation/NSDate.h b/Headers/Foundation/NSDate.h index 746a5830c..42d414a08 100644 --- a/Headers/Foundation/NSDate.h +++ b/Headers/Foundation/NSDate.h @@ -89,7 +89,7 @@ GS_EXPORT const NSTimeInterval NSTimeIntervalSince1970; - (NSString*) descriptionWithCalendarFormat: (NSString*)format timeZone: (NSTimeZone*)aTimeZone locale: (NSDictionary*)l; -- (NSString*) descriptionWithLocale: (NSDictionary*)locale; +- (NSString*) descriptionWithLocale: (id)locale; // Adding and getting intervals diff --git a/Headers/Foundation/NSDecimalNumber.h b/Headers/Foundation/NSDecimalNumber.h index b521fd0d8..e45502acf 100644 --- a/Headers/Foundation/NSDecimalNumber.h +++ b/Headers/Foundation/NSDecimalNumber.h @@ -311,7 +311,7 @@ extern "C" { /** * Returns string version of number formatted according to locale. */ -- (NSString *)descriptionWithLocale:(NSDictionary *)locale; +- (NSString *)descriptionWithLocale:(id)locale; /** * Returns underlying value as a double, which may be an diff --git a/Headers/Foundation/NSDictionary.h b/Headers/Foundation/NSDictionary.h index 3d3c9a96e..47ae5503f 100644 --- a/Headers/Foundation/NSDictionary.h +++ b/Headers/Foundation/NSDictionary.h @@ -55,8 +55,8 @@ extern "C" { - (NSUInteger) count; // Primitive - (NSString*) description; - (NSString*) descriptionInStringsFileFormat; -- (NSString*) descriptionWithLocale: (NSDictionary*)locale; -- (NSString*) descriptionWithLocale: (NSDictionary*)locale +- (NSString*) descriptionWithLocale: (id)locale; +- (NSString*) descriptionWithLocale: (id)locale indent: (NSUInteger)level; - (id) init; diff --git a/Headers/Foundation/NSSet.h b/Headers/Foundation/NSSet.h index a1ff063ce..4ffb1b904 100644 --- a/Headers/Foundation/NSSet.h +++ b/Headers/Foundation/NSSet.h @@ -56,7 +56,7 @@ extern "C" { - (BOOL) containsObject: (id)anObject; - (NSUInteger) count; - (NSString*) description; -- (NSString*) descriptionWithLocale: (NSDictionary*)locale; +- (NSString*) descriptionWithLocale: (id)locale; - (id) init; - (id) initWithArray: (NSArray*)other; diff --git a/Source/Additions/GSMime.m b/Source/Additions/GSMime.m index 168d55f1c..3f1087156 100644 --- a/Source/Additions/GSMime.m +++ b/Source/Additions/GSMime.m @@ -5287,7 +5287,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold, { return NO; } - if (NO == [[self content] isEqual: [other content]]) + if (NO == [[self content] isEqual: [(GSMimeDocument*)other content]]) { return NO; } diff --git a/Source/NSArray.m b/Source/NSArray.m index c0406729a..a27f7fadc 100644 --- a/Source/NSArray.m +++ b/Source/NSArray.m @@ -1245,7 +1245,7 @@ compare(id elem1, id elem2, void* context) * Returns the result of invoking -descriptionWithLocale:indent: * with a zero indent. */ -- (NSString*) descriptionWithLocale: (NSDictionary*)locale +- (NSString*) descriptionWithLocale: (id)locale { return [self descriptionWithLocale: locale indent: 0]; } @@ -1260,7 +1260,7 @@ compare(id elem1, id elem2, void* context) * The items in the property list string appear in the same order as * they appear in the receiver. */ -- (NSString*) descriptionWithLocale: (NSDictionary*)locale +- (NSString*) descriptionWithLocale: (id)locale indent: (NSUInteger)level { NSString *result = nil; diff --git a/Source/NSCalendar.m b/Source/NSCalendar.m index d3cdd522d..6db607e35 100644 --- a/Source/NSCalendar.m +++ b/Source/NSCalendar.m @@ -197,9 +197,11 @@ static NSRecursiveLock *classLock = nil; + (id) currentCalendar { NSCalendar *result; + NSLocale *locale; NSCalendar *cal; - cal = [[NSLocale currentLocale] objectForKey: NSLocaleCalendar]; + locale = [NSLocale currentLocale]; + cal = [locale objectForKey: NSLocaleCalendar]; result = [[NSCalendar alloc] initWithCalendarIdentifier: [cal calendarIdentifier]]; diff --git a/Source/NSCalendarDate.m b/Source/NSCalendarDate.m index 702c9e1f2..1325ffca6 100644 --- a/Source/NSCalendarDate.m +++ b/Source/NSCalendarDate.m @@ -2460,7 +2460,7 @@ static void outputValueWithFormat(int v, char *fldfmt, DescriptionInfo *info) * the specified locale dictionary.
* Calls -descriptionWithCalendarFormat:locale: to do this. */ -- (NSString*) descriptionWithLocale: (NSDictionary *)locale +- (NSString*) descriptionWithLocale: (id)locale { return [self descriptionWithCalendarFormat: _calendar_format locale: locale]; } diff --git a/Source/NSDate.m b/Source/NSDate.m index 5c07af19c..731ae8075 100644 --- a/Source/NSDate.m +++ b/Source/NSDate.m @@ -1192,7 +1192,7 @@ otherTime(NSDate* other) * Returns a string representation of the receiver formatted according * to the default format string and time zone, but using the given locale. */ -- (NSString *) descriptionWithLocale: (NSDictionary *)locale +- (NSString *) descriptionWithLocale: (id)locale { // Easiest to just have NSCalendarDate do the work for us NSString *s; diff --git a/Source/NSDateFormatter.m b/Source/NSDateFormatter.m index 85d72ca18..fbc28970c 100644 --- a/Source/NSDateFormatter.m +++ b/Source/NSDateFormatter.m @@ -29,6 +29,7 @@ #define EXPOSE_NSDateFormatter_IVARS 1 #import "Foundation/NSArray.h" #import "Foundation/NSDate.h" +#import "Foundation/NSDictionary.h" #import "Foundation/NSCalendar.h" #import "Foundation/NSCalendarDate.h" #import "Foundation/NSLocale.h" @@ -458,11 +459,11 @@ static NSDateFormatterBehavior _defaultBehavior = 0; NSMutableDictionary *dict; NSLocale *locale; - dict = [[NSLocale componentsFromLocaleIdentifier: [internal->_locale localeIdentifier]] - mutableCopy]; + dict = [[NSLocale componentsFromLocaleIdentifier: + [internal->_locale localeIdentifier]] mutableCopy]; [dict setValue: calendar forKey: NSLocaleCalendar]; locale = [[NSLocale alloc] initWithLocaleIdentifier: - [NSLocale localeIdentifierFromComponents: (NSDictionary *)dict]]; + [NSLocale localeIdentifierFromComponents: dict]]; [self setLocale: locale]; /* Don't have to use udat_setCalendar here because -setLocale: will take care of setting the calendar when it resets the formatter. */ diff --git a/Source/NSDebug.m b/Source/NSDebug.m index f4c12eea2..df377dd16 100644 --- a/Source/NSDebug.m +++ b/Source/NSDebug.m @@ -33,6 +33,7 @@ #import "GNUstepBase/GSLock.h" #import "Foundation/NSArray.h" #import "Foundation/NSData.h" +#import "Foundation/NSDictionary.h" #import "Foundation/NSLock.h" #import "Foundation/NSNotification.h" #import "Foundation/NSNotificationQueue.h" @@ -878,13 +879,14 @@ static jbuf_type * jbuf() { NSMutableData *d; + NSMutableDictionary *dict; - d = [[[NSThread currentThread] threadDictionary] objectForKey: @"GSjbuf"]; + dict = [[NSThread currentThread] threadDictionary]; + d = [dict objectForKey: @"GSjbuf"]; if (d == nil) { d = [[NSMutableData alloc] initWithLength: sizeof(jbuf_type)]; - [[[NSThread currentThread] threadDictionary] setObject: d - forKey: @"GSjbuf"]; + [dict setObject: d forKey: @"GSjbuf"]; RELEASE(d); } return (jbuf_type*)[d mutableBytes]; diff --git a/Source/NSDecimalNumber.m b/Source/NSDecimalNumber.m index f4edb1882..09098cb9e 100644 --- a/Source/NSDecimalNumber.m +++ b/Source/NSDecimalNumber.m @@ -602,7 +602,7 @@ static NSDecimalNumber *one; isNegative: NO]; } -- (NSString*) descriptionWithLocale: (NSDictionary*)locale +- (NSString*) descriptionWithLocale: (id)locale { return NSDecimalString(&data, locale); } diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index 4355cfe85..760685d1e 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -1057,7 +1057,7 @@ compareIt(id o1, id o2, void* context) * Returns the result of invoking -descriptionWithLocale:indent: with * a zero indent. */ -- (NSString*) descriptionWithLocale: (NSDictionary*)locale +- (NSString*) descriptionWithLocale: (id)locale { return [self descriptionWithLocale: locale indent: 0]; } @@ -1073,7 +1073,7 @@ compareIt(id o1, id o2, void* context) * listed by key in ascending order. If not, the order in which the * items are listed is undefined. */ -- (NSString*) descriptionWithLocale: (NSDictionary*)locale +- (NSString*) descriptionWithLocale: (id)locale indent: (NSUInteger)level { NSMutableString *result = nil; diff --git a/Source/NSObject.m b/Source/NSObject.m index a2f4f897c..8a830b394 100644 --- a/Source/NSObject.m +++ b/Source/NSObject.m @@ -2137,12 +2137,12 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak)); * the -description method and discards the locale * information. */ -- (NSString*) descriptionWithLocale: (NSDictionary*)aLocale +- (NSString*) descriptionWithLocale: (id)aLocale { return [self description]; } -+ (NSString*) descriptionWithLocale: (NSDictionary*)aLocale ++ (NSString*) descriptionWithLocale: (id)aLocale { return [self description]; } @@ -2152,13 +2152,13 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak)); * the -descriptionWithLocale: method and discards the * level information. */ -- (NSString*) descriptionWithLocale: (NSDictionary*)aLocale +- (NSString*) descriptionWithLocale: (id)aLocale indent: (NSUInteger)level { return [self descriptionWithLocale: aLocale]; } -+ (NSString*) descriptionWithLocale: (NSDictionary*)aLocale ++ (NSString*) descriptionWithLocale: (id)aLocale indent: (NSUInteger)level { return [self descriptionWithLocale: aLocale]; diff --git a/Source/NSSet.m b/Source/NSSet.m index 1c05fcad8..fae94c338 100644 --- a/Source/NSSet.m +++ b/Source/NSSet.m @@ -619,7 +619,7 @@ static Class NSMutableSet_concrete_class; /** * Returns listing of objects in set. */ -- (NSString*) descriptionWithLocale: (NSDictionary*)locale +- (NSString*) descriptionWithLocale: (id)locale { return [[self allObjects] descriptionWithLocale: locale]; } diff --git a/Source/NSURLResponse.m b/Source/NSURLResponse.m index c463ceeb0..57e3f073d 100644 --- a/Source/NSURLResponse.m +++ b/Source/NSURLResponse.m @@ -66,10 +66,10 @@ typedef struct { { NSString *k; - e = [headers keyEnumerator]; + e = [(NSDictionary*)headers keyEnumerator]; while ((k = [e nextObject]) != nil) { - v = [headers objectForKey: k]; + v = [(NSDictionary*)headers objectForKey: k]; [self _setValue: v forHTTPHeaderField: k]; } } @@ -77,7 +77,7 @@ typedef struct { { GSMimeHeader *h; - e = [headers objectEnumerator]; + e = [(NSArray*)headers objectEnumerator]; while ((h = [e nextObject]) != nil) { NSString *n = [h namePreservingCase: YES];