git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14965 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-11-10 06:19:17 +00:00
parent ba119e2404
commit a88b0eb08c
3 changed files with 52 additions and 37 deletions

View file

@ -370,7 +370,8 @@ GSEQ_STRCOMP(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
#endif #endif
#if GSEQ_S == GSEQ_NS #if GSEQ_S == GSEQ_NS
sgImp = (void (*)())[(id)s methodForSelector: gcrSel]; sgImp = (void (*)(NSString*,SEL,unichar*,NSRange))
[(id)s methodForSelector: gcrSel];
GSEQ_SGETR(sBuf, aRange); GSEQ_SGETR(sBuf, aRange);
#else #else
#if GSEQ_S == GSEQ_CS #if GSEQ_S == GSEQ_CS
@ -380,7 +381,8 @@ GSEQ_STRCOMP(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
#endif #endif
#endif #endif
#if GSEQ_O == GSEQ_NS #if GSEQ_O == GSEQ_NS
ogImp = (void (*)())[(id)o methodForSelector: gcrSel]; ogImp = (void (*)(NSString*,SEL,unichar*,NSRange))
[(id)o methodForSelector: gcrSel];
GSEQ_OGETR(oBuf, NSMakeRange(0, oLen)); GSEQ_OGETR(oBuf, NSMakeRange(0, oLen));
#else #else
#if GSEQ_O == GSEQ_CS #if GSEQ_O == GSEQ_CS
@ -559,18 +561,24 @@ GSEQ_STRRANGE(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
* Cache method implementations for getting characters and ranges * Cache method implementations for getting characters and ranges
*/ */
#if GSEQ_S == GSEQ_NS #if GSEQ_S == GSEQ_NS
scImp = (unichar (*)())[(id)s methodForSelector: caiSel]; scImp = (unichar (*)(NSString*,SEL,unsigned))
sgImp = (void (*)())[(id)s methodForSelector: gcrSel]; [(id)s methodForSelector: caiSel];
sgImp = (void (*)(NSString*,SEL,unichar*,NSRange))
[(id)s methodForSelector: gcrSel];
#endif #endif
#if GSEQ_O == GSEQ_NS #if GSEQ_O == GSEQ_NS
ocImp = (unichar (*)())[(id)o methodForSelector: caiSel]; ocImp = (unichar (*)(NSString*,SEL,unsigned))
ogImp = (void (*)())[(id)o methodForSelector: gcrSel]; [(id)o methodForSelector: caiSel];
ogImp = (void (*)(NSString*,SEL,unichar*,NSRange))
[(id)o methodForSelector: gcrSel];
#endif #endif
#if GSEQ_S == GSEQ_NS || GSEQ_S == GSEQ_US #if GSEQ_S == GSEQ_NS || GSEQ_S == GSEQ_US
srImp = (NSRange (*)())[(id)s methodForSelector: ranSel]; srImp = (NSRange (*)(NSString*,SEL,unsigned))
[(id)s methodForSelector: ranSel];
#endif #endif
#if GSEQ_O == GSEQ_NS || GSEQ_O == GSEQ_US #if GSEQ_O == GSEQ_NS || GSEQ_O == GSEQ_US
orImp = (NSRange (*)())[(id)o methodForSelector: ranSel]; orImp = (NSRange (*)(NSString*,SEL,unsigned))
[(id)o methodForSelector: ranSel];
#endif #endif
switch (mask) switch (mask)

View file

@ -122,7 +122,7 @@ static SEL cMemberSel = 0;
static unsigned const char *hexdigitsBitmapRep = NULL; static unsigned const char *hexdigitsBitmapRep = NULL;
#define GS_IS_HEXDIGIT(X) IS_BIT_SET(hexdigitsBitmapRep[(X)/8], (X) % 8) #define GS_IS_HEXDIGIT(X) IS_BIT_SET(hexdigitsBitmapRep[(X)/8], (X) % 8)
static void setupHexdigits() static void setupHexdigits(void)
{ {
if (hexdigitsBitmapRep == NULL) if (hexdigitsBitmapRep == NULL)
{ {
@ -141,7 +141,7 @@ static NSCharacterSet *oldQuotables = nil;
static unsigned const char *quotablesBitmapRep = NULL; static unsigned const char *quotablesBitmapRep = NULL;
#define GS_IS_QUOTABLE(X) IS_BIT_SET(quotablesBitmapRep[(X)/8], (X) % 8) #define GS_IS_QUOTABLE(X) IS_BIT_SET(quotablesBitmapRep[(X)/8], (X) % 8)
static void setupQuotables() static void setupQuotables(void)
{ {
if (quotablesBitmapRep == NULL) if (quotablesBitmapRep == NULL)
{ {
@ -170,7 +170,7 @@ static void setupQuotables()
static unsigned const char *whitespaceBitmapRep = NULL; static unsigned const char *whitespaceBitmapRep = NULL;
#define GS_IS_WHITESPACE(X) IS_BIT_SET(whitespaceBitmapRep[(X)/8], (X) % 8) #define GS_IS_WHITESPACE(X) IS_BIT_SET(whitespaceBitmapRep[(X)/8], (X) % 8)
static void setupWhitespace() static void setupWhitespace(void)
{ {
if (whitespaceBitmapRep == NULL) if (whitespaceBitmapRep == NULL)
{ {
@ -214,7 +214,7 @@ static NSCharacterSet *myPathSeps = nil;
* method 'cos that would cause recursion. * method 'cos that would cause recursion.
*/ */
static NSCharacterSet* static NSCharacterSet*
pathSeps() pathSeps(void)
{ {
if (myPathSeps == nil) if (myPathSeps == nil)
{ {
@ -1436,7 +1436,8 @@ handle_printf_atsign (FILE *stream,
GS_RANGE_CHECK(aRange, l); GS_RANGE_CHECK(aRange, l);
caiImp = (unichar (*)())[self methodForSelector: caiSel]; caiImp = (unichar (*)(NSString*,SEL,unsigned))
[self methodForSelector: caiSel];
for (i = 0; i < aRange.length; i++) for (i = 0; i < aRange.length; i++)
{ {
@ -1585,7 +1586,8 @@ handle_printf_atsign (FILE *stream,
range.location = NSNotFound; range.location = NSNotFound;
range.length = 0; range.length = 0;
cImp = (unichar(*)(id,SEL,unsigned int)) [self methodForSelector: caiSel]; cImp = (unichar(*)(id,SEL,unsigned int))
[self methodForSelector: caiSel];
mImp = (BOOL(*)(id,SEL,unichar)) mImp = (BOOL(*)(id,SEL,unichar))
[aSet methodForSelector: cMemberSel]; [aSet methodForSelector: cMemberSel];
@ -1690,7 +1692,8 @@ handle_printf_atsign (FILE *stream,
if (anIndex >= length) if (anIndex >= length)
[NSException raise: NSRangeException format:@"Invalid location."]; [NSException raise: NSRangeException format:@"Invalid location."];
caiImp = (unichar (*)())[self methodForSelector: caiSel]; caiImp = (unichar (*)(NSString*,SEL,unsigned))
[self methodForSelector: caiSel];
for (start = anIndex; start > 0; start--) for (start = anIndex; start > 0; start--)
{ {
@ -1890,8 +1893,10 @@ handle_printf_atsign (FILE *stream,
if (!oLength) if (!oLength)
return aString; return aString;
scImp = (unichar (*)())[self methodForSelector: caiSel]; scImp = (unichar (*)(NSString*,SEL,unsigned))
ocImp = (unichar (*)())[aString methodForSelector: caiSel]; [self methodForSelector: caiSel];
ocImp = (unichar (*)(NSString*,SEL,unsigned))
[aString methodForSelector: caiSel];
while ((sIndex < sLength) && (oIndex < oLength)) while ((sIndex < sLength) && (oIndex < oLength))
{ {

View file

@ -1092,6 +1092,15 @@ static BOOL isPlistObject(id o)
*/ */
- (void) setObject: (id)value forKey: (NSString*)defaultName - (void) setObject: (id)value forKey: (NSString*)defaultName
{ {
NSMutableDictionary *dict;
id obj;
if ([defaultName isKindOfClass: [NSString class]] == NO
|| [defaultName length] == 0)
{
[NSException raise: NSInvalidArgumentException
format: @"attempt to set object with bad key (%@)", defaultName];
}
if (value == nil) if (value == nil)
{ {
[NSException raise: NSInvalidArgumentException [NSException raise: NSInvalidArgumentException
@ -1104,28 +1113,21 @@ static BOOL isPlistObject(id o)
defaultName]; defaultName];
} }
if (defaultName != nil && ([defaultName length] > 0)) [_lock lock];
obj = [_persDomains objectForKey: processName];
if ([obj isKindOfClass: NSMutableDictionaryClass] == YES)
{ {
NSMutableDictionary *dict; dict = obj;
id obj;
[_lock lock];
obj = [_persDomains objectForKey: processName];
if ([obj isKindOfClass: NSMutableDictionaryClass] == YES)
{
dict = obj;
}
else
{
dict = [obj mutableCopy];
[_persDomains setObject: dict forKey: processName];
RELEASE(dict);
}
[dict setObject: value forKey: defaultName];
[self __changePersistentDomain: processName];
[_lock unlock];
} }
return; else
{
dict = [obj mutableCopy];
[_persDomains setObject: dict forKey: processName];
RELEASE(dict);
}
[dict setObject: value forKey: defaultName];
[self __changePersistentDomain: processName];
[_lock unlock];
} }
/** /**