String usage updates.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9459 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Jonathan Gapen 2001-03-19 23:53:23 +00:00
parent 6852355af1
commit cb8b09362f
7 changed files with 31 additions and 28 deletions

View file

@ -1,3 +1,12 @@
2001-03-19 Jonathan Gapen <jagapen@home.com>
* Source/NSAutoreleasePool.m, Source/NSCharacterSet.m,
Source/NSHashTable.m, Source/NSMapTable.m, Source/NSZone.m:
Update from %s/([-cString]) to %@ for format strings.
* Source/NSDecimal.m: In GSDecimalFromString(), use ([-lossyCString])
instead of ([-cString]) which should (in the future) always return
ASCII-range decimal digits in place of digits from other languages.
2001-03-19 Nicola Pero <nicola@brainstorm.co.uk>
* Source/NSThread.m: registerCurrentThread and

View file

@ -238,8 +238,8 @@ static IMP initImp;
NSAutoreleasePool *arp = [NSAutoreleasePool new];
if (anObj)
NSLog(@"autorelease called without pool for object (%x) of class %s\n",
anObj, [NSStringFromClass([anObj class]) cString]);
NSLog(@"autorelease called without pool for object (%x) of class %@\n",
anObj, NSStringFromClass([anObj class]));
else
NSLog(@"autorelease called without pool for nil object.\n");
[arp release];

View file

@ -124,8 +124,7 @@ static NSLock* cache_lock = nil;
set = [self characterSetWithBitmapRepresentation:
[NSData dataWithContentsOfFile: user_path]];
NS_HANDLER
NSLog(@"Unable to read NSCharacterSet file %s",
[user_path cString]);
NSLog(@"Unable to read NSCharacterSet file %@", user_path);
set = nil;
NS_ENDHANDLER
}
@ -138,8 +137,7 @@ static NSLock* cache_lock = nil;
set = [self characterSetWithBitmapRepresentation:
[NSData dataWithContentsOfFile: local_path]];
NS_HANDLER
NSLog(@"Unable to read NSCharacterSet file %s",
[local_path cString]);
NSLog(@"Unable to read NSCharacterSet file %@", local_path);
set = nil;
NS_ENDHANDLER
}
@ -152,8 +150,7 @@ static NSLock* cache_lock = nil;
set = [self characterSetWithBitmapRepresentation:
[NSData dataWithContentsOfFile: system_path]];
NS_HANDLER
NSLog(@"Unable to read NSCharacterSet file %s",
[system_path cString]);
NSLog(@"Unable to read NSCharacterSet file %@", system_path);
set = nil;
NS_ENDHANDLER
}
@ -162,8 +159,7 @@ static NSLock* cache_lock = nil;
if (!set)
{
[NSException raise: NSGenericException
format: @"Could not find bitmap file %s",
[setname cString]];
format: @"Could not find bitmap file %@", setname];
/* NOT REACHED */
}
else

View file

@ -968,7 +968,7 @@ GSDecimalFromString(GSDecimal *result, NSString *numberValue,
found = [numberValue rangeOfString: sep];
if (found.length)
{
s = [[numberValue substringToIndex: found.location] cString];
s = [[numberValue substringToIndex: found.location] lossyCString];
if ('-' == *s)
{
result->isNegative = YES;
@ -982,7 +982,7 @@ GSDecimalFromString(GSDecimal *result, NSString *numberValue,
result->length++;
s++;
}
s = [[numberValue substringFromIndex: NSMaxRange(found)] cString];
s = [[numberValue substringFromIndex: NSMaxRange(found)] lossyCString];
while ((*s) && (isdigit(*s)))
{
result->cMantissa[i++] = *s - '0';
@ -993,7 +993,7 @@ GSDecimalFromString(GSDecimal *result, NSString *numberValue,
}
else
{
s = [numberValue cString];
s = [numberValue lossyCString];
if ('-' == *s)
{
result->isNegative = YES;

View file

@ -303,8 +303,8 @@ NSHashInsertKnownAbsent(NSHashTable *table, const void *element)
* information. Not difficult to do, just something for a later
* date. */
[NSException raise:NSInvalidArgumentException
format:@"NSHashTable: illegal reinsertion of: %s",
[NSHT_DESCRIBE(table, element) cString]];
format:@"NSHashTable: illegal reinsertion of: %@",
NSHT_DESCRIBE(table, element)];
}
else
{
@ -357,8 +357,7 @@ NSStringFromHashTable(NSHashTable *table)
/* Iterate over the elements of TABLE, appending the description of
* each to the mutable string STRING. */
while ((pointer = NSNextHashEnumeratorItem(&enumerator)) != 0)
[string appendFormat:@"%s;\n",
[NSHT_DESCRIBE(table, pointer) cString]];
[string appendFormat:@"%@;\n", NSHT_DESCRIBE(table, pointer)];
/* STRING is already autoreleased. */
return (NSString *) string;

View file

@ -397,9 +397,9 @@ NSMapInsertKnownAbsent(NSMapTable *table, const void *key, const void *value)
* information. Not difficult to do, just something for a later
* date. */
[NSException raise:NSInvalidArgumentException
format:@"NSMapTable: illegal reinsertion of: %s -> %s",
[NSMT_DESCRIBE_KEY(table, key) cString],
[NSMT_DESCRIBE_VALUE(table, value) cString]];
format:@"NSMapTable: illegal reinsertion of: %@ -> %@",
NSMT_DESCRIBE_KEY(table, key),
NSMT_DESCRIBE_VALUE(table, value)];
}
else
{
@ -445,8 +445,8 @@ NSStringFromMapTable(NSMapTable *table)
* descriptions to the string. */
while (NSNextMapEnumeratorPair(&enumerator, &key, &value))
[string appendFormat:@"%@ = %@;",
[(keyCallBacks.describe)(table, key) cString],
[(valueCallBacks.describe)(table, value) cString]];
(keyCallBacks.describe)(table, key),
(valueCallBacks.describe)(table, value)];
/* Note that this string'll need to be `retain'ed. */
return string;

View file

@ -590,8 +590,7 @@ fmalloc (NSZone *zone, size_t size)
objc_mutex_unlock(zptr->lock);
if (zone->name != nil)
[NSException raise: NSMallocException
format: @"Zone %s has run out of memory",
[zone->name cString]];
format: @"Zone %@ has run out of memory", zone->name];
else
[NSException raise: NSMallocException
format: @"Out of memory"];
@ -690,8 +689,8 @@ frealloc (NSZone *zone, void *ptr, size_t size)
objc_mutex_unlock(zptr->lock);
if (zone->name != nil)
[NSException raise: NSMallocException
format: @"Zone %s has run out of memory",
[zone->name cString]];
format: @"Zone %@ has run out of memory",
zone->name];
else
[NSException raise: NSMallocException
format: @"Out of memory"];
@ -1336,8 +1335,8 @@ nmalloc (NSZone *zone, size_t size)
objc_mutex_unlock(zptr->lock);
if (zone->name != nil)
[NSException raise: NSMallocException
format: @"Zone %s has run out of memory",
[zone->name cString]];
format: @"Zone %@ has run out of memory",
zone->name];
else
[NSException raise: NSMallocException
format: @"Out of memory"];