summaryrefslogtreecommitdiffstats
path: root/contrib/libobjc/objects.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2003-07-11 03:42:15 +0000
committerkan <kan@FreeBSD.org>2003-07-11 03:42:15 +0000
commitaa78059bdb419f0b5779c9b913f71eea20a91f56 (patch)
tree953ce97c9d9579d746dabf67ba0d0cc2392807cf /contrib/libobjc/objects.c
parent97107edf1b21ad937d45122d6977fa4787fef97a (diff)
parentbb754981e6f83bc1f224dc4b7f478d80024e6c9f (diff)
downloadFreeBSD-src-aa78059bdb419f0b5779c9b913f71eea20a91f56.zip
FreeBSD-src-aa78059bdb419f0b5779c9b913f71eea20a91f56.tar.gz
This commit was generated by cvs2svn to compensate for changes in r117399,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/libobjc/objects.c')
-rw-r--r--contrib/libobjc/objects.c56
1 files changed, 27 insertions, 29 deletions
diff --git a/contrib/libobjc/objects.c b/contrib/libobjc/objects.c
index df74b85..6858fed 100644
--- a/contrib/libobjc/objects.c
+++ b/contrib/libobjc/objects.c
@@ -32,29 +32,29 @@ Boston, MA 02111-1307, USA. */
# include <gc.h>
#endif
-id __objc_object_alloc(Class);
-id __objc_object_dispose(id);
-id __objc_object_copy(id);
+id __objc_object_alloc (Class);
+id __objc_object_dispose (id);
+id __objc_object_copy (id);
-id (*_objc_object_alloc)(Class) = __objc_object_alloc; /* !T:SINGLE */
-id (*_objc_object_dispose)(id) = __objc_object_dispose; /* !T:SINGLE */
-id (*_objc_object_copy)(id) = __objc_object_copy; /* !T:SINGLE */
+id (*_objc_object_alloc) (Class) = __objc_object_alloc; /* !T:SINGLE */
+id (*_objc_object_dispose) (id) = __objc_object_dispose; /* !T:SINGLE */
+id (*_objc_object_copy) (id) = __objc_object_copy; /* !T:SINGLE */
id
-class_create_instance(Class class)
+class_create_instance (Class class)
{
id new = nil;
#if OBJC_WITH_GC
- if (CLS_ISCLASS(class))
- new = (id)GC_malloc_explicitly_typed (class->instance_size,
- class->gc_object_type);
+ if (CLS_ISCLASS (class))
+ new = (id) GC_malloc_explicitly_typed (class->instance_size,
+ class->gc_object_type);
#else
- if (CLS_ISCLASS(class))
- new = (*_objc_object_alloc)(class);
+ if (CLS_ISCLASS (class))
+ new = (*_objc_object_alloc) (class);
#endif
- if (new!=nil)
+ if (new != nil)
{
memset (new, 0, class->instance_size);
new->class_pointer = class;
@@ -63,43 +63,41 @@ class_create_instance(Class class)
}
id
-object_copy(id object)
+object_copy (id object)
{
- if ((object!=nil)&&CLS_ISCLASS(object->class_pointer))
- return (*_objc_object_copy)(object);
+ if ((object != nil) && CLS_ISCLASS (object->class_pointer))
+ return (*_objc_object_copy) (object);
else
return nil;
}
id
-object_dispose(id object)
+object_dispose (id object)
{
- if ((object!=nil)&&CLS_ISCLASS(object->class_pointer))
+ if ((object != nil) && CLS_ISCLASS (object->class_pointer))
{
if (_objc_object_dispose)
- (*_objc_object_dispose)(object);
+ (*_objc_object_dispose) (object);
else
- objc_free(object);
+ objc_free (object);
}
return nil;
}
-id __objc_object_alloc(Class class)
+id __objc_object_alloc (Class class)
{
- return (id)objc_malloc(class->instance_size);
+ return (id) objc_malloc (class->instance_size);
}
-id __objc_object_dispose(id object)
+id __objc_object_dispose (id object)
{
- objc_free(object);
+ objc_free (object);
return 0;
}
-id __objc_object_copy(id object)
+id __objc_object_copy (id object)
{
- id copy = class_create_instance(object->class_pointer);
- memcpy(copy, object, object->class_pointer->instance_size);
+ id copy = class_create_instance (object->class_pointer);
+ memcpy (copy, object, object->class_pointer->instance_size);
return copy;
}
-
-
OpenPOWER on IntegriCloud