Made NSAllocateObject() and NSDeallocateObject() use / take id instead of NSObject*. This matches Apple's definition and gets rid of 'assignment / initialization from distinct Objective-C type' warnings when you use NSAllocateObject() to create an instance without an explicit cast.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29611 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2010-02-13 17:33:23 +00:00
parent 62af07dc29
commit d0b66e510d
2 changed files with 6 additions and 6 deletions

View file

@ -298,7 +298,7 @@ extern "C" {
* instance variables of the object.<br /> * instance variables of the object.<br />
* This function is used by the [NSObject+allocWithZone:] method. * This function is used by the [NSObject+allocWithZone:] method.
*/ */
GS_EXPORT NSObject * GS_EXPORT id
NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
/** /**
@ -306,7 +306,7 @@ NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
* This function is used by the [NSObject-dealloc] method. * This function is used by the [NSObject-dealloc] method.
*/ */
GS_EXPORT void GS_EXPORT void
NSDeallocateObject(NSObject *anObject); NSDeallocateObject(id anObject);
/** /**
* Used to copy anObject. This makes a bitwise copy of anObject to * Used to copy anObject. This makes a bitwise copy of anObject to

View file

@ -555,7 +555,7 @@ GSIsFinalizable(Class c)
return NO; return NO;
} }
inline NSObject * inline id
NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone) NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone)
{ {
id new; id new;
@ -601,7 +601,7 @@ NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone)
} }
inline void inline void
NSDeallocateObject(NSObject *anObject) NSDeallocateObject(id anObject)
{ {
} }
@ -615,7 +615,7 @@ GSObjCZone(NSObject *object)
return ((obj)object)[-1].zone; return ((obj)object)[-1].zone;
} }
inline NSObject * inline id
NSAllocateObject (Class aClass, NSUInteger extraBytes, NSZone *zone) NSAllocateObject (Class aClass, NSUInteger extraBytes, NSZone *zone)
{ {
id new; id new;
@ -640,7 +640,7 @@ NSAllocateObject (Class aClass, NSUInteger extraBytes, NSZone *zone)
} }
inline void inline void
NSDeallocateObject(NSObject *anObject) NSDeallocateObject(id anObject)
{ {
if ((anObject!=nil) && CLS_ISCLASS(((id)anObject)->class_pointer)) if ((anObject!=nil) && CLS_ISCLASS(((id)anObject)->class_pointer))
{ {