Rename 'abstract' to 'abstractClass' and make it static. (+allocWithZone:): Allocate an instance of self if self isn't the abstract class.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18265 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-12-23 23:19:00 +00:00
parent 0a69397299
commit fffc7ab3c0
2 changed files with 17 additions and 13 deletions

View file

@ -1,3 +1,10 @@
2003-12-23 23:33 Alexander Malmberg <alexander@malmberg.org>
* Source/NSCharacterSet.m: Rename 'abstract' to 'abstractClass' and
make it static.
(+allocWithZone:): Allocate an instance of self if self isn't the
abstract class.
2003-12-23 18:38 Alexander Malmberg <alexander@malmberg.org>
* Source/NSThread.m: Don't use '\r\n' in printf strings (stdio/libc

View file

@ -36,13 +36,13 @@
#include "Foundation/NSThread.h"
#include "Foundation/NSNotification.h"
static NSString* NSCharacterSet_PATH = @"NSCharacterSets";
static NSString *NSCharacterSet_PATH = @"NSCharacterSets";
/* A simple array for caching standard bitmap sets */
#define MAX_STANDARD_SETS 15
static NSCharacterSet* cache_set[MAX_STANDARD_SETS];
static NSLock* cache_lock = nil;
Class abstract = nil;
static NSCharacterSet *cache_set[MAX_STANDARD_SETS];
static NSLock *cache_lock = nil;
static Class abstractClass = nil;
@implementation NSCharacterSet
@ -64,13 +64,7 @@ Class abstract = nil;
if (one_time == NO)
{
unsigned i;
abstract = [NSCharacterSet class];
for (i = 0; i < MAX_STANDARD_SETS; i++)
{
cache_set[i] = 0;
}
abstractClass = [NSCharacterSet class];
one_time = YES;
}
if ([NSThread isMultiThreaded])
@ -90,7 +84,10 @@ Class abstract = nil;
/* Provide a default object for allocation */
+ (id) allocWithZone: (NSZone*)zone
{
return NSAllocateObject([NSBitmapCharSet self], 0, zone);
if (self == abstractClass)
return NSAllocateObject([NSBitmapCharSet self], 0, zone);
else
return NSAllocateObject(self, 0, zone);
}
// Creating standard character sets
@ -152,7 +149,7 @@ Class abstract = nil;
[cache_lock unlock];
if (self != abstract && self != [set class])
if (self != abstractClass && self != [set class])
{
NSData *data;