OSX compat tweaks

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32323 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-02-23 11:52:17 +00:00
parent 654c8497ff
commit 59d4be1265
19 changed files with 60 additions and 31 deletions

View file

@ -1,3 +1,27 @@
2011-02-23 Richard Frith-Macdonald <rfm@gnu.org>
* 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 <rfm@gnu.org>
* Source/GSString.m: Fix bugs in upper and lower casing of constant

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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 <code>double</code>, which may be an

View file

@ -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;

View file

@ -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;

View file

@ -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;
}

View file

@ -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;

View file

@ -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]];

View file

@ -2460,7 +2460,7 @@ static void outputValueWithFormat(int v, char *fldfmt, DescriptionInfo *info)
* the specified locale dictionary.<br />
* Calls -descriptionWithCalendarFormat:locale: to do this.
*/
- (NSString*) descriptionWithLocale: (NSDictionary *)locale
- (NSString*) descriptionWithLocale: (id)locale
{
return [self descriptionWithCalendarFormat: _calendar_format locale: locale];
}

View file

@ -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;

View file

@ -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. */

View file

@ -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];

View file

@ -602,7 +602,7 @@ static NSDecimalNumber *one;
isNegative: NO];
}
- (NSString*) descriptionWithLocale: (NSDictionary*)locale
- (NSString*) descriptionWithLocale: (id)locale
{
return NSDecimalString(&data, locale);
}

View file

@ -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;

View file

@ -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];

View file

@ -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];
}

View file

@ -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];