Trivial tidyups

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14959 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-11-09 06:45:31 +00:00
parent dd5cc6f3ee
commit 8355371659
19 changed files with 58 additions and 100 deletions

View file

@ -260,56 +260,6 @@ static inline unsigned long
NSSwapHostLongToLittle(unsigned long num) __attribute__((unused));
static inline unsigned short
NSSwapHostShortToLittle(unsigned short num) __attribute__((unused));
static inline NSByteOrder
NSHostByteOrder(void) __attribute__((unused));
static inline double
NSSwapBigDoubleToHost(NSSwappedDouble num) __attribute__((unused));
static inline float
NSSwapBigFloatToHost(NSSwappedFloat num) __attribute__((unused));
static inline unsigned int
NSSwapBigIntToHost(unsigned int num) __attribute__((unused));
static inline unsigned long long
NSSwapBigLongLongToHost(unsigned long long num) __attribute__((unused));
static inline unsigned long
NSSwapBigLongToHost(unsigned long num) __attribute__((unused));
static inline unsigned short
NSSwapBigShortToHost(unsigned short num) __attribute__((unused));
static inline NSSwappedDouble
NSSwapHostDoubleToBig(double num) __attribute__((unused));
static inline NSSwappedFloat
NSSwapHostFloatToBig(float num) __attribute__((unused));
static inline unsigned int
NSSwapHostIntToBig(unsigned int num) __attribute__((unused));
static inline unsigned long long
NSSwapHostLongLongToBig(unsigned long long num) __attribute__((unused));
static inline unsigned long
NSSwapHostLongToBig(unsigned long num) __attribute__((unused));
static inline unsigned short
NSSwapHostShortToBig(unsigned short num) __attribute__((unused));
static inline double
NSSwapLittleDoubleToHost(NSSwappedDouble num) __attribute__((unused));
static inline float
NSSwapLittleFloatToHost(NSSwappedFloat num) __attribute__((unused));
static inline unsigned int
NSSwapLittleIntToHost(unsigned int num) __attribute__((unused));
static inline unsigned long long
NSSwapLittleLongLongToHost(unsigned long long num) __attribute__((unused));
static inline unsigned long
NSSwapLittleLongToHost(unsigned long num) __attribute__((unused));
static inline unsigned short
NSSwapLittleShortToHost(unsigned short num) __attribute__((unused));
static inline NSSwappedDouble
NSSwapHostDoubleToLittle(double num) __attribute__((unused));
static inline NSSwappedFloat
NSSwapHostFloatToLittle(float num) __attribute__((unused));
static inline unsigned int
NSSwapHostIntToLittle(unsigned int num) __attribute__((unused));
static inline unsigned long long
NSSwapHostLongLongToLittle(unsigned long long num) __attribute__((unused));
static inline unsigned long
NSSwapHostLongToLittle(unsigned long num) __attribute__((unused));
static inline unsigned short
NSSwapHostShortToLittle(unsigned short num) __attribute__((unused));
/*
* Basic byte swapping routines and type conversions

View file

@ -29,8 +29,6 @@
#include <errno.h>
#include <Foundation/NSObject.h>
extern int errno;
/*
* Functions for debugging object allocation/deallocation
@ -99,7 +97,7 @@ GS_EXPORT int GSDebugAllocationTotal(Class c);
* Returns a NULL terminated array listing all the classes
* for which statistical information has been collected.
*/
GS_EXPORT Class* GSDebugAllocationClassList();
GS_EXPORT Class* GSDebugAllocationClassList(void);
/**
* Returns a newline separated list of the classes which
@ -115,7 +113,7 @@ GS_EXPORT const char* GSDebugAllocationList(BOOL changeFlag);
* have had instances allocated at any point, and the total
* count of the number of instances allocated for each class.
*/
GS_EXPORT const char* GSDebugAllocationListAll();
GS_EXPORT const char* GSDebugAllocationListAll(void);
/**
* Starts recording all allocated objects of a certain class.<br />

View file

@ -305,14 +305,14 @@ NSUnionRect(NSRect aRect, NSRect bRect)
NSRect rect;
if (NSIsEmptyRect(aRect) && NSIsEmptyRect(bRect))
return NSMakeRect(0,0,0,0);
return NSMakeRect(0.0,0.0,0.0,0.0);
else if (NSIsEmptyRect(aRect))
return bRect;
else if (NSIsEmptyRect(bRect))
return aRect;
rect = NSMakeRect(MIN(NSMinX(aRect), NSMinX(bRect)),
MIN(NSMinY(aRect), NSMinY(bRect)), 0, 0);
MIN(NSMinY(aRect), NSMinY(bRect)), 0.0, 0.0);
rect = NSMakeRect(NSMinX(rect),
NSMinY(rect),
@ -336,7 +336,7 @@ NSIntersectionRect (NSRect aRect, NSRect bRect)
if (NSMaxX(aRect) <= NSMinX(bRect) || NSMaxX(bRect) <= NSMinX(aRect)
|| NSMaxY(aRect) <= NSMinY(bRect) || NSMaxY(bRect) <= NSMinY(aRect))
{
return NSMakeRect(0, 0, 0, 0);
return NSMakeRect(0.0, 0.0, 0.0, 0.0);
}
else
{

View file

@ -104,9 +104,9 @@ struct _NSNotificationQueueList;
/*
* Functions used by the the NSRunLoop
*/
extern void GSNotifyASAP();
extern void GSNotifyIdle();
extern BOOL GSNotifyMore();
extern void GSNotifyASAP(void);
extern void GSNotifyIdle(void);
extern BOOL GSNotifyMore(void);
#endif
#endif /* __NSNotificationQueue_h__ */

