diff --git a/ChangeLog b/ChangeLog index cc91f5d6e..46aac0a9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-11-04 Wolfgang Sourdeau + + * SoObjects/SOGo/NSDictionary+Utilities.m + (+dictionaryFromStringsFile:): instantiate autoreleased objects. + + * SoObjects/SOGo/NSArray+Utilities.m (-jsonRepresentation): + instantiate autoreleased objects. + 2009-10-30 Francis Lachapelle * UI/WebServerResources/SchedulerUI.js: the events list is now diff --git a/SoObjects/SOGo/NSArray+Utilities.m b/SoObjects/SOGo/NSArray+Utilities.m index 75cfc383a..81f442726 100644 --- a/SoObjects/SOGo/NSArray+Utilities.m +++ b/SoObjects/SOGo/NSArray+Utilities.m @@ -174,18 +174,12 @@ NSEnumerator *elements; NSString *representation; - jsonElements = [NSMutableArray new]; - + jsonElements = [NSMutableArray array]; elements = [self objectEnumerator]; - currentElement = [elements nextObject]; - while (currentElement) - { - [jsonElements addObject: [currentElement jsonRepresentation]]; - currentElement = [elements nextObject]; - } + while ((currentElement = [elements nextObject])) + [jsonElements addObject: [currentElement jsonRepresentation]]; representation = [NSString stringWithFormat: @"[%@]", [jsonElements componentsJoinedByString: @", "]]; - [jsonElements autorelease]; return representation; } diff --git a/SoObjects/SOGo/NSDictionary+Utilities.m b/SoObjects/SOGo/NSDictionary+Utilities.m index b3ac16dfa..06890dd2a 100644 --- a/SoObjects/SOGo/NSDictionary+Utilities.m +++ b/SoObjects/SOGo/NSDictionary+Utilities.m @@ -29,10 +29,11 @@ #import #import -#import #import "NSArray+Utilities.h" #import "NSObject+Utilities.h" +#import "NSString+Utilities.h" + #import "NSDictionary+Utilities.h" @implementation NSDictionary (SOGoDictionaryUtilities) @@ -43,15 +44,14 @@ NSMutableData *content; NSDictionary *newDictionary; - content = [NSMutableData new]; + content = [NSMutableData data]; [content appendBytes: "{" length: 1]; [content appendData: [NSData dataWithContentsOfFile: file]]; [content appendBytes: "}" length: 1]; serialized = [[NSString alloc] initWithData: content encoding: NSUTF8StringEncoding]; - [content release]; + [serialized autorelease]; newDictionary = [serialized propertyList]; - [serialized release]; return newDictionary; } @@ -62,20 +62,17 @@ NSString *representation, *currentKey, *currentValue, *currentPair; NSEnumerator *keys; - values = [NSMutableArray new]; + values = [NSMutableArray array]; keys = [[self allKeys] objectEnumerator]; - currentKey = [keys nextObject]; - while (currentKey) + while ((currentKey = [keys nextObject])) { currentValue = [[self objectForKey: currentKey] jsonRepresentation]; currentPair = [NSString stringWithFormat: @"%@: %@", [currentKey jsonRepresentation], currentValue]; [values addObject: currentPair]; - currentKey = [keys nextObject]; } representation = [NSString stringWithFormat: @"{%@}", [values componentsJoinedByString: @", "]]; - [values release]; return representation; } @@ -202,6 +199,4 @@ @" the number of keys."]; } - @end - diff --git a/general.make b/general.make index fd1ae6520..dc22c26b9 100644 --- a/general.make +++ b/general.make @@ -1,6 +1,6 @@ ifeq ($(test-uninitialized),yes) ifeq ($(debug),yes) -ADDITIONAL_OBJCFLAGS=-O1 +ADDITIONAL_OBJCFLAGS=-O0 else ADDITIONAL_OBJCFLAGS=-Wuninitialized endif