Commit 6a305f32 by Richard Kenner

Formatting changes.

From-SVN: r12617
parent 2a7c93ee
...@@ -141,7 +141,8 @@ __objc_code_unsigned_short (unsigned char* buf, unsigned short val) ...@@ -141,7 +141,8 @@ __objc_code_unsigned_short (unsigned char* buf, unsigned short val)
} }
int 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]; unsigned char buf[sizeof (unsigned short)+1];
int len = __objc_code_unsigned_short (buf, value); int len = __objc_code_unsigned_short (buf, value);
...@@ -252,7 +253,8 @@ __objc_code_unsigned_long (unsigned char* buf, unsigned long val) ...@@ -252,7 +253,8 @@ __objc_code_unsigned_long (unsigned char* buf, unsigned long val)
} }
int 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]; unsigned char buf[sizeof(unsigned long)+1];
int len = __objc_code_unsigned_long (buf, value); int len = __objc_code_unsigned_long (buf, value);
...@@ -315,7 +317,8 @@ objc_write_string_atomic (struct objc_typed_stream* stream, ...@@ -315,7 +317,8 @@ objc_write_string_atomic (struct objc_typed_stream* stream,
} }
static int 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]; unsigned char buf[sizeof (unsigned long)+2];
int len = __objc_code_unsigned_long (buf+1, key); int len = __objc_code_unsigned_long (buf+1, key);
...@@ -488,7 +491,8 @@ objc_write_selector (struct objc_typed_stream* stream, SEL selector) ...@@ -488,7 +491,8 @@ objc_write_selector (struct objc_typed_stream* stream, SEL selector)
else else
{ {
int length; 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))) if ((length = objc_write_register_common (stream, key)))
return __objc_write_selector (stream, selector); return __objc_write_selector (stream, selector);
return length; return length;
...@@ -840,8 +844,10 @@ objc_read_object (struct objc_typed_stream* stream, id* object) ...@@ -840,8 +844,10 @@ objc_read_object (struct objc_typed_stream* stream, id* object)
{ {
struct objc_list* other; struct objc_list* other;
len = objc_read_unsigned_long (stream, &key); len = objc_read_unsigned_long (stream, &key);
other = (struct objc_list*)hash_value_for_key (stream->object_refs, LONG2PTR(key)); other = (struct objc_list*)hash_value_for_key (stream->object_refs,
hash_add (&stream->object_refs, LONG2PTR(key), (void*)list_cons(object, other)); 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 */ 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) ...@@ -948,7 +954,8 @@ objc_read_selector (struct objc_typed_stream* stream, SEL* selector)
if (key) if (key)
__objc_fatal("cannot register use upcode..."); __objc_fatal("cannot register use upcode...");
len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key); 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 else
...@@ -1019,7 +1026,8 @@ objc_write_type(TypedStream* stream, const char* type, const void* data) ...@@ -1019,7 +1026,8 @@ objc_write_type(TypedStream* stream, const char* type, const void* data)
break; break;
case _C_ATOM: 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; break;
case _C_ARY_B: case _C_ARY_B:
......
...@@ -306,7 +306,8 @@ class_pose_as (Class impostor, Class super_class) ...@@ -306,7 +306,8 @@ class_pose_as (Class impostor, Class super_class)
if (CLS_ISCLASS (sub)) if (CLS_ISCLASS (sub))
{ {
/* meta classes */ /* 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 (sub)->super_class = CLASSOF (impostor);
CLASSOF (impostor)->subclass_list = CLASSOF (sub); CLASSOF (impostor)->subclass_list = CLASSOF (sub);
} }
......
/* Basic data types for Objective C. /* 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. This file is part of GNU CC.
...@@ -103,9 +103,9 @@ struct objc_class { ...@@ -103,9 +103,9 @@ struct objc_class {
unsigned long info; /* Bit mask. See class masks unsigned long info; /* Bit mask. See class masks
defined above. */ defined above. */
long instance_size; /* Size in bytes of the class. long instance_size; /* Size in bytes of the class.
The sum of the class definition The sum of the class
and all super class definition and all super
definitions. */ class definitions. */
struct objc_ivar_list* ivars; /* Pointer to a structure that struct objc_ivar_list* ivars; /* Pointer to a structure that
describes the instance describes the instance
variables in the class variables in the class
......
...@@ -174,7 +174,8 @@ sarray_at_put(struct sarray* array, sidx index, void* element) ...@@ -174,7 +174,8 @@ sarray_at_put(struct sarray* array, sidx index, void* element)
/* The bucket was previously empty (or something like that), */ /* The bucket was previously empty (or something like that), */
/* allocate a new. This is the effect of `lazy' allocation */ /* allocate a new. This is the effect of `lazy' allocation */
new_bucket = (struct sbucket*)__objc_xmalloc(sizeof(struct sbucket)); 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; new_bucket->version.version = array->version.version;
*the_bucket = new_bucket; /* Prepared for install. */ *the_bucket = new_bucket; /* Prepared for install. */
......
...@@ -82,7 +82,8 @@ objc_thread_create(void (*func)(void *arg), void *arg) ...@@ -82,7 +82,8 @@ objc_thread_create(void (*func)(void *arg), void *arg)
if (pthread_create(&new_thread_handle, pthread_attr_default, if (pthread_create(&new_thread_handle, pthread_attr_default,
(void *)func, arg) == 0) { (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. */ pthread_detach(&new_thread_handle); /* Fully detach thread. */
__objc_runtime_threads_alive++; __objc_runtime_threads_alive++;
} }
......
...@@ -107,7 +107,8 @@ objc_thread_create(void (*func)(void *arg), void *arg) ...@@ -107,7 +107,8 @@ objc_thread_create(void (*func)(void *arg), void *arg)
new_thread_handle = cthread_fork((cthread_fn_t)func, arg); new_thread_handle = cthread_fork((cthread_fn_t)func, arg);
if(new_thread_handle) { 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 */ cthread_detach(new_thread_handle); /* fully detach thread */
__objc_runtime_threads_alive++; /* increment thread count */ __objc_runtime_threads_alive++; /* increment thread count */
} }
...@@ -123,7 +124,7 @@ int ...@@ -123,7 +124,7 @@ int
objc_thread_set_priority(int priority) objc_thread_set_priority(int priority)
{ {
_objc_thread_t *t = objc_thread_id(); _objc_thread_t *t = objc_thread_id();
cthread_t cT = (cthread_t) t; /* see objc_thread_id() */ cthread_t cT = (cthread_t) t;
int maxPriority = __mach_get_max_thread_priority(cT, NULL); int maxPriority = __mach_get_max_thread_priority(cT, NULL);
int sys_priority = 0; int sys_priority = 0;
......
...@@ -24,10 +24,14 @@ Boston, MA 02111-1307, USA. */ ...@@ -24,10 +24,14 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <windows.h>
#include <objc/thr.h> #include <objc/thr.h>
#include "runtime.h" #include "runtime.h"
#ifndef __OBJC__
#define __OBJC__
#endif
#include <windows.h>
/******** /********
* This structure represents a single mutual exclusion lock. Lock semantics * This structure represents a single mutual exclusion lock. Lock semantics
* are detailed with the subsequent functions. We use whatever lock is * are detailed with the subsequent functions. We use whatever lock is
......
...@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
#include <stdlib.h> #include <stdlib.h>
#include "runtime.h" #include "runtime.h"
/***************************************************************************** /*************************************************************************
* Universal static variables: * Universal static variables:
*/ */
int __objc_thread_exit_status = 0; /* Global exit status. */ int __objc_thread_exit_status = 0; /* Global exit status. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment