Index: src/OFExceptions.h ================================================================== --- src/OFExceptions.h +++ src/OFExceptions.h @@ -20,11 +20,11 @@ } + newWithObject: (id)obj; - initWithObject: (id)obj; - free; -- (void)raise; +- raise; - (char*)string; @end @interface OFNoMemException: OFException + newWithObject: (id)obj Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -48,13 +48,14 @@ free(errstr); return [super free]; } -- (void)raise +- raise { @throw self; + return self; } - (char*)string { return errstr; Index: src/OFList.h ================================================================== --- src/OFList.h +++ src/OFList.h @@ -21,8 +21,8 @@ - init; - free; - freeIncludingData; - (OFListObject*)first; - (OFListObject*)last; -- (void)add: (OFListObject*)ptr; -- (void)addNew: (void*)ptr; +- add: (OFListObject*)ptr; +- addNew: (void*)ptr; @end Index: src/OFList.m ================================================================== --- src/OFList.m +++ src/OFList.m @@ -56,23 +56,25 @@ - (OFListObject*)last { return last; } -- (void)add: (OFListObject*)ptr +- add: (OFListObject*)ptr { if (!first || !last) { first = last = ptr; - return; + return self; } [ptr setPrev: last]; [last setNext: ptr]; last = ptr; + + return self; } -- (void)addNew: (void*)ptr +- addNew: (void*)ptr { return [self add: [OFListObject newWithData: ptr]]; } @end Index: src/OFListObject.h ================================================================== --- src/OFListObject.h +++ src/OFListObject.h @@ -22,8 +22,8 @@ - initWithData: (void*)ptr; - freeIncludingData; - (void*)data; - (OFListObject*)next; - (OFListObject*)prev; -- (void)setNext: (OFListObject*)ptr; -- (void)setPrev: (OFListObject*)ptr; +- setNext: (OFListObject*)ptr; +- setPrev: (OFListObject*)ptr; @end Index: src/OFListObject.m ================================================================== --- src/OFListObject.m +++ src/OFListObject.m @@ -50,15 +50,17 @@ - (OFListObject*)prev { return prev; } -- (void)setNext: (OFListObject*)ptr +- setNext: (OFListObject*)ptr { next = ptr; + return self; } -- (void)setPrev: (OFListObject*)ptr +- setPrev: (OFListObject*)ptr { prev = ptr; + return self; } @end Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -24,8 +24,8 @@ - init; - (void*)getMemWithSize: (size_t)size; - (void*)resizeMem: (void*)ptr toSize: (size_t)size; -- (void)freeMem: (void*)ptr; +- freeMem: (void*)ptr; - free; @end Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -96,11 +96,11 @@ [[OFMemNotPartOfObjException newWithObject: self andPointer: ptr] raise]; return NULL; } -- (void)freeMem: (void*)ptr; +- freeMem: (void*)ptr; { struct __ofobject_allocated_mem *iter; for (iter = __mem_pool; iter != NULL; iter = iter->prev) { if (iter->ptr == ptr) { @@ -112,13 +112,15 @@ __mem_pool = NULL; free(iter); free(ptr); - return; + return self; } } [[OFMemNotPartOfObjException newWithObject: self andPointer: ptr] raise]; + + return self; } @end