diff --git a/ChangeLog b/ChangeLog index 2676f07ad..1b2acc853 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ -2003-06-06 David Ayers +2003-06-07 David Ayers + + * Headers/gnustep/base/GSObjCRuntime.h + * Source/Additions/GSObjCRuntime.m : White space patch to better + conform with GNU coding standards and improve readability. + +2003-06-06 David Ayers * Source/GSArray.m: Change syntax of include <> to "" for local headers. Change base/ to gnustep/base/ in includes. diff --git a/Headers/gnustep/base/GSObjCRuntime.h b/Headers/gnustep/base/GSObjCRuntime.h index ed966c256..74de8b311 100644 --- a/Headers/gnustep/base/GSObjCRuntime.h +++ b/Headers/gnustep/base/GSObjCRuntime.h @@ -73,44 +73,64 @@ * Get the type encoding for a named ivar, * and copy a value into an ivar. */ -GS_EXPORT BOOL GSObjCFindVariable(id obj, const char *name, - const char **type, unsigned int *size, int *offset); -GS_EXPORT void GSObjCGetVariable(id obj, int offset, unsigned int size, - void *data); -GS_EXPORT void GSObjCSetVariable(id obj, int offset, unsigned int size, - const void *data); -GS_EXPORT NSArray* GSObjCMethodNames(id obj); -GS_EXPORT NSArray* GSObjCVariableNames(id obj); +GS_EXPORT BOOL +GSObjCFindVariable(id obj, const char *name, + const char **type, unsigned int *size, int *offset); -GS_EXPORT void GSObjCAddClassBehavior(Class receiver, Class behavior); +GS_EXPORT void +GSObjCGetVariable(id obj, int offset, unsigned int size, void *data); -GS_EXPORT NSValue* +GS_EXPORT void +GSObjCSetVariable(id obj, int offset, unsigned int size, const void *data); + +GS_EXPORT NSArray * +GSObjCMethodNames(id obj); + +GS_EXPORT NSArray * +GSObjCVariableNames(id obj); + +GS_EXPORT void +GSObjCAddClassBehavior(Class receiver, Class behavior); + +GS_EXPORT NSValue * GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars); -GS_EXPORT void GSObjCAddClasses(NSArray *classes); + +GS_EXPORT void +GSObjCAddClasses(NSArray *classes); /* * Functions for key-value encoding ... they access values in an object * either by selector or directly, but do so using NSNumber for the * scalar types of data. */ -GS_EXPORT id GSObjCGetValue(NSObject *self, NSString *key, SEL sel, - const char *type, unsigned size, int offset); -GS_EXPORT void GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel, - const char *type, unsigned size, int offset); +GS_EXPORT id +GSObjCGetValue(NSObject *self, NSString *key, SEL sel, + const char *type, unsigned size, int offset); + +GS_EXPORT void +GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel, + const char *type, unsigned size, int offset); /* * The next five are old (deprecated) names for the same thing. */ -GS_EXPORT BOOL GSFindInstanceVariable(id obj, const char *name, - const char **type, unsigned int *size, int *offset); -GS_EXPORT void GSGetVariable(id obj, int offset, unsigned int size, - void *data); -GS_EXPORT void GSSetVariable(id obj, int offset, unsigned int size, - const void *data); -GS_EXPORT id GSGetValue(NSObject *self, NSString *key, SEL sel, - const char *type, unsigned size, int offset); -GS_EXPORT void GSSetValue(NSObject *self, NSString *key, id val, SEL sel, - const char *type, unsigned size, int offset); +GS_EXPORT BOOL +GSFindInstanceVariable(id obj, const char *name, + const char **type, unsigned int *size, int *offset); + +GS_EXPORT void +GSGetVariable(id obj, int offset, unsigned int size, void *data); + +GS_EXPORT void +GSSetVariable(id obj, int offset, unsigned int size, const void *data); + +GS_EXPORT id +GSGetValue(NSObject *self, NSString *key, SEL sel, + const char *type, unsigned size, int offset); + +GS_EXPORT void +GSSetValue(NSObject *self, NSString *key, id val, SEL sel, + const char *type, unsigned size, int offset); #include @@ -197,7 +217,7 @@ GSClassFromName(const char *name) * Return the name of the supplied class, or a nul pointer if no class * was supplied. */ -GS_STATIC_INLINE const char* +GS_STATIC_INLINE const char * GSNameFromClass(Class this) { if (this == 0) @@ -209,7 +229,7 @@ GSNameFromClass(Class this) * Return the name of the supplied selector, or a nul pointer if no selector * was supplied. */ -GS_STATIC_INLINE const char* +GS_STATIC_INLINE const char * GSNameFromSelector(SEL this) { if (this == 0) @@ -250,7 +270,7 @@ GSSelectorFromNameAndTypes(const char *name, const char *types) } else { - SEL s; + SEL s; if (types == 0) { @@ -281,7 +301,7 @@ GSSelectorFromNameAndTypes(const char *name, const char *types) * May return a nul pointer if the selector was a nul pointer or if it * was not typed. */ -GS_STATIC_INLINE const char* +GS_STATIC_INLINE const char * GSTypesFromSelector(SEL this) { if (this == 0) @@ -311,15 +331,18 @@ GSObjCVersion(Class this) #include #endif -GS_EXPORT NSZone *GSObjCZone(NSObject *obj); +GS_EXPORT NSZone * +GSObjCZone(NSObject *obj); /** * Quickly return autoreleased data storage area. */ -GS_EXPORT void *GSAutoreleasedBuffer(unsigned size); +GS_EXPORT void * +GSAutoreleasedBuffer(unsigned size); /* Getting a system error message on a variety of systems */ -GS_EXPORT const char *GSLastErrorStr(long error_id); +GS_EXPORT const char * +GSLastErrorStr(long error_id); diff --git a/Source/Additions/GSObjCRuntime.m b/Source/Additions/GSObjCRuntime.m index 35968ec42..21432c34c 100644 --- a/Source/Additions/GSObjCRuntime.m +++ b/Source/Additions/GSObjCRuntime.m @@ -53,7 +53,7 @@ /** Deprecated ... use GSObjCFindVariable() */ BOOL GSFindInstanceVariable(id obj, const char *name, - const char **type, unsigned int *size, int *offset) + const char **type, unsigned int *size, int *offset) { return GSObjCFindVariable(obj, name, type, size, offset); } @@ -67,7 +67,7 @@ GSFindInstanceVariable(id obj, const char *name, */ BOOL GSObjCFindVariable(id obj, const char *name, - const char **type, unsigned int *size, int *offset) + const char **type, unsigned int *size, int *offset) { Class class; struct objc_ivar_list *ivars; @@ -114,7 +114,7 @@ GSObjCFindVariable(id obj, const char *name, * If obj is a class, this returns the class methods.
* Returns nil if obj is nil. */ -NSArray* +NSArray * GSObjCMethodNames(id obj) { NSMutableSet *set; @@ -190,7 +190,7 @@ GSObjCMethodNames(id obj) * belong to the class of obj or one of its superclasses.
* Returns nil if obj is nil. */ -NSArray* +NSArray * GSObjCVariableNames(id obj) { NSMutableArray *array; @@ -283,7 +283,7 @@ ObjcRuntimeUtilities.m by Nicola Pero *

The iVars dictionary lists the instance variable names and their types. *

*/ -NSValue* +NSValue * GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars) { Class newClass; @@ -838,7 +838,7 @@ GSObjCAddClassBehavior(Class receiver, Class behavior) /** Deprecated ... use GSObjCGetValue() */ id GSGetValue(NSObject *self, NSString *key, SEL sel, - const char *type, unsigned size, int offset) + const char *type, unsigned size, int offset) { return GSObjCGetValue(self, key, sel, type, size, offset); } @@ -854,7 +854,7 @@ GSGetValue(NSObject *self, NSString *key, SEL sel, */ id GSObjCGetValue(NSObject *self, NSString *key, SEL sel, - const char *type, unsigned size, int offset) + const char *type, unsigned size, int offset) { if (sel != 0) { @@ -1155,7 +1155,7 @@ GSObjCGetValue(NSObject *self, NSString *key, SEL sel, /** Deprecated ... use GSObjCSetValue() */ void GSSetValue(NSObject *self, NSString *key, id val, SEL sel, - const char *type, unsigned size, int offset) + const char *type, unsigned size, int offset) { GSObjCSetValue(self, key, val, sel, type, size, offset); } @@ -1171,7 +1171,7 @@ GSSetValue(NSObject *self, NSString *key, id val, SEL sel, */ void GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel, - const char *type, unsigned size, int offset) + const char *type, unsigned size, int offset) { static NSNull *null = nil; @@ -1535,10 +1535,10 @@ LPTSTR GetErrorMsg(DWORD msgId) } #else #ifndef HAVE_STRERROR -const char* +const char * strerror(int eno) { - extern char* sys_errlist[]; + extern char *sys_errlist[]; extern int sys_nerr; if (eno < 0 || eno >= sys_nerr)