Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -85,11 +85,11 @@ + (Class)class; /** * \return The name of the class as a C string */ -+ (const char*)className; ++ (OFString*)className; /** * \param class_ The class which is checked for being a superclass * \return A boolean whether the class class is a subclass of the specified * class @@ -193,13 +193,13 @@ * \return The class of the object */ - (Class)class; /** - * \return The name of the object's class as a C string + * \return The name of the object's class. */ -- (const char*)className; +- (OFString*)className; /** * \param class_ The class whose kind is checked * \return A boolean whether the object is of the specified kind */ Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -163,13 +163,13 @@ + (Class)class { return self; } -+ (const char*)className ++ (OFString*)className { - return class_getName(self); + return [OFString stringWithCString: class_getName(self)]; } + (BOOL)isSubclassOfClass: (Class)class { Class iter; @@ -263,11 +263,11 @@ #endif } + (OFString*)description { - return [OFString stringWithCString: [self className]]; + return [self className]; } + (IMP)setImplementation: (IMP)newimp forClassMethod: (SEL)selector { @@ -394,16 +394,16 @@ - (Class)class { return isa; } -- (const char*)className +- (OFString*)className { #ifdef OF_GNU_RUNTIME - return object_get_class_name(self); + return [OFString stringWithCString: object_get_class_name(self)]; #else - return class_getName(isa); + return [OFString stringWithCString: class_getName(isa)]; #endif } - (BOOL)isKindOfClass: (Class)class { @@ -487,11 +487,12 @@ } - (OFString*)description { /* Classes containing data should reimplement this! */ - return [OFString stringWithFormat: @"<%s: %p>", [self className], self]; + return [OFString stringWithFormat: @"<%s: %p>", + [[self className] cString], self]; } - (void)addMemoryToPool: (void*)ptr { void **memchunks;