mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14965 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ee3fe896e9
commit
22bed19361
3 changed files with 52 additions and 37 deletions
|
@ -370,7 +370,8 @@ GSEQ_STRCOMP(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
|
|||
#endif
|
||||
|
||||
#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);
|
||||
#else
|
||||
#if GSEQ_S == GSEQ_CS
|
||||
|
@ -380,7 +381,8 @@ GSEQ_STRCOMP(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
|
|||
#endif
|
||||
#endif
|
||||
#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));
|
||||
#else
|
||||
#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
|
||||
*/
|
||||
#if GSEQ_S == GSEQ_NS
|
||||
scImp = (unichar (*)())[(id)s methodForSelector: caiSel];
|
||||
sgImp = (void (*)())[(id)s methodForSelector: gcrSel];
|
||||
scImp = (unichar (*)(NSString*,SEL,unsigned))
|
||||
[(id)s methodForSelector: caiSel];
|
||||
sgImp = (void (*)(NSString*,SEL,unichar*,NSRange))
|
||||
[(id)s methodForSelector: gcrSel];
|
||||
#endif
|
||||
#if GSEQ_O == GSEQ_NS
|
||||
ocImp = (unichar (*)())[(id)o methodForSelector: caiSel];
|
||||
ogImp = (void (*)())[(id)o methodForSelector: gcrSel];
|
||||
ocImp = (unichar (*)(NSString*,SEL,unsigned))
|
||||
[(id)o methodForSelector: caiSel];
|
||||
ogImp = (void (*)(NSString*,SEL,unichar*,NSRange))
|
||||
[(id)o methodForSelector: gcrSel];
|
||||
#endif
|
||||
#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
|
||||
#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
|
||||
|
||||
switch (mask)
|
||||
|
|
|
@ -122,7 +122,7 @@ static SEL cMemberSel = 0;
|
|||
static unsigned const char *hexdigitsBitmapRep = NULL;
|
||||
#define GS_IS_HEXDIGIT(X) IS_BIT_SET(hexdigitsBitmapRep[(X)/8], (X) % 8)
|
||||
|
||||
static void setupHexdigits()
|
||||
static void setupHexdigits(void)
|
||||
{
|
||||
if (hexdigitsBitmapRep == NULL)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ static NSCharacterSet *oldQuotables = nil;
|
|||
static unsigned const char *quotablesBitmapRep = NULL;
|
||||
#define GS_IS_QUOTABLE(X) IS_BIT_SET(quotablesBitmapRep[(X)/8], (X) % 8)
|
||||
|
||||
static void setupQuotables()
|
||||
static void setupQuotables(void)
|
||||
{
|
||||
if (quotablesBitmapRep == NULL)
|
||||
{
|
||||
|
@ -170,7 +170,7 @@ static void setupQuotables()
|
|||
static unsigned const char *whitespaceBitmapRep = NULL;
|
||||
#define GS_IS_WHITESPACE(X) IS_BIT_SET(whitespaceBitmapRep[(X)/8], (X) % 8)
|
||||
|
||||
static void setupWhitespace()
|
||||
static void setupWhitespace(void)
|
||||
{
|
||||
if (whitespaceBitmapRep == NULL)
|
||||
{
|
||||
|
@ -214,7 +214,7 @@ static NSCharacterSet *myPathSeps = nil;
|
|||
* method 'cos that would cause recursion.
|
||||
*/
|
||||
static NSCharacterSet*
|
||||
pathSeps()
|
||||
pathSeps(void)
|
||||
{
|
||||
if (myPathSeps == nil)
|
||||
{
|
||||
|
@ -1436,7 +1436,8 @@ handle_printf_atsign (FILE *stream,
|
|||
|
||||
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++)
|
||||
{
|
||||
|
@ -1585,7 +1586,8 @@ handle_printf_atsign (FILE *stream,
|
|||
range.location = NSNotFound;
|
||||
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))
|
||||
[aSet methodForSelector: cMemberSel];
|
||||
|
||||
|
@ -1690,7 +1692,8 @@ handle_printf_atsign (FILE *stream,
|
|||
|
||||
if (anIndex >= length)
|
||||
[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--)
|
||||
{
|
||||
|
@ -1890,8 +1893,10 @@ handle_printf_atsign (FILE *stream,
|
|||
if (!oLength)
|
||||
return aString;
|
||||
|
||||
scImp = (unichar (*)())[self methodForSelector: caiSel];
|
||||
ocImp = (unichar (*)())[aString methodForSelector: caiSel];
|
||||
scImp = (unichar (*)(NSString*,SEL,unsigned))
|
||||
[self methodForSelector: caiSel];
|
||||
ocImp = (unichar (*)(NSString*,SEL,unsigned))
|
||||
[aString methodForSelector: caiSel];
|
||||
|
||||
while ((sIndex < sLength) && (oIndex < oLength))
|
||||
{
|
||||
|
|
|
@ -1092,6 +1092,15 @@ static BOOL isPlistObject(id o)
|
|||
*/
|
||||
- (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)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
|
@ -1104,28 +1113,21 @@ static BOOL isPlistObject(id o)
|
|||
defaultName];
|
||||
}
|
||||
|
||||
if (defaultName != nil && ([defaultName length] > 0))
|
||||
[_lock lock];
|
||||
obj = [_persDomains objectForKey: processName];
|
||||
if ([obj isKindOfClass: NSMutableDictionaryClass] == YES)
|
||||
{
|
||||
NSMutableDictionary *dict;
|
||||
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];
|
||||
dict = obj;
|
||||
}
|
||||
return;
|
||||
else
|
||||
{
|
||||
dict = [obj mutableCopy];
|
||||
[_persDomains setObject: dict forKey: processName];
|
||||
RELEASE(dict);
|
||||
}
|
||||
[dict setObject: value forKey: defaultName];
|
||||
[self __changePersistentDomain: processName];
|
||||
[_lock unlock];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue