]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Object.m (errno): Replaced by errno.h include.
authorKai Tietz <kai.tietz@onevision.com>
Fri, 21 Nov 2008 12:07:43 +0000 (12:07 +0000)
committerKai Tietz <ktietz@gcc.gnu.org>
Fri, 21 Nov 2008 12:07:43 +0000 (13:07 +0100)
2008-11-21  Kai Tietz  <kai.tietz@onevision.com>

        *  Object.m (errno): Replaced by errno.h include.
        (compare): Cast self to id to prevent warning on comparison.
        * objc/objc.h (BOOL): Prevent redeclaration of BOOL, if it is
        already there.
        * sendmsg.c (__objc_print_dtable_stats): Remove type warnings.
        * thr-win32.c (__objc_thread_detach): Remove type warning.
        (__objc_thread_id): Likewise.
        * thr.c (__objc_thread_detach_functiont): Add __builtin_trap ()
        for noreturn.

From-SVN: r142087

libobjc/ChangeLog
libobjc/Object.m
libobjc/objc/objc.h
libobjc/sendmsg.c
libobjc/thr-win32.c
libobjc/thr.c

index 40cbd012c0fea42a0dd70754d523f7b9b4d3d55f..a3330eefdcd4997f51b2cf40a7ee1180d0fd7b7d 100644 (file)
@@ -1,3 +1,15 @@
+2008-11-21  Kai Tietz  <kai.tietz@onevision.com>
+
+       *  Object.m (errno): Replaced by errno.h include.
+       (compare): Cast self to id to prevent warning on comparison.
+       * objc/objc.h (BOOL): Prevent redeclaration of BOOL, if it is
+       already there.
+       * sendmsg.c (__objc_print_dtable_stats): Remove type warnings.
+       * thr-win32.c (__objc_thread_detach): Remove type warning.
+       (__objc_thread_id): Likewise.
+       * thr.c (__objc_thread_detach_functiont): Add __builtin_trap ()
+       for noreturn.
+
 2008-09-26  Peter O'Gorman  <pogma@thewrittenword.com>
             Steve Ellcey  <sje@cup.hp.com>
 
index 1830acf4502a05d87edff1b16b743debfa9fcf81..38016085b4f56aeecfcc83e494016e8b1517ed4f 100644 (file)
@@ -25,12 +25,11 @@ Boston, MA 02110-1301, USA.  */
    executable file might be covered by the GNU General Public License. */
 
 #include <stdarg.h>
+#include <errno.h>
 #include "objc/Object.h"
 #include "objc/Protocol.h"
 #include "objc/objc-api.h"
 
-extern int errno;
-
 #define MAX_CLASS_NAME_LEN 256
 
 @implementation Object
@@ -121,7 +120,7 @@ extern int errno;
     return 0;
   // Ordering objects by their address is pretty useless, 
   // so subclasses should override this is some useful way.
-  else if (self > anotherObject)
+  else if ((id)self > anotherObject)
     return 1;
   else 
     return -1;
index ee7612c9754c9c9c4fb46c8ce89877d3350a573f..cc822edf5d37c693c4eab075e80e80e727e9cfc6 100644 (file)
@@ -39,6 +39,7 @@ extern "C" {
 #ifdef __vxworks
 typedef int BOOL;
 #else
+#undef BOOL
 typedef unsigned char  BOOL;
 #endif
 #define YES   (BOOL)1
index b132a153ff32ef1630612477d8553d4687d07efe..42d3e02af9fc62c6c4060c00488893ee05b495c1 100644 (file)
@@ -687,14 +687,14 @@ __objc_print_dtable_stats ()
 #endif
 
   printf ("arrays: %d = %ld bytes\n", narrays, 
-         (long) (narrays * sizeof (struct sarray)));
+         (long) ((size_t) narrays * sizeof (struct sarray)));
   total += narrays * sizeof (struct sarray);
   printf ("buckets: %d = %ld bytes\n", nbuckets, 
-         (long) (nbuckets * sizeof (struct sbucket)));
+         (long) ((size_t) nbuckets * sizeof (struct sbucket)));
   total += nbuckets * sizeof (struct sbucket);
 
   printf ("idxtables: %d = %ld bytes\n",
-         idxsize, (long) (idxsize * sizeof (void *)));
+         idxsize, (long) ((size_t) idxsize * sizeof (void *)));
   total += idxsize * sizeof (void *);
   printf ("-----------------------------------\n");
   printf ("total: %d bytes\n", total);
index cc4bb746e136bc917a0c2f0a63a75ec3edb4cdd2..35a1c9e6833c4acf24578768dcec15def6534343 100644 (file)
@@ -70,7 +70,7 @@ __objc_thread_detach(void (*func)(void *arg), void *arg)
                                    arg, 0, &thread_id)))
     thread_id = 0;
   
-  return (objc_thread_t)thread_id;
+  return (objc_thread_t)(size_t) thread_id;
 }
 
 /* Set the current thread's priority. */
@@ -151,7 +151,7 @@ __objc_thread_exit(void)
 objc_thread_t
 __objc_thread_id(void)
 {
-  return (objc_thread_t)GetCurrentThreadId();
+  return (objc_thread_t)(size_t) GetCurrentThreadId();
 }
 
 /* Sets the thread's local storage pointer. */
index 17f6f7e2920a29e30fc32965407b935a8e129fa9..c70c5bf5a01c3733212ccaeddec703bb37aae1be 100644 (file)
@@ -114,6 +114,9 @@ __objc_thread_detach_function (struct __objc_thread_start_state *istate)
 
   /* Exit the thread */
   objc_thread_exit ();
+  
+  /* Make sure compiler detects no return.  */
+  __builtin_trap ();
 }
 
 /*