From 2dcdcb2e89e1a94330c00436a7457c108a3e6717 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 18 Nov 2009 23:15:34 +0000 Subject: [PATCH] Monotone-Parent: a1ad485763dbb256f42488a0cf3e8c8061604d83 Monotone-Revision: d656a1a3c9e97c1b1a23a7959821aa3c54780d86 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-18T23:15:34 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ SoObjects/SOGo/NSDictionary+BSJSONAdditions.h | 2 +- SoObjects/SOGo/NSDictionary+BSJSONAdditions.m | 4 ++-- SoObjects/SOGo/NSScanner+BSJSONAdditions.h | 2 +- SoObjects/SOGo/NSScanner+BSJSONAdditions.m | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6e325c4c..1d74e93ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-11-18 Wolfgang Sourdeau + * SoObjects/SOGo/NSDictionary+BSJSONAdditions.m + (+dictionaryWithJSONString:): this constructor now explicitly + returns an NSMutableDictionary to avoid messing with mutable + copies and useless allocation/deallocation in the callers. + * Main/SOGo.m (+initialize): removed the "debugObjectAllocation" global variable since "debugLeaks" has the same meaning. Instantiate a "SOGoStartupLogger" object in order to avoid using NSLog when the diff --git a/SoObjects/SOGo/NSDictionary+BSJSONAdditions.h b/SoObjects/SOGo/NSDictionary+BSJSONAdditions.h index 5cbfa1b05..1a32190a2 100644 --- a/SoObjects/SOGo/NSDictionary+BSJSONAdditions.h +++ b/SoObjects/SOGo/NSDictionary+BSJSONAdditions.h @@ -28,7 +28,7 @@ extern const int jsonDoNotIndent; @interface NSDictionary (BSJSONAdditions) -+ (NSDictionary *)dictionaryWithJSONString:(NSString *)jsonString; ++ (NSMutableDictionary *)dictionaryWithJSONString:(NSString *)jsonString; - (NSString *)jsonStringValue; @end diff --git a/SoObjects/SOGo/NSDictionary+BSJSONAdditions.m b/SoObjects/SOGo/NSDictionary+BSJSONAdditions.m index 0569376bb..e9c658b86 100644 --- a/SoObjects/SOGo/NSDictionary+BSJSONAdditions.m +++ b/SoObjects/SOGo/NSDictionary+BSJSONAdditions.m @@ -35,10 +35,10 @@ const int jsonDoNotIndent = -1; @implementation NSDictionary (BSJSONAdditions) -+ (NSDictionary *)dictionaryWithJSONString:(NSString *)jsonString ++ (NSMutableDictionary *)dictionaryWithJSONString:(NSString *)jsonString { NSScanner *scanner = [[NSScanner alloc] initWithString:jsonString]; - NSDictionary *dictionary = nil; + NSMutableDictionary *dictionary = nil; [scanner scanJSONObject:&dictionary]; [scanner release]; return dictionary; diff --git a/SoObjects/SOGo/NSScanner+BSJSONAdditions.h b/SoObjects/SOGo/NSScanner+BSJSONAdditions.h index 1505c9228..88059178e 100644 --- a/SoObjects/SOGo/NSScanner+BSJSONAdditions.h +++ b/SoObjects/SOGo/NSScanner+BSJSONAdditions.h @@ -45,7 +45,7 @@ extern NSString *jsonNullString; @interface NSScanner (PrivateBSJSONAdditions) -- (BOOL)scanJSONObject:(NSDictionary **)dictionary; +- (BOOL)scanJSONObject:(NSMutableDictionary **)dictionary; - (BOOL)scanJSONArray:(NSArray **)array; - (BOOL)scanJSONString:(NSString **)string; - (BOOL)scanJSONValue:(id *)value; diff --git a/SoObjects/SOGo/NSScanner+BSJSONAdditions.m b/SoObjects/SOGo/NSScanner+BSJSONAdditions.m index d1af2b006..b23138f30 100644 --- a/SoObjects/SOGo/NSScanner+BSJSONAdditions.m +++ b/SoObjects/SOGo/NSScanner+BSJSONAdditions.m @@ -48,7 +48,7 @@ NSString *jsonNullString = @"null"; @implementation NSScanner (PrivateBSJSONAdditions) -- (BOOL)scanJSONObject:(NSDictionary **)dictionary +- (BOOL)scanJSONObject:(NSMutableDictionary **)dictionary { //[self setCharactersToBeSkipped:nil];