mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
9b7e65f4e0
commit
647f080875
10 changed files with 82 additions and 65 deletions
|
@ -1,8 +1,8 @@
|
|||
/* 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>
|
||||
Date: May 1993
|
||||
Created: May 1993
|
||||
|
||||
This file is part of the GNU Objective C Class Library.
|
||||
|
||||
|
@ -26,22 +26,16 @@
|
|||
|
||||
#include <objects/stdobjects.h>
|
||||
#include <objects/CollectionPrivate.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <objects/NSString.h>
|
||||
|
||||
/* To be used inside a method for making sure that index
|
||||
is not above range.
|
||||
*/
|
||||
#define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \
|
||||
({if (INDEX >= OVER) \
|
||||
[self error:"in %s, index out of range", sel_get_name(_cmd)];})
|
||||
|
||||
|
||||
/* 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)];)
|
||||
|
||||
if (INDEX >= OVER) \
|
||||
[NSException raise: NSRangeException \
|
||||
format: @"in %s, index %d is out of range", \
|
||||
sel_get_name (_cmd), INDEX]
|
||||
|
||||
#endif /* __IndexedCollectionPrivate_h_INCLUDE_GNU */
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <objects/NSString.h>
|
||||
#include <objects/StdioStream.h>
|
||||
#include <objects/TextCStream.h>
|
||||
#include <Foundation/NSException.h>
|
||||
|
||||
#define DEFAULT_FORMAT_VERSION 0
|
||||
|
||||
|
@ -276,7 +277,7 @@ static BOOL debug_binary_coder;
|
|||
&& !((encoded_type=='c' || encoded_type=='C')
|
||||
&& (*type=='c' || *type=='C')))
|
||||
[NSException raise: NSGenericException
|
||||
format @"Expected type \"%c\", got type \"%c\"",
|
||||
format: @"Expected type \"%c\", got type \"%c\"",
|
||||
*type, encoded_type];
|
||||
|
||||
switch (encoded_type)
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <objects/RunLoop.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSDate.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <assert.h>
|
||||
|
||||
@interface Connection (GettingCoderInterface)
|
||||
|
|
|
@ -578,7 +578,7 @@
|
|||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"can't decode forward reference when not decoding "
|
||||
"a root object"];
|
||||
@"a root object"];
|
||||
[self decodeValueOfCType: @encode(unsigned)
|
||||
at: &fref
|
||||
withName: NULL];
|
||||
|
@ -653,7 +653,7 @@
|
|||
if (!*anObjPtr)
|
||||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @ "repeated object cross-reference number %u not found",
|
||||
format: @"repeated object cross-reference number %u not found",
|
||||
xref];
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <objects/StdioStream.h>
|
||||
#include <objects/BinaryCStream.h>
|
||||
#include <Foundation/NSArchiver.h>
|
||||
#include <Foundation/NSException.h>
|
||||
|
||||
static int default_format_version;
|
||||
static id default_stream_class;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <objects/stdobjects.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <objects/objc-malloc.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <limits.h>
|
||||
|
||||
/* 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)
|
||||
[NSException raise: NSGenericException
|
||||
format: @"AutoreleasePool count threshhold exceeded."];
|
||||
format: @"AutoreleasePool count threshhold exceeded."];
|
||||
|
||||
if (released_count == released_size)
|
||||
{
|
||||
|
@ -126,7 +127,7 @@ format: @"AutoreleasePool count threshhold exceeded."];
|
|||
- (id) retain
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"Don't call `-retain' on a NSAutoreleasePool"];
|
||||
format: @"Don't call `-retain' on a NSAutoreleasePool"];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSMapTable.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <limits.h>
|
||||
|
||||
extern void (*_objc_error)(id object, const char *format, va_list);
|
||||
|
@ -304,7 +305,7 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
|
|||
[NSException
|
||||
raise: NSGenericException
|
||||
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];
|
||||
|
@ -355,9 +356,12 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
|
|||
{
|
||||
IMP msg = objc_msg_lookup(self, aSelector);
|
||||
if (!msg)
|
||||
return [NSException
|
||||
raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
|
||||
{
|
||||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector);
|
||||
}
|
||||
|
||||
|
@ -365,9 +369,12 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
|
|||
{
|
||||
IMP msg = objc_msg_lookup(self, aSelector);
|
||||
if (!msg)
|
||||
return [NSException
|
||||
raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
|
||||
{
|
||||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector, anObject);
|
||||
}
|
||||
|
||||
|
@ -375,9 +382,12 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
|
|||
{
|
||||
IMP msg = objc_msg_lookup(self, aSelector);
|
||||
if (!msg)
|
||||
return [NSException
|
||||
raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
|
||||
{
|
||||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector, object1, object2);
|
||||
}
|
||||
|
||||
|
@ -545,16 +555,18 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
|
|||
|
||||
- notImplemented:(SEL)aSel
|
||||
{
|
||||
return [NSException
|
||||
raise: NSGenericException
|
||||
format: @"method %s not implemented", sel_get_name(aSel)];
|
||||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"method %s not implemented", sel_get_name(aSel)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- doesNotRecognize:(SEL)aSel
|
||||
{
|
||||
return [NSException raise: NSGenericException
|
||||
format: @"%s does not recognize %s",
|
||||
object_get_class_name(self), sel_get_name(aSel)];
|
||||
[NSException raise: NSGenericException
|
||||
format: @"%s does not recognize %s",
|
||||
object_get_class_name(self), sel_get_name(aSel)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- perform: (SEL)sel with: anObject
|
||||
|
@ -651,17 +663,19 @@ BOOL NSDecrementExtraRefCountWasZero (id anObject)
|
|||
|
||||
- subclassResponsibility:(SEL)aSel
|
||||
{
|
||||
return [NSException
|
||||
raise: NSGenericException
|
||||
format: @"subclass should override %s", sel_get_name(aSel)];
|
||||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"subclass should override %s", sel_get_name(aSel)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- shouldNotImplement:(SEL)aSel
|
||||
{
|
||||
return [NSException
|
||||
raise: NSGenericException
|
||||
format: @"%s should not implement %s",
|
||||
object_get_class_name(self), sel_get_name(aSel)];
|
||||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"%s should not implement %s",
|
||||
object_get_class_name(self), sel_get_name(aSel)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (int)streamVersion: (TypedStream*)aStream
|
||||
|
|
|
@ -966,7 +966,9 @@ handle_printf_atsign (FILE *stream,
|
|||
}
|
||||
@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
|
||||
{
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <objects/TextCStream.h>
|
||||
#include <objects/NSString.h>
|
||||
#include <objects/StdioStream.h>
|
||||
#include <Foundation/NSException.h>
|
||||
|
||||
#define DEFAULT_FORMAT_VERSION 0
|
||||
|
||||
|
@ -147,21 +148,24 @@ static BOOL debug_textcoder = NO;
|
|||
break;
|
||||
}
|
||||
case _C_PTR:
|
||||
[self error:"Cannot encode pointers"];
|
||||
[NSException raise: NSGenericException
|
||||
format: @"Cannot encode pointers"];
|
||||
break;
|
||||
#if 0 /* No, don't know how far to recurse */
|
||||
[self encodeValueOfObjCType:type+1 at:*(char**)d withName:name];
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
[self error:"type %s not implemented", type];
|
||||
[NSException raise: NSGenericException
|
||||
format: @"type %s not implemented", type];
|
||||
}
|
||||
}
|
||||
|
||||
#define DECODER_FORMAT(TYPE, CONVERSION) \
|
||||
@" <%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) \
|
||||
if (debug_textcoder) \
|
||||
|
@ -299,7 +303,8 @@ if (debug_textcoder) \
|
|||
break;
|
||||
}
|
||||
case _C_PTR:
|
||||
[self error:"Cannot decode pointers"];
|
||||
[NSException raise: NSGenericException
|
||||
format: @"Cannot decode pointers"];
|
||||
break;
|
||||
#if 0 /* No, don't know how far to recurse */
|
||||
OBJC_MALLOC(*(void**)d, void*, 1);
|
||||
|
@ -307,7 +312,8 @@ if (debug_textcoder) \
|
|||
break;
|
||||
#endif
|
||||
default:
|
||||
[self error:"type %s not yet implemented", type];
|
||||
[NSException raise: NSGenericException
|
||||
format: @"type %s not yet implemented", type];
|
||||
}
|
||||
if (namePtr)
|
||||
*namePtr = [NSString stringWithCStringNoCopy: tmpname];
|
||||
|
@ -339,7 +345,8 @@ if (debug_textcoder) \
|
|||
lp = [line cStringNoCopy];
|
||||
while (*lp == ' ') lp++;
|
||||
if (*lp != '{')
|
||||
[self error:"bad indent format, got \"%s\"", line];
|
||||
[NSException raise: NSGenericException
|
||||
format: @"bad indent format, got \"%s\"", line];
|
||||
}
|
||||
|
||||
- (void) decodeUnindent
|
||||
|
@ -351,7 +358,8 @@ if (debug_textcoder) \
|
|||
lp = [line cStringNoCopy];
|
||||
while (*lp == ' ') 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
|
||||
|
@ -368,7 +376,8 @@ if (debug_textcoder) \
|
|||
if (name)
|
||||
{
|
||||
if ([stream readFormat: @" <%a[^>]> \n", &n] != 1)
|
||||
[self error:"bad format"];
|
||||
[NSException raise: NSGenericException
|
||||
format: @"bad format"];
|
||||
*name = [NSString stringWithCStringNoCopy: n
|
||||
freeWhenDone: YES];
|
||||
if (debug_textcoder)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* 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>
|
||||
Date: May 1993
|
||||
Created: May 1993
|
||||
|
||||
This file is part of the GNU Objective C Class Library.
|
||||
|
||||
|
@ -26,22 +26,16 @@
|
|||
|
||||
#include <objects/stdobjects.h>
|
||||
#include <objects/CollectionPrivate.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <objects/NSString.h>
|
||||
|
||||
/* To be used inside a method for making sure that index
|
||||
is not above range.
|
||||
*/
|
||||
#define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \
|
||||
({if (INDEX >= OVER) \
|
||||
[self error:"in %s, index out of range", sel_get_name(_cmd)];})
|
||||
|
||||
|
||||
/* 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)];)
|
||||
|
||||
if (INDEX >= OVER) \
|
||||
[NSException raise: NSRangeException \
|
||||
format: @"in %s, index %d is out of range", \
|
||||
sel_get_name (_cmd), INDEX]
|
||||
|
||||
#endif /* __IndexedCollectionPrivate_h_INCLUDE_GNU */
|
||||
|
|
Loading…
Reference in a new issue