Fix typos.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1276 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1996-03-26 20:59:42 +00:00
parent 4e034a4b95
commit f491e64f1b
10 changed files with 82 additions and 65 deletions

View file

@ -1,8 +1,8 @@
/* IndexedCollection definitions for the use of subclass implementations only /* IndexedCollection definitions for the use of subclass implementations only
Copyright (C) 1993,1994 Free Software Foundation, Inc. Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu> Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993 Created: May 1993
This file is part of the GNU Objective C Class Library. This file is part of the GNU Objective C Class Library.
@ -26,22 +26,16 @@
#include <objects/stdobjects.h> #include <objects/stdobjects.h>
#include <objects/CollectionPrivate.h> #include <objects/CollectionPrivate.h>
#include <Foundation/NSException.h>
#include <objects/NSString.h>
/* To be used inside a method for making sure that index /* To be used inside a method for making sure that index
is not above range. is not above range.
*/ */
#define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \ #define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \
({if (INDEX >= OVER) \ if (INDEX >= OVER) \
[self error:"in %s, index out of range", sel_get_name(_cmd)];}) [NSException raise: NSRangeException \
format: @"in %s, index %d is out of range", \
sel_get_name (_cmd), INDEX]
/* For use with subclasses of IndexedCollections that allow elements to
be added, but not added at particular indices---the collection itself
determines the order.
*/
#define INSERTION_ERROR() \
([self error:"in %s, this collection does not allow insertions", \
sel_get_name(aSel)];)
#endif /* __IndexedCollectionPrivate_h_INCLUDE_GNU */ #endif /* __IndexedCollectionPrivate_h_INCLUDE_GNU */

View file

@ -26,6 +26,7 @@
#include <objects/NSString.h> #include <objects/NSString.h>
#include <objects/StdioStream.h> #include <objects/StdioStream.h>
#include <objects/TextCStream.h> #include <objects/TextCStream.h>
#include <Foundation/NSException.h>
#define DEFAULT_FORMAT_VERSION 0 #define DEFAULT_FORMAT_VERSION 0
@ -276,7 +277,7 @@ static BOOL debug_binary_coder;
&& !((encoded_type=='c' || encoded_type=='C') && !((encoded_type=='c' || encoded_type=='C')
&& (*type=='c' || *type=='C'))) && (*type=='c' || *type=='C')))
[NSException raise: NSGenericException [NSException raise: NSGenericException
format @"Expected type \"%c\", got type \"%c\"", format: @"Expected type \"%c\", got type \"%c\"",
*type, encoded_type]; *type, encoded_type];
switch (encoded_type) switch (encoded_type)

View file

@ -45,6 +45,7 @@
#include <objects/RunLoop.h> #include <objects/RunLoop.h>
#include <Foundation/NSString.h> #include <Foundation/NSString.h>
#include <Foundation/NSDate.h> #include <Foundation/NSDate.h>
#include <Foundation/NSException.h>
#include <assert.h> #include <assert.h>
@interface Connection (GettingCoderInterface) @interface Connection (GettingCoderInterface)

View file

@ -578,7 +578,7 @@
[NSException [NSException
raise: NSGenericException raise: NSGenericException
format: @"can't decode forward reference when not decoding " format: @"can't decode forward reference when not decoding "
"a root object"]; @"a root object"];
[self decodeValueOfCType: @encode(unsigned) [self decodeValueOfCType: @encode(unsigned)
at: &fref at: &fref
withName: NULL]; withName: NULL];
@ -653,7 +653,7 @@
if (!*anObjPtr) if (!*anObjPtr)
[NSException [NSException
raise: NSGenericException raise: NSGenericException
format: @ "repeated object cross-reference number %u not found", format: @"repeated object cross-reference number %u not found",
xref]; xref];
break; break;
} }

View file