View file

@ -68,7 +68,7 @@ typedef void NSLog_printf_handler (NSString* message);
GS_EXPORT NSLog_printf_handler *_NSLog_printf_handler;
GS_EXPORT int _NSLogDescriptor;
@class NSRecursiveLock;
GS_EXPORT NSRecursiveLock *GSLogLock();
GS_EXPORT NSRecursiveLock *GSLogLock(void);
GS_EXPORT BOOL GSPrintf (FILE *fptr, NSString *format, ...);
#endif

View file

@ -44,8 +44,8 @@ GS_EXPORT NSString *GSDefaultsRootForUser(NSString *userName);
GS_EXPORT NSString *GSSystemRootDirectory(void);
GS_EXPORT NSArray *GSStandardPathPrefixes(void);
#endif
GS_EXPORT NSString *NSUserName();
GS_EXPORT NSString *NSHomeDirectory();
GS_EXPORT NSString *NSUserName(void);
GS_EXPORT NSString *NSHomeDirectory(void);
GS_EXPORT NSString *NSHomeDirectoryForUser(NSString *userName);
#ifndef STRICT_OPENSTEP

View file

@ -113,6 +113,15 @@ NSLocationInRange(unsigned location, NSRange range)
GS_RANGE_SCOPE NSRange
NSMakeRange(unsigned int location, unsigned int length) GS_RANGE_ATTR;
GS_EXPORT void _NSRangeExceptionRaise (void);
/* NB: The implementation of _NSRangeExceptionRaise is:
[NSException raise: NSRangeException
format: @"Range location + length too great"];
_NSRangeExceptionRaise is defined in NSRange.m so that this
file (NSRange.h) can be included without problems in the
implementation of the base classes themselves. */
GS_RANGE_SCOPE NSRange
NSMakeRange(unsigned int location, unsigned int length)
{
@ -121,14 +130,6 @@ NSMakeRange(unsigned int location, unsigned int length)
if (end < location || end < length)
{
GS_EXPORT void _NSRangeExceptionRaise ();
/* NB: The implementation of _NSRangeExceptionRaise is:
[NSException raise: NSRangeException
format: @"Range location + length too great"]; */
/* _NSRangeExceptionRaise is defined in NSRange.m so that this
file (NSRange.h) can be included without problems in the
implementation of the base classes themselves. */
_NSRangeExceptionRaise ();
}
range.location = location;

View file

@ -125,8 +125,8 @@ GS_EXPORT NSString *NSThreadDidStartNotification;
/*
* Get current thread and it's dictionary.
*/
GS_EXPORT NSThread *GSCurrentThread();
GS_EXPORT NSMutableDictionary *GSCurrentThreadDictionary();
GS_EXPORT NSThread *GSCurrentThread(void);
GS_EXPORT NSMutableDictionary *GSCurrentThreadDictionary(void);
#endif
#endif /* __NSThread_h_GNUSTEP_BASE_INCLUDE */

View file

@ -36,8 +36,8 @@
*/
#ifndef NO_GNUSTEP
GS_EXPORT NSStringEncoding *GetAvailableEncodings();
GS_EXPORT NSStringEncoding GetDefEncoding();
GS_EXPORT NSStringEncoding *GetAvailableEncodings(void);
GS_EXPORT NSStringEncoding GetDefEncoding(void);
GS_EXPORT NSStringEncoding GSEncodingFromLocale(const char *clocale);
GS_EXPORT NSStringEncoding GSEncodingForRegistry(NSString *registry,
NSString *encoding);

View file

@ -56,6 +56,6 @@ void behavior_class_add_methods (Class class,
struct objc_method_list *methods);
/* Set to non-zero if you want debugging messages on stderr. */
void set_behavior_debug(int i);
void behavior_set_debug(int i);
#endif /* __behavior_h_GNUSTEP_BASE_INCLUDE */

View file

@ -75,7 +75,7 @@ typedef enum {
/*
* Get the dictionary representation.
*/
NSDictionary *GSUserDefaultsDictionaryRepresentation();
NSDictionary *GSUserDefaultsDictionaryRepresentation(void);
/*
* Get one of several potentially useful flags.

View file

@ -231,13 +231,13 @@ static NSStringEncoding intEnc = NSISOLatin1StringEncoding;
* initialized, and caches classes and some method implementations.
*/
static void
setup()
setup(void)
{
static BOOL beenHere = NO;
if (beenHere == NO)
{
extern NSStringEncoding GetDefEncoding();
extern NSStringEncoding GetDefEncoding(void);
beenHere = YES;

View file

@ -446,19 +446,22 @@ GSEQ_STRCOMP(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
#endif
#if GSEQ_S == GSEQ_NS || GSEQ_S == GSEQ_US
srImp = (NSRange (*)())[(id)s methodForSelector: ranSel];
srImp = (NSRange (*)(NSString*, SEL, unsigned))
[(id)s methodForSelector: ranSel];
#endif
#if GSEQ_O == GSEQ_NS || GSEQ_O == GSEQ_US
orImp = (NSRange (*)())[(id)o methodForSelector: ranSel];
orImp = (NSRange (*)(NSString*, SEL, unsigned))
[(id)o methodForSelector: ranSel];
#endif
#if GSEQ_S == GSEQ_NS
sgImp = (void (*)())[(id)s methodForSelector: gcrSel];
sgImp = (void (*)(NSString*, SEL, unichar*, NSRange))
[(id)s methodForSelector: gcrSel];
#endif
#if GSEQ_O == GSEQ_NS
ogImp = (void (*)())[(id)o methodForSelector: gcrSel];
ogImp = (void (*)(NSString*, SEL, unichar*, NSRange))
[(id)o methodForSelector: gcrSel];
#endif
while (sCount < end)
{
if (oCount >= oLength)

View file

@ -39,7 +39,21 @@
#
# Additional flags to pass to the preprocessor
ADDITIONAL_CPPFLAGS = $(DEFS) $(CONFIG_SYSTEM_DEFS) -Wall
ADDITIONAL_CPPFLAGS = $(DEFS) $(CONFIG_SYSTEM_DEFS) -Wall \
#-Wpointer-arith \
#-Wcast-qual \
#-Wcast-align \
#-Wwrite-strings \
#-Wstrict-prototypes \
#-Wmissing-prototypes \
#-Wmissing-declarations \
#-Wredundant-decls \
#-Wnested-externs \
#-Winline \
#-Werror \
#-Wshadow
#-Wconversion
# Additional flags to pass to the Objective-C compiler
ADDITIONAL_OBJCFLAGS =

View file

@ -46,6 +46,8 @@
#include <Foundation/NSDebug.h>
#include "GSPrivate.h"
extern BOOL GSMacOSXCompatiblePropertyLists(void);
@class NSArrayEnumerator;
@class NSArrayEnumeratorReverse;
@ -1100,7 +1102,6 @@ static NSString *indentStrings[] = {
*/
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
{
extern BOOL GSMacOSXCompatiblePropertyLists();
NSDictionary *loc;
NSString *desc;
@ -1136,7 +1137,6 @@ static NSString *indentStrings[] = {
*/
- (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile
{
extern BOOL GSMacOSXCompatiblePropertyLists();
NSDictionary *loc;
NSString *desc;

View file

@ -685,7 +685,6 @@ failure:
int i;
int j;
NSZone *z;
extern BOOL GSMacOSXCompatiblePropertyLists();
src = [self bytes];
length = [self length];

View file

@ -124,7 +124,7 @@ otherTime(NSDate* other)
* Returns the current time (seconds since reference date) as an NSTimeInterval.
*/
NSTimeInterval
GSTimeNow()
GSTimeNow(void)
{
#if !defined(__MINGW__)
NSTimeInterval interval;

View file

@ -58,7 +58,7 @@ static BOOL debug_allocation = NO;
static NSLock *uniqueLock;
static const char* _GSDebugAllocationList(BOOL difference);
static const char* _GSDebugAllocationListAll();
static const char* _GSDebugAllocationListAll(void);
@interface GSDebugAlloc : NSObject
+ (void) initialize;
@ -534,7 +534,7 @@ GSDebugAllocationListAll()
}
static const char*
_GSDebugAllocationListAll()
_GSDebugAllocationListAll(void)
{
int pos = 0;
int i;

View file

@ -83,8 +83,8 @@ behavior_class_add_class (Class class, Class behavior)
}
else
NSCAssert2(class->instance_size >= behavior->instance_size,
@"Trying to add behavior (%s) with instance size larger than class (%s)",
class_get_class_name(behavior), class_get_class_name(class));
@"Trying to add behavior (%s) with instance size larger than class (%s)",
class_get_class_name(behavior), class_get_class_name(class));
}
#else
/* If necessary, increase instance_size of CLASS. */
@ -154,13 +154,6 @@ behavior_class_add_class (Class class, Class behavior)
return;
}
/* The old interface */
void
class_add_behavior (Class class, Class behavior)
{
behavior_class_add_class (class, behavior);
}
void
behavior_class_add_category (Class class, struct objc_category *category)
{