diff --git a/ChangeLog b/ChangeLog index 92c3b3445..1353a29b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-01-11 Richard Frith-Macdonald + + * Source/NSMapTable.m: + * Source/NSHashTable.m: + * Source/NSPropertyList.m: + * Source/GSStream.m: + * Source/NSURLResponse.m: + * Source/NSPointerArray.m: + * Source/Additions/GSMime.m: + * Source/NSURLRequest.m: + Fix mistaken strategy for avoiding clang warnings. + 2010-01-11 Fred Kiefer * Source/NSConcreteMapTable.m (NSCreateMapTableWithZone): Set the diff --git a/Source/Additions/GSMime.m b/Source/Additions/GSMime.m index ce4a224ca..968f48a3e 100644 --- a/Source/Additions/GSMime.m +++ b/Source/Additions/GSMime.m @@ -2869,11 +2869,13 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info); +@interface _GSMutableInsensitiveDictionary : NSMutableDictionary +@end + @implementation GSMimeHeader static NSCharacterSet *nonToken = nil; static NSCharacterSet *tokenSet = nil; -static Class dictClass = 0; + (void) initialize { @@ -2899,7 +2901,6 @@ static Class dictClass = 0; { documentClass = [GSMimeDocument class]; } - dictClass = NSClassFromString(@"_GSMutableInsensitiveDictionary"); } } @@ -3496,7 +3497,7 @@ appendString(NSMutableData *m, unsigned offset, unsigned fold, { if (params == nil) { - params = [dictClass new]; + params = [_GSMutableInsensitiveDictionary new]; } [params setObject: v forKey: k]; } @@ -3516,7 +3517,7 @@ appendString(NSMutableData *m, unsigned offset, unsigned fold, NSEnumerator *e = [d keyEnumerator]; NSString *k; - m = [[dictClass alloc] initWithCapacity: c]; + m = [[_GSMutableInsensitiveDictionary alloc] initWithCapacity: c]; while ((k = [e nextObject]) != nil) { [m setObject: [d objectForKey: k] diff --git a/Source/GSStream.m b/Source/GSStream.m index 0dc5d3bc3..f9f90808b 100644 --- a/Source/GSStream.m +++ b/Source/GSStream.m @@ -945,18 +945,14 @@ static RunLoopEventType typeForStream(NSStream *aStream) @end +@interface GSLocalServerStream : GSServerStream +@end @implementation GSServerStream -static Class localServerClass = 0; - + (void) initialize { GSMakeWeakPointer(self, "delegate"); - if (localServerClass == 0) - { - localServerClass = NSClassFromString(@"GSLocalServerStream"); - } } + (id) serverStreamToAddr: (NSString*)addr port: (NSInteger)port @@ -972,7 +968,7 @@ static Class localServerClass = 0; + (id) serverStreamToAddr: (NSString*)addr { - return AUTORELEASE([[localServerClass alloc] initToAddr: addr]); + return AUTORELEASE([[GSLocalServerStream alloc] initToAddr: addr]); } - (id) initToAddr: (NSString*)addr port: (NSInteger)port @@ -988,7 +984,7 @@ static Class localServerClass = 0; - (id) initToAddr: (NSString*)addr { RELEASE(self); - return [[localServerClass alloc] initToAddr: addr]; + return [[GSLocalServerStream alloc] initToAddr: addr]; } - (void) acceptWithInputStream: (NSInputStream **)inputStream diff --git a/Source/NSHashTable.m b/Source/NSHashTable.m index 2969d593f..195f1c805 100644 --- a/Source/NSHashTable.m +++ b/Source/NSHashTable.m @@ -37,6 +37,9 @@ #include "NSCallBacks.h" #include "GSPrivate.h" +@interface NSConcreteHashTable : NSHashTable +@end + @implementation NSHashTable @@ -57,7 +60,7 @@ static Class concreteClass = 0; if (abstractClass == 0) { abstractClass = [NSHashTable class]; - concreteClass = NSClassFromString(@"NSConcreteHashTable"); + concreteClass = [NSConcreteHashTable class]; } } diff --git a/Source/NSMapTable.m b/Source/NSMapTable.m index 3fd688750..f0ea5c1c9 100644 --- a/Source/NSMapTable.m +++ b/Source/NSMapTable.m @@ -36,6 +36,9 @@ #include "Foundation/NSDebug.h" #include "NSCallBacks.h" +@interface NSConcreteMapTable : NSMapTable +@end + @implementation NSMapTable static Class abstractClass = 0; @@ -55,7 +58,7 @@ static Class concreteClass = 0; if (abstractClass == 0) { abstractClass = [NSMapTable class]; - concreteClass = NSClassFromString(@"NSConcreteMapTable"); + concreteClass = [NSConcreteMapTable class]; } } diff --git a/Source/NSPointerArray.m b/Source/NSPointerArray.m index 683c90d55..19ec64038 100644 --- a/Source/NSPointerArray.m +++ b/Source/NSPointerArray.m @@ -41,6 +41,16 @@ static Class abstractClass = Nil; static Class concreteClass = Nil; +@interface NSConcretePointerArray : NSPointerArray +{ + PFInfo _pf; + NSUInteger _count; + void **_contents; + unsigned _capacity; + unsigned _grow_factor; +} +@end + @implementation NSPointerArray @@ -58,7 +68,7 @@ static Class concreteClass = Nil; if (abstractClass == Nil) { abstractClass = [NSPointerArray class]; - concreteClass = NSClassFromString(@"NSConcretePointerArray"); + concreteClass = [NSConcretePointerArray class]; } } @@ -202,16 +212,6 @@ static Class concreteClass = Nil; @end -@interface NSConcretePointerArray : NSPointerArray -{ - PFInfo _pf; - NSUInteger _count; - void **_contents; - unsigned _capacity; - unsigned _grow_factor; -} -@end - @implementation NSConcretePointerArray - (void) _raiseRangeExceptionWithIndex: (NSUInteger)index from: (SEL)sel diff --git a/Source/NSPropertyList.m b/Source/NSPropertyList.m index d47747956..abff0b7f2 100644 --- a/Source/NSPropertyList.m +++ b/Source/NSPropertyList.m @@ -112,15 +112,11 @@ extern BOOL GSScanDouble(unichar*, unsigned, double*); - (void) unescape; @end +@interface GSSloppyXMLParser : NSXMLParser +@end + @implementation GSXMLPListParser -static Class theClass = 0; - -+ (void) initialize -{ - theClass = NSClassFromString(@"GSSloppyXMLParser"); -} - - (void) dealloc { RELEASE(key); @@ -136,7 +132,7 @@ static Class theClass = 0; { if ((self = [super init]) != nil) { - theParser = [[theClass alloc] initWithData: data]; + theParser = [[GSSloppyXMLParser alloc] initWithData: data]; [theParser setDelegate: self]; opts = options; } diff --git a/Source/NSURLRequest.m b/Source/NSURLRequest.m index 94559e13b..cb6c88f8c 100644 --- a/Source/NSURLRequest.m +++ b/Source/NSURLRequest.m @@ -51,6 +51,9 @@ typedef struct { #define this ((Internal*)(((priv*)self)->_NSURLRequestInternal)) #define inst ((Internal*)(((priv*)o)->_NSURLRequestInternal)) +@interface _GSMutableInsensitiveDictionary : NSMutableDictionary +@end + @implementation NSURLRequest + (id) allocWithZone: (NSZone*)z @@ -354,13 +357,6 @@ typedef struct { @implementation NSMutableURLRequest (NSMutableHTTPURLRequest) -static Class dictClass = 0; - -+ (void) initialize -{ - dictClass = NSClassFromString(@"_GSMutableInsensitiveDictionary"); -} - - (void) addValue: (NSString *)value forHTTPHeaderField: (NSString *)field { NSString *old = [self valueForHTTPHeaderField: field]; @@ -422,7 +418,7 @@ static Class dictClass = 0; { if (this->headers == nil) { - this->headers = [dictClass new]; + this->headers = [_GSMutableInsensitiveDictionary new]; } [this->headers setObject: value forKey: field]; } diff --git a/Source/NSURLResponse.m b/Source/NSURLResponse.m index a34a50641..5073657f0 100644 --- a/Source/NSURLResponse.m +++ b/Source/NSURLResponse.m @@ -50,15 +50,11 @@ typedef struct { #define inst ((Internal*)(((priv*)o)->_NSURLResponseInternal)) +@interface _GSMutableInsensitiveDictionary : NSMutableDictionary +@end + @implementation NSURLResponse (Private) -static Class dictClass = 0; - -+ (void) initialize -{ - dictClass = NSClassFromString(@"_GSMutableInsensitiveDictionary"); -} - - (void) _setHeaders: (id)headers { NSEnumerator *e; @@ -137,7 +133,7 @@ static Class dictClass = 0; { if (this->headers == 0) { - this->headers = [dictClass new]; + this->headers = [_GSMutableInsensitiveDictionary new]; } [this->headers setObject: value forKey: field]; }