@ -28,6 +28,7 @@
#include <objects/StdioStream.h> #include <objects/StdioStream.h>
#include <objects/BinaryCStream.h> #include <objects/BinaryCStream.h>
#include <Foundation/NSArchiver.h> #include <Foundation/NSArchiver.h>
#include <Foundation/NSException.h>
static int default_format_version; static int default_format_version;
static id default_stream_class; static id default_stream_class;

View file

@ -24,6 +24,7 @@
#include <objects/stdobjects.h> #include <objects/stdobjects.h>
#include <Foundation/NSAutoreleasePool.h> #include <Foundation/NSAutoreleasePool.h>
#include <objects/objc-malloc.h> #include <objects/objc-malloc.h>
#include <Foundation/NSException.h>
#include <limits.h> #include <limits.h>
/* Doesn't handle multi-threaded stuff. /* Doesn't handle multi-threaded stuff.
@ -102,7 +103,7 @@ static unsigned pool_count_warning_threshhold = UINT_MAX;
if (released_count >= pool_count_warning_threshhold) if (released_count >= pool_count_warning_threshhold)
[NSException raise: NSGenericException [NSException raise: NSGenericException
format: @"AutoreleasePool count threshhold exceeded."]; format: @"AutoreleasePool count threshhold exceeded."];
if (released_count == released_size) if (released_count == released_size)
{ {
@ -126,7 +127,7 @@ format: @"AutoreleasePool count threshhold exceeded."];
- (id) retain - (id) retain
{ {
[NSException raise: NSGenericException [NSException raise: NSGenericException
format: @"Don't call `-retain' on a NSAutoreleasePool"]; format: @"Don't call `-retain' on a NSAutoreleasePool"];
return self; return self;
} }

View file

@ -31,6 +31,7 @@
#include <Foundation/NSAutoreleasePool.h> #include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSString.h> #include <Foundation/NSString.h>
#include <Foundation/NSMapTable.h> #include <Foundation/NSMapTable.h>
#include <Foundation/NSException.h>
#include <limits.h> #include <limits.h>
extern void (*_objc_error)(id object, const char *format, va_list); extern void (*_objc_error)(id object, const char *format, va_list);
@ -304,7 +305,7 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
[NSException [NSException
raise: NSGenericException raise: NSGenericException
format: @"Autorelease would release object too many times.\n" format: @"Autorelease would release object too many times.\n"
"%d release(s) versus %d retain(s)", release_count, retain_count]; @"%d release(s) versus %d retain(s)", release_count, retain_count];
} }
[autorelease_class addObject:self]; [autorelease_class addObject:self];
@ -355,9 +356,12 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
{ {
IMP msg = objc_msg_lookup(self, aSelector); IMP msg = objc_msg_lookup(self, aSelector);
if (!msg) if (!msg)
return [NSException {
raise: NSGenericException [NSException
format: @"invalid selector passed to %s", sel_get_name(_cmd)]; raise: NSGenericException
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
return nil;
}
return (*msg)(self, aSelector); return (*msg)(self, aSelector);
} }
@ -365,9 +369,12 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
{ {
IMP msg = objc_msg_lookup(self, aSelector); IMP msg = objc_msg_lookup(self, aSelector);
if (!msg) if (!msg)
return [NSException {
raise: NSGenericException [NSException
format: @"invalid selector passed to %s", sel_get_name(_cmd)]; raise: NSGenericException
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
return nil;
}
return (*msg)(self, aSelector, anObject); return (*msg)(self, aSelector, anObject);
} }
@ -375,9 +382,12 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
{ {
IMP msg = objc_msg_lookup(self, aSelector); IMP msg = objc_msg_lookup(self, aSelector);
if (!msg) if (!msg)
return [NSException {
raise: NSGenericException [NSException
format: @"invalid selector passed to %s", sel_get_name(_cmd)]; raise: NSGenericException
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
return nil;
}
return (*msg)(self, aSelector, object1, object2); return (*msg)(self, aSelector, object1, object2);
} }
@ -545,16 +555,18 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
- notImplemented:(SEL)aSel - notImplemented:(SEL)aSel
{ {
return [NSException [NSException
raise: NSGenericException raise: NSGenericException
format: @"method %s not implemented", sel_get_name(aSel)]; format: @"method %s not implemented", sel_get_name(aSel)];
return nil;
} }
- doesNotRecognize:(SEL)aSel - doesNotRecognize:(SEL)aSel
{ {
return [NSException raise: NSGenericException [NSException raise: NSGenericException
format: @"%s does not recognize %s", format: @"%s does not recognize %s",
object_get_class_name(self), sel_get_name(aSel)]; object_get_class_name(self), sel_get_name(aSel)];
return nil;
} }
- perform: (SEL)sel with: anObject - perform: (SEL)sel with: anObject
@ -651,17 +663,19 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
- subclassResponsibility:(SEL)aSel - subclassResponsibility:(SEL)aSel
{ {
return [NSException [NSException
raise: NSGenericException raise: NSGenericException
format: @"subclass should override %s", sel_get_name(aSel)]; format: @"subclass should override %s", sel_get_name(aSel)];
return nil;
} }
- shouldNotImplement:(SEL)aSel - shouldNotImplement:(SEL)aSel
{ {
return [NSException [NSException
raise: NSGenericException raise: NSGenericException
format: @"%s should not implement %s", format: @"%s should not implement %s",
object_get_class_name(self), sel_get_name(aSel)]; object_get_class_name(self), sel_get_name(aSel)];
return nil;
} }
+ (int)streamVersion: (TypedStream*)aStream + (int)streamVersion: (TypedStream*)aStream

View file

@ -966,7 +966,9 @@ handle_printf_atsign (FILE *stream,
} }
@end @end
@implementation NSString (GNU) /* We don't actually implement (GNU) Category, in order to avoid warning
about "unimplemented methods"; they come from the behavior. */
@implementation NSString (GNUCollection)
- objectAtIndex: (unsigned)index - objectAtIndex: (unsigned)index
{ {

View file

@ -25,6 +25,7 @@
#include <objects/TextCStream.h> #include <objects/TextCStream.h>
#include <objects/NSString.h> #include <objects/NSString.h>
#include <objects/StdioStream.h> #include <objects/StdioStream.h>
#include <Foundation/NSException.h>
#define DEFAULT_FORMAT_VERSION 0 #define DEFAULT_FORMAT_VERSION 0
@ -147,21 +148,24 @@ static BOOL debug_textcoder = NO;
break; break;
} }
case _C_PTR: case _C_PTR:
[self error:"Cannot encode pointers"]; [NSException raise: NSGenericException
format: @"Cannot encode pointers"];
break; break;
#if 0 /* No, don't know how far to recurse */ #if 0 /* No, don't know how far to recurse */
[self encodeValueOfObjCType:type+1 at:*(char**)d withName:name]; [self encodeValueOfObjCType:type+1 at:*(char**)d withName:name];
break; break;
#endif #endif
default: default:
[self error:"type %s not implemented", type]; [NSException raise: NSGenericException
format: @"type %s not implemented", type];
} }
} }
#define DECODER_FORMAT(TYPE, CONVERSION) \ #define DECODER_FORMAT(TYPE, CONVERSION) \
@" <%a[^>]> (" ATXSTR(TYPE) @") = %" ATXSTR(CONVERSION) @" \n" @" <%a[^>]> (" ATXSTR(TYPE) @") = %" ATXSTR(CONVERSION) @" \n"
#define DECODE_ERROR(TYPE) [self error:"bad format decoding " XSTR(TYPE)] #define DECODE_ERROR(TYPE) [NSException raise: NSGenericException \
format: @"bad format decoding " ATXSTR(TYPE)]
#define DECODE_DEBUG(TYPE, CONVERSION) \ #define DECODE_DEBUG(TYPE, CONVERSION) \
if (debug_textcoder) \ if (debug_textcoder) \
@ -299,7 +303,8 @@ if (debug_textcoder) \
break; break;
} }
case _C_PTR: case _C_PTR:
[self error:"Cannot decode pointers"]; [NSException raise: NSGenericException
format: @"Cannot decode pointers"];
break; break;
#if 0 /* No, don't know how far to recurse */ #if 0 /* No, don't know how far to recurse */
OBJC_MALLOC(*(void**)d, void*, 1); OBJC_MALLOC(*(void**)d, void*, 1);
@ -307,7 +312,8 @@ if (debug_textcoder) \
break; break;
#endif #endif
default: default:
[self error:"type %s not yet implemented", type]; [NSException raise: NSGenericException
format: @"type %s not yet implemented", type];
} }
if (namePtr) if (namePtr)
*namePtr = [NSString stringWithCStringNoCopy: tmpname]; *namePtr = [NSString stringWithCStringNoCopy: tmpname];
@ -339,7 +345,8 @@ if (debug_textcoder) \
lp = [line cStringNoCopy]; lp = [line cStringNoCopy];
while (*lp == ' ') lp++; while (*lp == ' ') lp++;
if (*lp != '{') if (*lp != '{')
[self error:"bad indent format, got \"%s\"", line]; [NSException raise: NSGenericException
format: @"bad indent format, got \"%s\"", line];
} }
- (void) decodeUnindent - (void) decodeUnindent
@ -351,7 +358,8 @@ if (debug_textcoder) \
lp = [line cStringNoCopy]; lp = [line cStringNoCopy];
while (*lp == ' ') lp++; while (*lp == ' ') lp++;
if (*lp != '}') if (*lp != '}')
[self error:"bad unindent format, got \"%s\"", line]; [NSException raise: NSGenericException
format: @"bad unindent format, got \"%s\"", line];
} }
- (void) encodeName: (id <String>) n - (void) encodeName: (id <String>) n
@ -368,7 +376,8 @@ if (debug_textcoder) \
if (name) if (name)
{ {
if ([stream readFormat: @" <%a[^>]> \n", &n] != 1) if ([stream readFormat: @" <%a[^>]> \n", &n] != 1)
[self error:"bad format"]; [NSException raise: NSGenericException
format: @"bad format"];
*name = [NSString stringWithCStringNoCopy: n *name = [NSString stringWithCStringNoCopy: n
freeWhenDone: YES]; freeWhenDone: YES];
if (debug_textcoder) if (debug_textcoder)

View file

@ -1,8 +1,8 @@
/* IndexedCollection definitions for the use of subclass implementations only /* IndexedCollection definitions for the use of subclass implementations only
Copyright (C) 1993,1994 Free Software Foundation, Inc. Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu> Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993 Created: May 1993
This file is part of the GNU Objective C Class Library. This file is part of the GNU Objective C Class Library.
@ -26,22 +26,16 @@
#include <objects/stdobjects.h> #include <objects/stdobjects.h>
#include <objects/CollectionPrivate.h> #include <objects/CollectionPrivate.h>
#include <Foundation/NSException.h>
#include <objects/NSString.h>
/* To be used inside a method for making sure that index /* To be used inside a method for making sure that index
is not above range. is not above range.
*/ */
#define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \ #define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \
({if (INDEX >= OVER) \ if (INDEX >= OVER) \
[self error:"in %s, index out of range", sel_get_name(_cmd)];}) [NSException raise: NSRangeException \
format: @"in %s, index %d is out of range", \
sel_get_name (_cmd), INDEX]
/* For use with subclasses of IndexedCollections that allow elements to
be added, but not added at particular indices---the collection itself
determines the order.
*/
#define INSERTION_ERROR() \
([self error:"in %s, this collection does not allow insertions", \
sel_get_name(aSel)];)
#endif /* __IndexedCollectionPrivate_h_INCLUDE_GNU */ #endif /* __IndexedCollectionPrivate_h_INCLUDE_GNU */