mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Tidyups ... non functional.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14961 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dd8698bd0e
commit
b94ff9571e
13 changed files with 48 additions and 41 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-11-09 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSObject.m: use NSString implementation of
|
||||||
|
([descriptionWithLocale:indent:to:])
|
||||||
|
|
||||||
2002-11-07 02:21 Alexander Malmberg <alexander@malmberg.org>
|
2002-11-07 02:21 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
* Source/GSString.m: (-makeImmutableCopyOnFail:): Set isa to correct
|
* Source/GSString.m: (-makeImmutableCopyOnFail:): Set isa to correct
|
||||||
|
|
|
@ -253,11 +253,11 @@ static SEL oatSel;
|
||||||
static SEL remSel;
|
static SEL remSel;
|
||||||
|
|
||||||
static IMP infImp;
|
static IMP infImp;
|
||||||
static void (*addImp)();
|
static void (*addImp)(NSMutableArray*,SEL,id);
|
||||||
static unsigned (*cntImp)();
|
static unsigned (*cntImp)(NSArray*,SEL);
|
||||||
static void (*insImp)();
|
static void (*insImp)(NSMutableArray*,SEL,id,unsigned);
|
||||||
static IMP oatImp;
|
static IMP oatImp;
|
||||||
static void (*remImp)();
|
static void (*remImp)(NSMutableArray*,SEL,unsigned);
|
||||||
|
|
||||||
#define NEWINFO(Z,O,L) ((*infImp)(infCls, infSel, (Z), (O), (L)))
|
#define NEWINFO(Z,O,L) ((*infImp)(infCls, infSel, (Z), (O), (L)))
|
||||||
#define ADDOBJECT(O) ((*addImp)(_infoArray, addSel, (O)))
|
#define ADDOBJECT(O) ((*addImp)(_infoArray, addSel, (O)))
|
||||||
|
@ -265,7 +265,7 @@ static void (*remImp)();
|
||||||
#define OBJECTAT(I) ((*oatImp)(_infoArray, oatSel, (I)))
|
#define OBJECTAT(I) ((*oatImp)(_infoArray, oatSel, (I)))
|
||||||
#define REMOVEAT(I) ((*remImp)(_infoArray, remSel, (I)))
|
#define REMOVEAT(I) ((*remImp)(_infoArray, remSel, (I)))
|
||||||
|
|
||||||
static void _setup()
|
static void _setup(void)
|
||||||
{
|
{
|
||||||
if (infCls == 0)
|
if (infCls == 0)
|
||||||
{
|
{
|
||||||
|
@ -286,11 +286,13 @@ static void _setup()
|
||||||
|
|
||||||
a = [NSMutableArray allocWithZone: NSDefaultMallocZone()];
|
a = [NSMutableArray allocWithZone: NSDefaultMallocZone()];
|
||||||
a = [a initWithCapacity: 1];
|
a = [a initWithCapacity: 1];
|
||||||
addImp = (void (*)())[a methodForSelector: addSel];
|
addImp = (void (*)(NSMutableArray*,SEL,id))[a methodForSelector: addSel];
|
||||||
cntImp = (unsigned (*)())[a methodForSelector: cntSel];
|
cntImp = (unsigned (*)(NSArray*,SEL))[a methodForSelector: cntSel];
|
||||||
insImp = (void (*)())[a methodForSelector: insSel];
|
insImp = (void (*)(NSMutableArray*,SEL,id,unsigned))
|
||||||
|
[a methodForSelector: insSel];
|
||||||
oatImp = [a methodForSelector: oatSel];
|
oatImp = [a methodForSelector: oatSel];
|
||||||
remImp = (void (*)())[a methodForSelector: remSel];
|
remImp = (void (*)(NSMutableArray*,SEL,unsigned))
|
||||||
|
[a methodForSelector: remSel];
|
||||||
RELEASE(a);
|
RELEASE(a);
|
||||||
d = [NSDictionary new];
|
d = [NSDictionary new];
|
||||||
blank = cacheAttributes(d);
|
blank = cacheAttributes(d);
|
||||||
|
|
|
@ -41,10 +41,10 @@
|
||||||
# Additional flags to pass to the preprocessor
|
# Additional flags to pass to the preprocessor
|
||||||
ADDITIONAL_CPPFLAGS = $(DEFS) $(CONFIG_SYSTEM_DEFS) -Wall \
|
ADDITIONAL_CPPFLAGS = $(DEFS) $(CONFIG_SYSTEM_DEFS) -Wall \
|
||||||
-Wcast-align \
|
-Wcast-align \
|
||||||
|
#-Wstrict-prototypes \
|
||||||
#-Wpointer-arith \
|
#-Wpointer-arith \
|
||||||
#-Wcast-qual \
|
#-Wcast-qual \
|
||||||
#-Wwrite-strings \
|
#-Wwrite-strings \
|
||||||
#-Wstrict-prototypes \
|
|
||||||
#-Wmissing-prototypes \
|
#-Wmissing-prototypes \
|
||||||
#-Wmissing-declarations \
|
#-Wmissing-declarations \
|
||||||
#-Wredundant-decls \
|
#-Wredundant-decls \
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
- (id) initWithBytes: (const void*)value objCType: (const char*)type
|
- (id) initWithBytes: (const void*)value objCType: (const char*)type
|
||||||
{
|
{
|
||||||
typedef __typeof__(data) _dt;
|
typedef __typeof__(data) _dt;
|
||||||
data = *(_dt*)value;
|
data = *(const _dt*)value;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
@class GSDictionary;
|
@class GSDictionary;
|
||||||
@class GSMutableDictionary;
|
@class GSMutableDictionary;
|
||||||
|
|
||||||
|
extern BOOL GSMacOSXCompatiblePropertyLists(void);
|
||||||
|
|
||||||
static Class NSArray_class;
|
static Class NSArray_class;
|
||||||
static Class NSDictionaryClass;
|
static Class NSDictionaryClass;
|
||||||
static Class NSMutableDictionaryClass;
|
static Class NSMutableDictionaryClass;
|
||||||
|
@ -738,7 +740,6 @@ compareIt(id o1, id o2, void* context)
|
||||||
*/
|
*/
|
||||||
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
|
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
|
||||||
{
|
{
|
||||||
extern BOOL GSMacOSXCompatiblePropertyLists();
|
|
||||||
NSDictionary *loc;
|
NSDictionary *loc;
|
||||||
NSString *desc;
|
NSString *desc;
|
||||||
|
|
||||||
|
@ -774,7 +775,6 @@ compareIt(id o1, id o2, void* context)
|
||||||
*/
|
*/
|
||||||
- (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile
|
- (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile
|
||||||
{
|
{
|
||||||
extern BOOL GSMacOSXCompatiblePropertyLists();
|
|
||||||
NSDictionary *loc;
|
NSDictionary *loc;
|
||||||
NSString *desc;
|
NSString *desc;
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ static void
|
||||||
_NSFoundationUncaughtExceptionHandler (NSException *exception)
|
_NSFoundationUncaughtExceptionHandler (NSException *exception)
|
||||||
{
|
{
|
||||||
BOOL a;
|
BOOL a;
|
||||||
extern const char* GSArgZero();
|
extern const char* GSArgZero(void);
|
||||||
|
|
||||||
_NSUncaughtExceptionHandler = _preventRecursion;
|
_NSUncaughtExceptionHandler = _preventRecursion;
|
||||||
#if 1
|
#if 1
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include <Foundation/NSScanner.h>
|
#include <Foundation/NSScanner.h>
|
||||||
#include <Foundation/NSNotification.h>
|
#include <Foundation/NSNotification.h>
|
||||||
|
|
||||||
extern BOOL GSMacOSXCompatibleGeometry(); // Compatibility mode
|
extern BOOL GSMacOSXCompatibleGeometry(void); // Compatibility mode
|
||||||
|
|
||||||
static Class NSStringClass = 0;
|
static Class NSStringClass = 0;
|
||||||
static Class NSScannerClass = 0;
|
static Class NSScannerClass = 0;
|
||||||
|
@ -53,7 +53,7 @@ static BOOL (*scanStringImp)(NSScanner*, SEL, NSString*, NSString**);
|
||||||
static id (*scannerImp)(Class, SEL, NSString*);
|
static id (*scannerImp)(Class, SEL, NSString*);
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
setupCache()
|
setupCache(void)
|
||||||
{
|
{
|
||||||
if (NSStringClass == 0)
|
if (NSStringClass == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -392,7 +392,7 @@ static void endNCTable(NCTable *t)
|
||||||
TEST_RELEASE(t->_lock);
|
TEST_RELEASE(t->_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static NCTable *newNCTable()
|
static NCTable *newNCTable(void)
|
||||||
{
|
{
|
||||||
NCTable *t;
|
NCTable *t;
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ typedef struct {
|
||||||
@end
|
@end
|
||||||
|
|
||||||
static NotificationQueueList*
|
static NotificationQueueList*
|
||||||
currentList()
|
currentList(void)
|
||||||
{
|
{
|
||||||
NotificationQueueList *list;
|
NotificationQueueList *list;
|
||||||
NSMutableDictionary *d;
|
NSMutableDictionary *d;
|
||||||
|
|
|
@ -769,12 +769,12 @@ static BOOL double_release_check_enabled = NO;
|
||||||
{
|
{
|
||||||
if (self == [NSObject class])
|
if (self == [NSObject class])
|
||||||
{
|
{
|
||||||
extern void GSBuildStrings(); // See externs.m
|
extern void GSBuildStrings(void); // See externs.m
|
||||||
extern const char* GSSetLocaleC(); // See GSLocale.m
|
extern const char* GSSetLocaleC(const char*); // See GSLocale.m
|
||||||
|
|
||||||
#ifdef __MINGW__
|
#ifdef __MINGW__
|
||||||
// See libgnustep-base-entry.m
|
// See libgnustep-base-entry.m
|
||||||
extern void gnustep_base_socket_init();
|
extern void gnustep_base_socket_init(void);
|
||||||
gnustep_base_socket_init();
|
gnustep_base_socket_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2018,24 +2018,24 @@ static BOOL double_release_check_enabled = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default (NSObject) implementation of this method simply calls
|
* Uses the [NSString] implementation.
|
||||||
* the -descriptionWithLocale:indent: method and appends
|
|
||||||
* the value returned by that method to the output object.
|
|
||||||
*/
|
*/
|
||||||
- (void) descriptionWithLocale: (NSDictionary*)aLocale
|
- (void) descriptionWithLocale: (NSDictionary*)aLocale
|
||||||
indent: (unsigned)level
|
indent: (unsigned)level
|
||||||
to: (id<GNUDescriptionDestination>)output
|
to: (id<GNUDescriptionDestination>)output
|
||||||
{
|
{
|
||||||
[output appendString:
|
NSString *tmp = [(id)self descriptionWithLocale: aLocale];
|
||||||
[(id)self descriptionWithLocale: aLocale indent: level]];
|
|
||||||
|
[tmp descriptionWithLocale: aLocale indent: level to: output];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void) descriptionWithLocale: (NSDictionary*)aLocale
|
+ (void) descriptionWithLocale: (NSDictionary*)aLocale
|
||||||
indent: (unsigned)level
|
indent: (unsigned)level
|
||||||
to: (id<GNUDescriptionDestination>)output
|
to: (id<GNUDescriptionDestination>)output
|
||||||
{
|
{
|
||||||
[output appendString:
|
NSString *tmp = [(id)self descriptionWithLocale: aLocale];
|
||||||
[(id)self descriptionWithLocale: aLocale indent: level]];
|
|
||||||
|
[tmp descriptionWithLocale: aLocale indent: level to: output];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) _dealloc
|
- (BOOL) _dealloc
|
||||||
|
|
|
@ -615,7 +615,7 @@ int main(int argc, char *argv[], char *env[])
|
||||||
[gnustep_global_lock lock];
|
[gnustep_global_lock lock];
|
||||||
if (host == nil)
|
if (host == nil)
|
||||||
{
|
{
|
||||||
extern NSTimeInterval GSTimeNow();
|
extern NSTimeInterval GSTimeNow(void);
|
||||||
|
|
||||||
pid = [self processIdentifier];
|
pid = [self processIdentifier];
|
||||||
start = (unsigned long)GSTimeNow();
|
start = (unsigned long)GSTimeNow();
|
||||||
|
@ -869,7 +869,7 @@ GSEnvironmentFlag(const char *name, BOOL def)
|
||||||
* methods/functions which might cause a recursive exception.
|
* methods/functions which might cause a recursive exception.
|
||||||
*/
|
*/
|
||||||
const char*
|
const char*
|
||||||
GSArgZero()
|
GSArgZero(void)
|
||||||
{
|
{
|
||||||
if (_gnu_arg_zero == 0)
|
if (_gnu_arg_zero == 0)
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -44,7 +44,7 @@ static BOOL (*scanStringImp)(NSScanner*, SEL, NSString*, NSString**);
|
||||||
static id (*scannerImp)(Class, SEL, NSString*);
|
static id (*scannerImp)(Class, SEL, NSString*);
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
setupCache()
|
setupCache(void)
|
||||||
{
|
{
|
||||||
if (NSStringClass == 0)
|
if (NSStringClass == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -112,11 +112,11 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NSMutableData *data;
|
NSMutableData *data;
|
||||||
void (*appImp)(); // Append to data.
|
void (*appImp)(NSData*,SEL,const void*,unsigned);
|
||||||
void* (*datImp)(); // Bytes pointer.
|
void* (*datImp)(NSMutableData*,SEL); // Bytes pointer.
|
||||||
unsigned int (*lenImp)(); // Length of data.
|
unsigned int (*lenImp)(NSData*,SEL); // Length of data.
|
||||||
void (*serImp)(); // Serialize integer.
|
void (*serImp)(NSMutableData*,SEL,int); // Serialize integer.
|
||||||
void (*setImp)(); // Set length of data.
|
void (*setImp)(NSMutableData*,SEL,unsigned); // Set length of data.
|
||||||
unsigned count; // String counter.
|
unsigned count; // String counter.
|
||||||
GSIMapTable_t map; // For uniquing.
|
GSIMapTable_t map; // For uniquing.
|
||||||
BOOL shouldUnique; // Do we do uniquing?
|
BOOL shouldUnique; // Do we do uniquing?
|
||||||
|
@ -135,11 +135,11 @@ initSerializerInfo(_NSSerializerInfo* info, NSMutableData *d, BOOL u)
|
||||||
|
|
||||||
c = GSObjCClass(d);
|
c = GSObjCClass(d);
|
||||||
info->data = d;
|
info->data = d;
|
||||||
info->appImp = (void (*)())get_imp(c, appSel);
|
info->appImp = (void (*)(NSData*,SEL,const void*,unsigned))get_imp(c, appSel);
|
||||||
info->datImp = (void* (*)())get_imp(c, datSel);
|
info->datImp = (void* (*)(NSMutableData*,SEL))get_imp(c, datSel);
|
||||||
info->lenImp = (unsigned int (*)())get_imp(c, lenSel);
|
info->lenImp = (unsigned int (*)(NSData*,SEL))get_imp(c, lenSel);
|
||||||
info->serImp = (void (*)())get_imp(c, serSel);
|
info->serImp = (void (*)(NSMutableData*,SEL,int))get_imp(c, serSel);
|
||||||
info->setImp = (void (*)())get_imp(c, setSel);
|
info->setImp = (void (*)(NSMutableData*,SEL,unsigned))get_imp(c, setSel);
|
||||||
info->shouldUnique = u;
|
info->shouldUnique = u;
|
||||||
(*info->appImp)(d, appSel, &info->shouldUnique, 1);
|
(*info->appImp)(d, appSel, &info->shouldUnique, 1);
|
||||||
if (u)
|
if (u)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue