mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Replace assert with NSAssert
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3248 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5a2bd37c96
commit
a3751eb7bf
31 changed files with 182 additions and 199 deletions
|
@ -51,7 +51,6 @@
|
|||
#include <config.h>
|
||||
#include <gnustep/base/preface.h>
|
||||
#include <gnustep/base/behavior.h>
|
||||
#include <assert.h>
|
||||
#include <Foundation/NSException.h>
|
||||
|
||||
static int behavior_debug = 0;
|
||||
|
@ -80,8 +79,8 @@ behavior_class_add_class (Class class, Class behavior)
|
|||
{
|
||||
Class behavior_super_class = class_get_super_class(behavior);
|
||||
|
||||
assert(CLS_ISCLASS(class));
|
||||
assert(CLS_ISCLASS(behavior));
|
||||
NSCAssert(CLS_ISCLASS(class), NSInvalidArgumentException);
|
||||
NSCAssert(CLS_ISCLASS(behavior), NSInvalidArgumentException);
|
||||
|
||||
__objc_send_initialize(class);
|
||||
__objc_send_initialize(behavior);
|
||||
|
@ -89,7 +88,7 @@ behavior_class_add_class (Class class, Class behavior)
|
|||
/* If necessary, increase instance_size of CLASS. */
|
||||
if (class->instance_size < behavior->instance_size)
|
||||
{
|
||||
NSCAssert (!class->subclass_list,
|
||||
NSCAssert(!class->subclass_list,
|
||||
@"The behavior-addition code wants to increase the\n"
|
||||
@"instance size of a class, but it cannot because you\n"
|
||||
@"have subclassed the class. There are two solutions:\n"
|
||||
|
@ -255,7 +254,7 @@ class_add_behavior_method_list (Class class, MethodList_t list)
|
|||
initialize_sel = sel_register_name ("initialize");
|
||||
|
||||
/* Passing of a linked list is not allowed. Do multiple calls. */
|
||||
assert (!list->method_next);
|
||||
NSCAssert(!list->method_next, NSInvalidArgumentException);
|
||||
|
||||
/* Check for duplicates. */
|
||||
for (i = 0; i < list->method_count; ++i)
|
||||
|
@ -327,8 +326,8 @@ search_for_method_in_list (MethodList_t list, SEL op)
|
|||
static void __objc_send_initialize(Class class)
|
||||
{
|
||||
/* This *must* be a class object */
|
||||
assert(CLS_ISCLASS(class));
|
||||
assert(!CLS_ISMETA(class));
|
||||
NSCAssert(CLS_ISCLASS(class), NSInvalidArgumentException);
|
||||
NSCAssert(!CLS_ISMETA(class), NSInvalidArgumentException);
|
||||
|
||||
if (!CLS_ISINITIALIZED(class))
|
||||
{
|
||||
|
@ -384,10 +383,6 @@ __objc_init_protocols (struct objc_protocol_list* protos)
|
|||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
assert (protos->next == 0); /* only single ones allowed */
|
||||
#endif
|
||||
|
||||
for(i = 0; i < protos->count; i++)
|
||||
{
|
||||
struct objc_protocol* aProto = protos->list[i];
|
||||
|
@ -450,7 +445,7 @@ check_class_methods(Class class)
|
|||
Method_t method = &(mlist->method_list[counter]);
|
||||
IMP imp = sarray_get(class->dtable,
|
||||
(size_t)method->method_name->sel_id);
|
||||
assert((imp == method->method_imp));
|
||||
NSCAssert((imp == method->method_imp), NSInvalidArgumentException);
|
||||
sarray_at_put_safe (class->dtable,
|
||||
(sidx) method->method_name->sel_id,
|
||||
method->method_imp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue