mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Correct the creation of the hash table used for absolute time zones.
This commit is contained in:
parent
67eeb932d1
commit
eeff6e08a7
1 changed files with 7 additions and 15 deletions
|
@ -225,6 +225,7 @@ static NSString *tzdir = nil;
|
|||
static GSPlaceholderTimeZone *defaultPlaceholderTimeZone;
|
||||
static NSMapTable *placeholderMap;
|
||||
static GSAbsTimeZone *commonAbsolutes[145] = { 0 };
|
||||
static NSMapTable *absolutes = 0;
|
||||
|
||||
/*
|
||||
* Temporary structure for holding time zone details.
|
||||
|
@ -638,19 +639,6 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
|
|||
@implementation GSAbsTimeZone
|
||||
|
||||
static int uninitialisedOffset = 100000;
|
||||
static NSMapTable *absolutes = 0;
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
static BOOL beenHere = NO;
|
||||
|
||||
if (NO == beenHere && self == [GSAbsTimeZone class])
|
||||
{
|
||||
beenHere = YES;
|
||||
absolutes = NSCreateMapTable(NSIntegerMapKeyCallBacks,
|
||||
NSNonOwnedPointerMapValueCallBacks, 0);
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*) abbreviationForDate: (NSDate*)aDate
|
||||
{
|
||||
|
@ -1353,14 +1341,18 @@ static NSMapTable *absolutes = 0;
|
|||
GSPlaceholderTimeZoneClass = [GSPlaceholderTimeZone class];
|
||||
zoneDictionary = [[NSMutableDictionary alloc] init];
|
||||
|
||||
/*
|
||||
* Set up infrastructure for placeholder timezones.
|
||||
/* Set up infrastructure for placeholder timezones.
|
||||
*/
|
||||
defaultPlaceholderTimeZone = (GSPlaceholderTimeZone*)
|
||||
NSAllocateObject(GSPlaceholderTimeZoneClass, 0, NSDefaultMallocZone());
|
||||
placeholderMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||
NSNonRetainedObjectMapValueCallBacks, 0);
|
||||
|
||||
/* Hash table lookup for absolute time zones.
|
||||
*/
|
||||
absolutes = NSCreateMapTable(NSIntegerMapKeyCallBacks,
|
||||
NSNonOwnedPointerMapValueCallBacks, 0);
|
||||
|
||||
localTimeZone = [[NSLocalTimeZone alloc] init];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver: self
|
||||
|
|
Loading…
Reference in a new issue