From 94a96ae8899f01ffe6dba3d520883132010d6bc1 Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Mon, 22 Nov 2004 11:48:50 +0000 Subject: [PATCH] Minor twekas to fix three bug reports. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20368 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 11 +++++++++++ Headers/Foundation/NSNotification.h | 13 ++----------- Source/NSMessagePort.m | 2 ++ Source/NSNotificationCenter.m | 24 ------------------------ Source/NSPropertyList.m | 5 ++--- 5 files changed, 17 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4292a7307..c369d1869 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-11-22 Richard Frith-Macdonald + + * Source/NSPropertyList.m: Initialise harmless uninitialised variable + to avoid compiler warning in + ([propertyListFromData:mutabilityOption:format:errorDescription:]) + fixing bug report #11093 + * Source/NSMessagePort.m: ifndef toi fix harmless compiler warning + reported as bug #11092 + * NSNotificationCenter.[hm]: Remove non-functional setImmutableInPost + method to fix bug report #11080 + 2004-11-20 Richard Frith-Macdonald * Source/NSBundle.m: Fix to ensure that a main bundle exists. diff --git a/Headers/Foundation/NSNotification.h b/Headers/Foundation/NSNotification.h index 6bfee5d00..9124f8b60 100644 --- a/Headers/Foundation/NSNotification.h +++ b/Headers/Foundation/NSNotification.h @@ -86,21 +86,12 @@ #ifndef NO_GNUSTEP /** - * Defines some extensions for maximising posting performance - these options - * are NOT adjustable for the default notification center. - * + * Defines an extension for maximising posting performance - this option + * is NOT adjustable for the default notification center. */ @interface NSNotificationCenter (GNUstep) /** - * You can turn on 'immutability' if you KNOW that the posting of a - * notification will never result in an attempt to modify the center. - * In this case, the center can optimise delivery of notifications. - */ -- (BOOL) setImmutableInPost: (BOOL)flag; - -/** - * * You can disable locking in a multi-threaded program if you KNOW that only * one thread will ever use the notification center. */ diff --git a/Source/NSMessagePort.m b/Source/NSMessagePort.m index a0841c8a6..372ba9ec6 100644 --- a/Source/NSMessagePort.m +++ b/Source/NSMessagePort.m @@ -1459,7 +1459,9 @@ static int unique_index = 0; { NSMapEnumerator me; int sock; +#ifndef BROKEN_SO_REUSEADDR int opt = 1; +#endif GSMessageHandle *handle = nil; M_LOCK(myLock); diff --git a/Source/NSNotificationCenter.m b/Source/NSNotificationCenter.m index 061bc935c..e2091098c 100644 --- a/Source/NSNotificationCenter.m +++ b/Source/NSNotificationCenter.m @@ -1137,30 +1137,6 @@ static NSNotificationCenter *default_center = nil; @implementation NSNotificationCenter (GNUstep) -- (BOOL) setImmutableInPost: (BOOL)flag -{ - BOOL old; - - lockNCTable(TABLE); - - if (self == default_center) - { - unlockNCTable(TABLE); - [NSException raise: NSInvalidArgumentException - format: @"Can't change behavior of default center."]; - } - if (LOCKCOUNT > 1) - { - unlockNCTable(TABLE); - [NSException raise: NSInvalidArgumentException - format: @"Can't change behavior during post."]; - } - - unlockNCTable(TABLE); - - return old; -} - - (BOOL) setLockingDisabled: (BOOL)flag { BOOL old; diff --git a/Source/NSPropertyList.m b/Source/NSPropertyList.m index 3aba748ea..7cb6b5004 100644 --- a/Source/NSPropertyList.m +++ b/Source/NSPropertyList.m @@ -2179,7 +2179,7 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml, format: (NSPropertyListFormat*)aFormat errorDescription: (NSString**)anErrorString { - NSPropertyListFormat format; + NSPropertyListFormat format = 0; NSString *error = nil; id result = nil; const unsigned char *bytes = 0; @@ -2222,10 +2222,9 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml, if (length - index > 2 && bytes[index] == '<' && bytes[index+1] == '?') { -#ifdef HAVE_LIBXML // It begins with '