Merged bugfix for negative numbers in property lists from trunk

Minor corrections/updates to previous commit


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/mswin-ng@23943 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sheldon Gill 2006-10-22 09:32:21 +00:00
parent 00f6762e2d
commit ff7a13e2bc
22 changed files with 300 additions and 289 deletions

159
ChangeLog
View file

@ -1,84 +1,93 @@
2006-10-22 Sheldon Gill <sheldon@westnet.net.au>
* Source/NSPropertyList.m:
Fix bug encoding negative numbers in property lists (by rfm)
* Source/NSDecimalNumber.m:
Added serialisation support (bug #17955) (by rfm)
Corrections to previous commit
2006-10-21 Sheldon Gill <sheldon@westnet.net.au>
* Headers/GNUstepBase/GSVersionMacros.h:
* Headers/GNUstepBase/GNUstep.h:
Merge RFM's version macro changes from trunk/HEAD
* Source\NSIndexPath.m
* Source\NSSocketPortNameServer.m
* Source\NSTimeZone.m
* Source\NSHashTable.m
* Source\NSBundle.m
* Source\NSTimer.m
* Source\libgnustep-base-entry.m
* Source\GSConcreteValueTemplate.m
* Source\GNUmakefile
* Source\NSGeometry.m
* Source\NSUndoManager.m
* Source\NSMethodSignature.m
* Source\NSFormatter.m
* Source\NSArray.m
* Source\NSMessagePortNameServer.m
* Source\GSStream.m
* Source\objc-gnu2next.m
* Source\NSDebug.m
* Source\GSConcreteValue.m
* Source\NSFileHandle.m
* Source\preface.m
* Source\NSAssertionHandler.m
* Source\NSConcreteNumberTemplate.m
* Source\NSCallBacks.h
* Source\NSZone.m
* Source\NSCallBacks.m
* Source\NSPort.m
* Source\NSMessagePort.m
* Source\GSDictionary.m
* Source\win32\GSFileHandleWin32.m
* Source\GSCountedSet.m
* Source\NSFileManager.m
* Source\NSConcreteNumber.m
* Source\NSNotificationCenter.m
* Source\NSRange.m
* Source\NSCoder.m
* Source\NSException.m
* Source\NSCopyObject.m
* Source\mframe.m
* Source\NSDecimalNumber.m
* Source\Additions\Unicode.m
* Source\Additions\GNUmakefile
* Source\Additions\GSCompatibility.m
* Source\GSSet.m
* Source\NSNotification.m
* Source\NSAutoreleasePool.m
* Source\NSHost.m
* Source\NSProxy.m
* Source\NSObjCRuntime.m
* Source\NSProtocolChecker.m
* Source\GSValue.m
* Source\NSSerializer.m
* Source\NSClassDescription.m
* Source\NSNull.m
* Source\NSValue.m
* Source\NSCountedSet.m
* Source\NSLog.m
* Source\NSIndexSet.m
* Source\NSLock.m
* Source\NSDistantObject.m
* Source\NSArchiver.m
* Source\NSPortNameServer.m
* Source\NSNumberFormatter.m
* Source\NSXMLParser.m
* Source\NSEnumerator.m
* Source\GSURLPrivate.h
* Headers\Foundation\NSCoder.h
* Headers\Foundation\NSObject.h
* Headers\Foundation\NSError.h
* Headers\Additions\GNUstepBase\GSObjCRuntime.h
* Headers\Additions\GNUstepBase\GSCategories.h
* Headers\Additions\GNUstepBase\GNUstep.h
* Headers\Additions\GNUstepBase\Unicode.h
* Testing\call.m
* Testing\benchmark.m
* Source/NSIndexPath.m:
* Source/NSSocketPortNameServer.m:
* Source/NSTimeZone.m:
* Source/NSHashTable.m:
* Source/NSBundle.m:
* Source/NSTimer.m:
* Source/libgnustep-base-entry.m:
* Source/GSConcreteValueTemplate.m:
* Source/GNUmakefile:
* Source/NSGeometry.m:
* Source/NSUndoManager.m:
* Source/NSMethodSignature.m:
* Source/NSFormatter.m:
* Source/NSArray.m:
* Source/NSMessagePortNameServer.m:
* Source/GSStream.m:
* Source/objc-gnu2next.m:
* Source/NSDebug.m:
* Source/GSConcreteValue.m:
* Source/NSFileHandle.m:
* Source/preface.m:
* Source/NSAssertionHandler.m:
* Source/NSConcreteNumberTemplate.m:
* Source/NSCallBacks.h:
* Source/NSZone.m:
* Source/NSCallBacks.m:
* Source/NSPort.m:
* Source/NSMessagePort.m:
* Source/GSDictionary.m:
* Source/win32/GSFileHandleWin32.m:
* Source/GSCountedSet.m:
* Source/NSFileManager.m:
* Source/NSConcreteNumber.m:
* Source/NSNotificationCenter.m:
* Source/NSRange.m:
* Source/NSCoder.m:
* Source/NSException.m:
* Source/NSCopyObject.m:
* Source/mframe.m:
* Source/NSDecimalNumber.m:
* Source/Additions/Unicode.m:
* Source/Additions/GNUmakefile:
* Source/Additions/GSCompatibility.m:
* Source/GSSet.m:
* Source/NSNotification.m:
* Source/NSAutoreleasePool.m:
* Source/NSHost.m:
* Source/NSProxy.m:
* Source/NSObjCRuntime.m:
* Source/NSProtocolChecker.m:
* Source/GSValue.m:
* Source/NSSerializer.m:
* Source/NSClassDescription.m:
* Source/NSNull.m:
* Source/NSValue.m:
* Source/NSCountedSet.m:
* Source/NSLog.m:
* Source/NSIndexSet.m:
* Source/NSLock.m:
* Source/NSDistantObject.m:
* Source/NSArchiver.m:
* Source/NSPortNameServer.m:
* Source/NSNumberFormatter.m:
* Source/NSXMLParser.m:
* Source/NSEnumerator.m:
* Source/GSURLPrivate.h:
* Headers/Foundation/NSCoder.h:
* Headers/Foundation/NSObject.h:
* Headers/Foundation/NSError.h:
* Headers/Additions/GNUstepBase/GSObjCRuntime.h:
* Headers/Additions/GNUstepBase/GSCategories.h:
* Headers/Additions/GNUstepBase/GNUstep.h:
* Headers/Additions/GNUstepBase/Unicode.h:
* Testing/call.m:
* Testing/benchmark.m:
Correct layout of FSF headquarters location
* Headers/GNUstepBase/GSObjCRuntime.h:

View file

@ -20,7 +20,7 @@
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
*/
#ifndef __GNUSTEP_GNUSTEP_H_INCLUDED_
#define __GNUSTEP_GNUSTEP_H_INCLUDED_
@ -75,10 +75,10 @@ NSAutoreleasePool *(X) = [NSAutoreleasePool new]
#define NSLocalizedStaticString(X, Y) X
#endif /* defined GNUSTEP */
#ifdef GNUSTEP_WITH_DLL
#if BUILD_libgnustep_base_DLL
#
# if defined(__MINGW32__)
@ -86,7 +86,7 @@ NSAutoreleasePool *(X) = [NSAutoreleasePool new]
* __declspec(dllexport) is not needed.
*/
# define GS_EXPORT extern
# define GS_DECLARE
# define GS_DECLARE
# else
# define GS_EXPORT __declspec(dllexport)
# define GS_DECLARE __declspec(dllexport)
@ -95,16 +95,16 @@ NSAutoreleasePool *(X) = [NSAutoreleasePool new]
# define GS_EXPORT extern __declspec(dllimport)
# define GS_DECLARE __declspec(dllimport)
#endif
#else /* GNUSTEP_WITH[OUT]_DLL */
# define GS_EXPORT extern
# define GS_DECLARE
# define GS_DECLARE
#endif
/*
* GNUstep attributes
* GNUstep attributes - Private, Deprecated
*/
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
#define GS_DEPRECATED __attribute__ ((deprecated))
@ -112,14 +112,12 @@ NSAutoreleasePool *(X) = [NSAutoreleasePool new]
#define GS_DEPRECATED
#endif
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
#define GS_PRIVATE __attribute__ ((internal))
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
#define GS_PRIVATE __attribute__ ((visibility("internal")))
#else
#define GS_PRIVATE
#endif
#include <GNUstepBase/GSVersionMacros.h>
#endif /* GNUSTEP */
#endif /* __GNUSTEP_GNUSTEP_H_INCLUDED_ */

View file

@ -648,27 +648,27 @@ GS_EXPORT BOOL
GSFindInstanceVariable(id obj, const char *name,
const char **type,
unsigned int *size,
int *offset) GS_ATTRIB_DEPRECATED;
int *offset) GS_DEPRECATED;
GS_EXPORT void
GSGetVariable(id obj, int offset, unsigned int size,
void *data) GS_ATTRIB_DEPRECATED;
void *data) GS_DEPRECATED;
GS_EXPORT void
GSSetVariable(id obj, int offset, unsigned int size,
const void *data) GS_ATTRIB_DEPRECATED;
const void *data) GS_DEPRECATED;
GS_EXPORT id
GSGetValue(NSObject *self, NSString *key, SEL sel,
const char *type,
unsigned size,
int offset) GS_ATTRIB_DEPRECATED;
int offset) GS_DEPRECATED;
GS_EXPORT void
GSSetValue(NSObject *self, NSString *key, id val, SEL sel,
const char *type,
unsigned size,
int offset) GS_ATTRIB_DEPRECATED;
int offset) GS_DEPRECATED;
GS_EXPORT NSArray *
GSObjCAllSubclassesOfClass(Class cls);
@ -679,7 +679,7 @@ GSObjCDirectSubclassesOfClass(Class cls);
/** ## deprecated ##
*/
GS_STATIC_INLINE const char*
GSObjCName(Class cls) GS_ATTRIB_DEPRECATED;
GSObjCName(Class cls) GS_DEPRECATED;
GS_STATIC_INLINE const char*
GSObjCName(Class cls)
{
@ -689,7 +689,7 @@ GSObjCName(Class cls)
/** ## deprecated ##
*/
GS_STATIC_INLINE const char*
GSObjCSelectorName(SEL sel) GS_ATTRIB_DEPRECATED;
GSObjCSelectorName(SEL sel) GS_DEPRECATED;
GS_STATIC_INLINE const char*
GSObjCSelectorName(SEL sel)
{
@ -701,7 +701,7 @@ GSObjCSelectorName(SEL sel)
/** ## deprecated ##
*/
GS_STATIC_INLINE const char*
GSObjCSelectorTypes(SEL sel) GS_ATTRIB_DEPRECATED;
GSObjCSelectorTypes(SEL sel) GS_DEPRECATED;
GS_STATIC_INLINE const char*
GSObjCSelectorTypes(SEL sel)
{
@ -709,7 +709,7 @@ GSObjCSelectorTypes(SEL sel)
}
GS_STATIC_INLINE GSMethod
GSGetInstanceMethod(Class cls, SEL sel) GS_ATTRIB_DEPRECATED;
GSGetInstanceMethod(Class cls, SEL sel) GS_DEPRECATED;
GS_STATIC_INLINE GSMethod
GSGetInstanceMethod(Class cls, SEL sel)
{
@ -717,7 +717,7 @@ GSGetInstanceMethod(Class cls, SEL sel)
}
GS_STATIC_INLINE GSMethod
GSGetClassMethod(Class cls, SEL sel) GS_ATTRIB_DEPRECATED;
GSGetClassMethod(Class cls, SEL sel) GS_DEPRECATED;
GS_STATIC_INLINE GSMethod
GSGetClassMethod(Class cls, SEL sel)
{
@ -726,7 +726,7 @@ GSGetClassMethod(Class cls, SEL sel)
GS_STATIC_INLINE GSMethod
GSGetInstanceMethodNotInherited(Class cls,
SEL sel) GS_ATTRIB_DEPRECATED;
SEL sel) GS_DEPRECATED;
GS_STATIC_INLINE GSMethod
GSGetInstanceMethodNotInherited(Class cls, SEL sel)
{
@ -734,7 +734,7 @@ GSGetInstanceMethodNotInherited(Class cls, SEL sel)
}
GS_STATIC_INLINE GSMethod
GSGetClassMethodNotInherited(Class cls, SEL sel) GS_ATTRIB_DEPRECATED;
GSGetClassMethodNotInherited(Class cls, SEL sel) GS_DEPRECATED;
GS_STATIC_INLINE GSMethod
GSGetClassMethodNotInherited(Class cls, SEL sel)
{

View file

@ -23,7 +23,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
AutogsdocSource: Additions/Unicode.m
@ -32,32 +33,33 @@
#ifndef __Unicode_h_OBJECTS_INCLUDE
#define __Unicode_h_OBJECTS_INCLUDE
#include <Foundation/NSString.h> /* For string encodings */
#if OS_API_VERSION(GS_API_NONE,GS_API_NONE)
/*
* Private API used internally by NSString etc.
*/
#include "GSObjCRuntime.h"
#include <Foundation/NSString.h> /* For string encodings */
#if defined(__cplusplus)
extern "C" {
#endif
#if GS_API_VERSION(GS_API_NONE,011500)
/* Private/internal functions */
NSStringEncoding *GetAvailableEncodings(void) GS_PRIVATE;
NSStringEncoding GetDefEncoding(void) GS_PRIVATE;
/* Deprecated functions */
GS_EXPORT NSStringEncoding GSEncodingFromLocale(const char *clocale);
GS_EXPORT NSStringEncoding GSEncodingForRegistry(NSString *registry,
NSString *encoding);
GS_EXPORT unichar uni_tolower(unichar ch);
GS_EXPORT unichar uni_toupper(unichar ch);
GS_EXPORT unsigned char uni_cop(unichar u);
GS_EXPORT BOOL uni_isnonsp(unichar u);
GS_EXPORT unichar *uni_is_decomp(unichar u);
GS_EXPORT NSStringEncoding GSEncodingFromLocale(const char *clocale) GS_DEPRECATED;
GS_EXPORT NSStringEncoding GSEncodingForRegistry(NSString *registry,
NSString *encoding) GS_DEPRECATED;
GS_EXPORT unichar uni_tolower(unichar ch) GS_DEPRECATED;
GS_EXPORT unichar uni_toupper(unichar ch) GS_DEPRECATED;
GS_EXPORT unsigned char uni_cop(unichar u) GS_DEPRECATED;
GS_EXPORT BOOL uni_isnonsp(unichar u) GS_DEPRECATED;
GS_EXPORT unichar *uni_is_decomp(unichar u) GS_DEPRECATED;
#endif
/*
* Options when converting strings.
*/

View file

@ -28,6 +28,7 @@
#ifndef __behavior_h_GNUSTEP_BASE_INCLUDE
#define __behavior_h_GNUSTEP_BASE_INCLUDE
#include <GNUstepBase/GNUstep.h>
#include <GNUstepBase/GSObjCRuntime.h>
#if defined(__cplusplus)

View file

@ -29,6 +29,7 @@
#ifndef __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE
#define __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE
#include <GNUstepBase/GNUstep.h>
#include <GNUstepBase/GSObjCRuntime.h>
#if defined(__cplusplus)
@ -56,16 +57,6 @@ GS_EXPORT NSLog_printf_handler *_NSLog_printf_handler;
GS_EXPORT void NSLog (NSString *format, ...);
GS_EXPORT void NSLogv (NSString *format, va_list args);
#ifndef YES
#define YES 1
#endif
#ifndef NO
#define NO 0
#endif
#ifndef nil
#define nil 0
#endif
#if defined(__cplusplus)
}
#endif

View file

@ -47,8 +47,8 @@
#else
#include <Foundation/Foundation.h>
#endif
#include "GNUstepBase/GSObjCRuntime.h"
#include "GNUstepBase/GNUstep.h"
#include "GNUstepBase/GSObjCRuntime.h"
#include "GNUstepBase/GSCategories.h"
#include <objc/Protocol.h>

View file

@ -560,7 +560,7 @@ GSEncodingFromLocale(const char *clocale)
char *s;
s = strchr (clocale, '.');
registry = [[NSString stringWithCString: s+1] lowercaseString];
registry = [[NSString stringWithUTF8String: s+1] lowercaseString];
array = [registry componentsSeparatedByString: @"-"];
registry = [array objectAtIndex: 0];
if ([array count] > 1)

View file

@ -1736,7 +1736,7 @@ NSDictionary *locale)
{
/* Write "(null)" if there's space. */
if (prec == -1
|| prec >= (int) (sizeof (null) / sizeof (null[0])) - 1)
|| prec >= (int) (sizeof (null) / sizeof (null[0])) - 1)
{
string = (unichar *) null;
len = (sizeof (null) / sizeof (null[0])) - 1;

View file

@ -49,6 +49,7 @@
#include "config.h"
#include "GNUstepBase/preface.h"
#include "GNUstepBase/GNUstep.h"
#include "GNUstepBase/Unicode.h"
#include "Foundation/NSAttributedString.h"

View file

@ -67,7 +67,6 @@
#include "config.h"
#include "GNUstepBase/preface.h"
#include "GNUstepBase/GSObjCRuntime.h"
#include "Foundation/NSObjCRuntime.h"
#include "Foundation/NSByteOrder.h"
#include "Foundation/NSCoder.h"

View file

@ -26,9 +26,12 @@
$Date$ $Revision$
*/
#include "Foundation/NSException.h"
#include "Foundation/NSCoder.h"
#include "Foundation/NSDecimal.h"
#include "Foundation/NSDecimalNumber.h"
#include "Foundation/NSException.h"
#include "Foundation/NSPortCoder.h"
#include "GSPrivate.h"
// shared default behavior for NSDecimalNumber class
@ -663,6 +666,32 @@ static NSDecimalNumber *one;
return [[isa defaultBehavior] scale];
}
- (Class) classForCoder
{
return [NSDecimalNumber class];
}
- (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder
{
if ([aCoder isByref] == NO)
return self;
return [super replacementObjectForPortCoder: aCoder];
}
- (void) encodeWithCoder: (NSCoder*)coder
{
NSString *s = [self descriptionWithLocale: nil];
[coder encodeObject: s];
}
- (id) initWithCoder: (NSCoder*)coder
{
NSString *s = [coder decodeObject];
return [self initWithString: s locale: nil];
}
@end
@implementation NSNumber (NSDecimalNumber)

View file

@ -1,5 +1,5 @@
/** NSException - Object encapsulation of a general exception handler
Copyright (C) 1993, 1994, 1996, 1997, 1999 Free Software Foundation, Inc.
Copyright (C) 1993-2006 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@boulder.colorado.edu>
Date: Mar 1995
@ -580,22 +580,11 @@ NSString* const NSParseErrorException
static void _terminate()
{
BOOL shouldAbort;
#ifdef DEBUG
shouldAbort = YES; // abort() by default.
#if defined(__MINGW32__)
ExitProcess(-1);
#else
shouldAbort = NO; // exit() by default.
exit(1);
#endif
shouldAbort = GSEnvironmentFlag("CRASH_ON_ABORT", shouldAbort);
if (shouldAbort == YES)
{
abort();
}
else
{
exit(1);
}
}
static void

View file

@ -1,29 +1,29 @@
/** NSGeometry.m - geometry functions
* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
*
* Written by: Adam Fedor <fedor@boulder.colorado.edu>
* Date: Mar 1995
*
* This file is part of the GNUstep Base Library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02111 USA.
Copyright (C) 1993-2006 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@boulder.colorado.edu>
Date: Mar 1995
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>NSGeometry class reference</title>
$Date$ $Revision$
*/
*/
/*
* Define IN_NSGEOMETRY_M so that the Foundation/NSGeometry.h header can

View file

@ -1,31 +1,31 @@
/** NSHashTable implementation for GNUStep.
* Copyright (C) 1994, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
*
* Author: Albin L. Jones <Albin.L.Jones@Dartmouth.EDU>
* Created: Mon Dec 12 23:54:09 EST 1994
* Updated: Mon Mar 11 01:48:31 EST 1996
* Serial: 96.03.11.06
* Rewrite by: Richard Frith-Macdonald <rfm@gnu.org>
*
* This file is part of the GNUstep Base Library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02111 USA.
*
* <title>NSHashTable class reference</title>
* $Date$ $Revision$
Copyright (C) 1994, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
Author: Albin L. Jones <Albin.L.Jones@Dartmouth.EDU>
Created: Mon Dec 12 23:54:09 EST 1994
Updated: Mon Mar 11 01:48:31 EST 1996
Serial: 96.03.11.06
Rewrite by: Richard Frith-Macdonald <rfm@gnu.org>
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>NSHashTable class reference</title>
$Date$ $Revision$
*/
/**** Included Headers *******************************************************/

View file

@ -1,5 +1,5 @@
/** Interface for NSLog for GNUStep
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1996-2006 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@boulder.colorado.edu>
Date: November 1996
@ -51,24 +51,12 @@
#include "GSPrivate.h"
extern NSThread *GSCurrentThread(); // why isn't this in GSPrivate.h ?? -SG
//extern NSThread *GSCurrentThread(); // why isn't this in GSPrivate.h ?? -SG
// From "Win32Support.h"
#define UNISTR(X) \
((WCHAR *)[(X) cStringUsingEncoding: NSUnicodeStringEncoding])
// From private base shared functions
void crash(char *description);
void crash(char *description)
{
#if defined(__MINGW32__)
ExitProcess(-1);
#else
abort();
#endif
}
/* DEPRECATED - DELETED Base 1.14 => we don't support this anymore
*
* We delete these entirely. Simpler, faster, smaller
@ -246,7 +234,7 @@ NSLog_printf_handler *_NSLog_printf_handler = _GSLog_standard_printf_handler;
* NSDebugLog(), NSWarnLog() and GSPrintf() for example. We recommend
* the use of NSDebugLog() and its relatives for debug purposes, and
* GSPrintf() for general messages, with NSLog() being reserved
* for reporting possible/likely errors. See GSObjCRuntime.h
* for reporting possible/likely errors. See GSFunctions.h
* </p>
*/
void

View file

@ -1,32 +1,32 @@
/** NSMapTable implementation for GNUStep.
* Copyright (C) 1994, 1995, 1996, 2002 Free Software Foundation, Inc.
*
* Author: Albin L. Jones <Albin.L.Jones@Dartmouth.EDU>
* Created: Mon Dec 12 23:59:57 EST 1994
* Updated: Sun Mar 17 18:37:12 EST 1996
* Serial: 96.03.17.31
* Rewrite by: Richard Frith-Macdonald <rfm@gnu.org>
*
* This file is part of the GNUstep Base Library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02111 USA.
*
* <title>NSMapTable class reference</title>
* $Date$ $Revision$
*/
Copyright (C) 1994-2006 Free Software Foundation, Inc.
Author: Albin L. Jones <Albin.L.Jones@Dartmouth.EDU>
Created: Mon Dec 12 23:59:57 EST 1994
Updated: Sun Mar 17 18:37:12 EST 1996
Serial: 96.03.17.31
Rewrite by: Richard Frith-Macdonald <rfm@gnu.org>
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>NSMapTable class reference</title>
$Date$ $Revision$
*/
/**** Included Headers *******************************************************/

View file

@ -108,6 +108,35 @@ static Class NSConstantStringClass;
*/
static objc_mutex_t allocationLock = NULL;
/*
* Check if an environment variable is set to YES/TRUE or non-zero number
*/
static BOOL environment_flag(const char *name, BOOL def)
{
const char *c = getenv(name);
BOOL a = def;
if (c != 0)
{
a = NO;
if ((c[0] == 'y' || c[0] == 'Y') && (c[1] == 'e' || c[1] == 'E')
&& (c[2] == 's' || c[2] == 'S') && c[3] == 0)
{
a = YES;
}
else if ((c[0] == 't' || c[0] == 'T') && (c[1] == 'r' || c[1] == 'R')
&& (c[2] == 'u' || c[2] == 'U') && (c[3] == 'e' || c[3] == 'E')
&& c[4] == 0)
{
a = YES;
}
else if (isdigit(c[0]) && c[0] != '0')
{
a = YES;
}
}
return a;
}
BOOL NSZombieEnabled = NO;
BOOL NSDeallocateZombies = NO;
@ -161,7 +190,7 @@ static void GSLogZombie(id o, SEL sel)
NSLog(@"Deallocated %@ (0x%x) sent %@",
NSStringFromClass(c), o, NSStringFromSelector(sel));
}
if (GSEnvironmentFlag("CRASH_ON_ZOMBIE", NO) == YES)
if (environment_flag("CRASH_ON_ZOMBIE", NO) == YES)
{
abort();
}
@ -968,8 +997,8 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
zombieMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
NSNonOwnedPointerMapValueCallBacks, 0);
zombieClass = [NSZombie class];
NSZombieEnabled = GSEnvironmentFlag("NSZombieEnabled", NO);
NSDeallocateZombies = GSEnvironmentFlag("NSDeallocateZombies", NO);
NSZombieEnabled = environment_flag("NSZombieEnabled", NO);
NSDeallocateZombies = environment_flag("NSDeallocateZombies", NO);
autorelease_class = [NSAutoreleasePool class];
autorelease_sel = @selector(addObject:);

View file

@ -1107,7 +1107,7 @@ static BOOL debugTemporarilyDisabled = NO;
/**
* Fallback method. The developer must call this method to initialize
* the NSProcessInfo system if none of the system-specific hacks to
* the NSProcessInfo system if none of the system-specific methods to
* auto-initialize it are working.<br />
* It should also be safe to call this method to override the effects
* of the automatic initialisation.
@ -1213,31 +1213,3 @@ BOOL GSDebugSet(NSString *level)
return YES;
}
BOOL
GSEnvironmentFlag(const char *name, BOOL def)
{
const char *c = getenv(name);
BOOL a = def;
if (c != 0)
{
a = NO;
if ((c[0] == 'y' || c[0] == 'Y') && (c[1] == 'e' || c[1] == 'E')
&& (c[2] == 's' || c[2] == 'S') && c[3] == 0)
{
a = YES;
}
else if ((c[0] == 't' || c[0] == 'T') && (c[1] == 'r' || c[1] == 'R')
&& (c[2] == 'u' || c[2] == 'U') && (c[3] == 'e' || c[3] == 'E')
&& c[4] == 0)
{
a = YES;
}
else if (isdigit(c[0]) && c[0] != '0')
{
a = YES;
}
}
return a;
}

View file

@ -1635,7 +1635,8 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
else if (x == NSPropertyListGNUstepFormat)
{
[dest appendBytes: "<*I" length: 3];
PString([obj stringValue], dest);
[dest appendData:
[[obj stringValue] dataUsingEncoding: NSASCIIStringEncoding]];
[dest appendBytes: ">" length: 1];
}
else
@ -1654,7 +1655,8 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
else if (x == NSPropertyListGNUstepFormat)
{
[dest appendBytes: "<*R" length: 3];
PString([obj stringValue], dest);
[dest appendData:
[[obj stringValue] dataUsingEncoding: NSASCIIStringEncoding]];
[dest appendBytes: ">" length: 1];
}
else

View file

@ -1,29 +1,29 @@
/** NSRange - range functions
* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
*
* Written by: Adam Fedor <fedor@boulder.colorado.edu>
* Date: Mar 1995
*
* This file is part of the GNUstep Base Library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02111 USA.
Copyright (C) 1993-2006 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@boulder.colorado.edu>
Date: Mar 1995
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>NSRange class reference</title>
$Date$ $Revision$
*/
*/
#include "config.h"

View file

@ -1,5 +1,5 @@
/** Implemenation of NSScanner class
Copyright (C) 1996,1999 Free Software Foundation, Inc.
Copyright (C) 1996-2006 Free Software Foundation, Inc.
Author: Eric Norum <eric@skatter.usask.ca>
Date: 1996
@ -33,6 +33,7 @@
#endif
#include "config.h"
#include "GNUstepBase/GNUstep.h"
#include "GNUstepBase/Unicode.h"
#include "Foundation/NSScanner.h"
#include "Foundation/NSException.h"