OSDN Git Service

* gthr-posix.h (__gthread_objc_thread_detach): Simply cast
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Jun 2001 17:22:20 +0000 (17:22 +0000)
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Jun 2001 17:22:20 +0000 (17:22 +0000)
pthread_t to objc_thread_t.
(__gthread_objc_thread_id): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42974 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gthr-posix.h

index 7f2310e..05026ed 100644 (file)
@@ -1,5 +1,11 @@
 2001-06-07  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
+       * gthr-posix.h (__gthread_objc_thread_detach): Simply cast
+       pthread_t to objc_thread_t.
+       (__gthread_objc_thread_id): Likewise.
+
+2001-06-07  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
        * alpha/osf5.h (CPP_XFLOAT_SPEC): Override default definition.
        (ASM_OLDAS_SPEC): Likewise.
 
index b5a4637..2042ebe 100644 (file)
@@ -1,6 +1,6 @@
 /* Threads compatibility routines for libgcc2 and libobjc.  */
 /* Compile this one with gcc.  */
-/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -158,7 +158,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg)
     return NULL;
  
   if ( !(pthread_create(&new_thread_handle, NULL, (void *)func, arg)) )
-    thread_id = *(objc_thread_t *)&new_thread_handle;
+    thread_id = (objc_thread_t) new_thread_handle;
   else
     thread_id = NULL;
   
@@ -246,13 +246,9 @@ static inline objc_thread_t
 __gthread_objc_thread_id(void)
 {
   if (__gthread_active_p ())
-    {
-      pthread_t self = pthread_self();
-
-      return *(objc_thread_t *)&self;
-    }
+    return (objc_thread_t) pthread_self();
   else
-    return (objc_thread_t)1;
+    return (objc_thread_t) 1;
 }
 
 /* Sets the thread's local storage pointer. */