From 6a305f32b2e218608299b9c0dc5cbf8264a98ce5 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sun, 11 Aug 1996 22:27:09 -0400 Subject: [PATCH] Formatting changes. From-SVN: r12617 --- gcc/objc/archive.c | 24 ++++++++++++++++-------- gcc/objc/class.c | 3 ++- gcc/objc/objc.h | 8 ++++---- gcc/objc/sarray.c | 3 ++- gcc/objc/thr-decosf1.c | 3 ++- gcc/objc/thr-mach.c | 11 ++++++----- gcc/objc/thr-win32.c | 6 +++++- gcc/objc/thr.c | 4 ++-- 8 files changed, 39 insertions(+), 23 deletions(-) diff --git a/gcc/objc/archive.c b/gcc/objc/archive.c index e9bdcbd17f1..41196da5ae5 100644 --- a/gcc/objc/archive.c +++ b/gcc/objc/archive.c @@ -141,7 +141,8 @@ __objc_code_unsigned_short (unsigned char* buf, unsigned short val) } int -objc_write_unsigned_short (struct objc_typed_stream* stream, unsigned short value) +objc_write_unsigned_short (struct objc_typed_stream* stream, + unsigned short value) { unsigned char buf[sizeof (unsigned short)+1]; int len = __objc_code_unsigned_short (buf, value); @@ -252,7 +253,8 @@ __objc_code_unsigned_long (unsigned char* buf, unsigned long val) } int -objc_write_unsigned_long (struct objc_typed_stream* stream, unsigned long value) +objc_write_unsigned_long (struct objc_typed_stream* stream, + unsigned long value) { unsigned char buf[sizeof(unsigned long)+1]; int len = __objc_code_unsigned_long (buf, value); @@ -315,7 +317,8 @@ objc_write_string_atomic (struct objc_typed_stream* stream, } static int -objc_write_register_common (struct objc_typed_stream* stream, unsigned long key) +objc_write_register_common (struct objc_typed_stream* stream, + unsigned long key) { unsigned char buf[sizeof (unsigned long)+2]; int len = __objc_code_unsigned_long (buf+1, key); @@ -488,7 +491,8 @@ objc_write_selector (struct objc_typed_stream* stream, SEL selector) else { int length; - hash_add (&stream->stream_table, LONG2PTR(key=PTR2LONG(sel_name)), (char*)sel_name); + hash_add (&stream->stream_table, + LONG2PTR(key=PTR2LONG(sel_name)), (char*)sel_name); if ((length = objc_write_register_common (stream, key))) return __objc_write_selector (stream, selector); return length; @@ -840,8 +844,10 @@ objc_read_object (struct objc_typed_stream* stream, id* object) { struct objc_list* other; len = objc_read_unsigned_long (stream, &key); - other = (struct objc_list*)hash_value_for_key (stream->object_refs, LONG2PTR(key)); - hash_add (&stream->object_refs, LONG2PTR(key), (void*)list_cons(object, other)); + other = (struct objc_list*)hash_value_for_key (stream->object_refs, + LONG2PTR(key)); + hash_add (&stream->object_refs, LONG2PTR(key), + (void*)list_cons(object, other)); } else if (buf[0] == (_B_EXT | _BX_OBJROOT)) /* a root object */ @@ -948,7 +954,8 @@ objc_read_selector (struct objc_typed_stream* stream, SEL* selector) if (key) __objc_fatal("cannot register use upcode..."); len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key); - (*selector) = hash_value_for_key (stream->stream_table, LONG2PTR(key)); + (*selector) = hash_value_for_key (stream->stream_table, + LONG2PTR(key)); } else @@ -1019,7 +1026,8 @@ objc_write_type(TypedStream* stream, const char* type, const void* data) break; case _C_ATOM: - return objc_write_string_atomic (stream, *(char**)data, strlen(*(char**)data)); + return objc_write_string_atomic (stream, *(char**)data, + strlen(*(char**)data)); break; case _C_ARY_B: diff --git a/gcc/objc/class.c b/gcc/objc/class.c index 8058d09f928..ae7d2800dca 100644 --- a/gcc/objc/class.c +++ b/gcc/objc/class.c @@ -306,7 +306,8 @@ class_pose_as (Class impostor, Class super_class) if (CLS_ISCLASS (sub)) { /* meta classes */ - CLASSOF (sub)->sibling_class = CLASSOF (impostor)->subclass_list; + CLASSOF (sub)->sibling_class = + CLASSOF (impostor)->subclass_list; CLASSOF (sub)->super_class = CLASSOF (impostor); CLASSOF (impostor)->subclass_list = CLASSOF (sub); } diff --git a/gcc/objc/objc.h b/gcc/objc/objc.h index 979c5c81126..bdfa3c82eaf 100644 --- a/gcc/objc/objc.h +++ b/gcc/objc/objc.h @@ -1,5 +1,5 @@ /* Basic data types for Objective C. - Copyright (C) 1993, 1995 Free Software Foundation, Inc. + Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. This file is part of GNU CC. @@ -103,9 +103,9 @@ struct objc_class { unsigned long info; /* Bit mask. See class masks defined above. */ long instance_size; /* Size in bytes of the class. - The sum of the class definition - and all super class - definitions. */ + The sum of the class + definition and all super + class definitions. */ struct objc_ivar_list* ivars; /* Pointer to a structure that describes the instance variables in the class diff --git a/gcc/objc/sarray.c b/gcc/objc/sarray.c index 66bf06b6762..fec92b18a2b 100644 --- a/gcc/objc/sarray.c +++ b/gcc/objc/sarray.c @@ -174,7 +174,8 @@ sarray_at_put(struct sarray* array, sidx index, void* element) /* The bucket was previously empty (or something like that), */ /* allocate a new. This is the effect of `lazy' allocation */ new_bucket = (struct sbucket*)__objc_xmalloc(sizeof(struct sbucket)); - memcpy((void *) new_bucket, (const void*)array->empty_bucket, sizeof(struct sbucket)); + memcpy((void *) new_bucket, (const void*)array->empty_bucket, + sizeof(struct sbucket)); new_bucket->version.version = array->version.version; *the_bucket = new_bucket; /* Prepared for install. */ diff --git a/gcc/objc/thr-decosf1.c b/gcc/objc/thr-decosf1.c index 88fcba71ba1..69074a45d33 100644 --- a/gcc/objc/thr-decosf1.c +++ b/gcc/objc/thr-decosf1.c @@ -82,7 +82,8 @@ objc_thread_create(void (*func)(void *arg), void *arg) if (pthread_create(&new_thread_handle, pthread_attr_default, (void *)func, arg) == 0) { - thread_id = *(_objc_thread_t *)&new_thread_handle; /* ??? May not work! (64bit)*/ + /* ??? May not work! (64bit)*/ + thread_id = *(_objc_thread_t *)&new_thread_handle; pthread_detach(&new_thread_handle); /* Fully detach thread. */ __objc_runtime_threads_alive++; } diff --git a/gcc/objc/thr-mach.c b/gcc/objc/thr-mach.c index 10aedbaeda0..ad04a3db5e9 100644 --- a/gcc/objc/thr-mach.c +++ b/gcc/objc/thr-mach.c @@ -107,7 +107,8 @@ objc_thread_create(void (*func)(void *arg), void *arg) new_thread_handle = cthread_fork((cthread_fn_t)func, arg); if(new_thread_handle) { - thread_id = *(_objc_thread_t *)&new_thread_handle; /* this is not terribly portable */ + /* this is not terribly portable */ + thread_id = *(_objc_thread_t *)&new_thread_handle; cthread_detach(new_thread_handle); /* fully detach thread */ __objc_runtime_threads_alive++; /* increment thread count */ } @@ -122,10 +123,10 @@ objc_thread_create(void (*func)(void *arg), void *arg) int objc_thread_set_priority(int priority) { - _objc_thread_t *t = objc_thread_id(); - cthread_t cT = (cthread_t) t; /* see objc_thread_id() */ - int maxPriority = __mach_get_max_thread_priority(cT, NULL); - int sys_priority = 0; + _objc_thread_t *t = objc_thread_id(); + cthread_t cT = (cthread_t) t; + int maxPriority = __mach_get_max_thread_priority(cT, NULL); + int sys_priority = 0; if (maxPriority == -1) return -1; diff --git a/gcc/objc/thr-win32.c b/gcc/objc/thr-win32.c index f31ed630a77..4a846c8fb85 100644 --- a/gcc/objc/thr-win32.c +++ b/gcc/objc/thr-win32.c @@ -24,10 +24,14 @@ Boston, MA 02111-1307, USA. */ however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ -#include #include #include "runtime.h" +#ifndef __OBJC__ +#define __OBJC__ +#endif +#include + /******** * This structure represents a single mutual exclusion lock. Lock semantics * are detailed with the subsequent functions. We use whatever lock is diff --git a/gcc/objc/thr.c b/gcc/objc/thr.c index 524723339ca..4b8c2fc467d 100644 --- a/gcc/objc/thr.c +++ b/gcc/objc/thr.c @@ -27,10 +27,10 @@ Boston, MA 02111-1307, USA. */ #include #include "runtime.h" -/***************************************************************************** +/************************************************************************* * Universal static variables: */ -int __objc_thread_exit_status = 0; /* Global exit status. */ +int __objc_thread_exit_status = 0; /* Global exit status. */ /* Flag which lets us know if we ever became multi threaded */ int __objc_is_multi_threaded = 0;