Commit b15b7ef8 by Kai Tietz Committed by Kai Tietz

Object.m (errno): Replaced by errno.h include.

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
parent 6b96ae3a
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> 2008-09-26 Peter O'Gorman <pogma@thewrittenword.com>
Steve Ellcey <sje@cup.hp.com> Steve Ellcey <sje@cup.hp.com>
......
...@@ -25,12 +25,11 @@ Boston, MA 02110-1301, USA. */ ...@@ -25,12 +25,11 @@ Boston, MA 02110-1301, USA. */
executable file might be covered by the GNU General Public License. */ executable file might be covered by the GNU General Public License. */
#include <stdarg.h> #include <stdarg.h>
#include <errno.h>
#include "objc/Object.h" #include "objc/Object.h"
#include "objc/Protocol.h" #include "objc/Protocol.h"
#include "objc/objc-api.h" #include "objc/objc-api.h"
extern int errno;
#define MAX_CLASS_NAME_LEN 256 #define MAX_CLASS_NAME_LEN 256
@implementation Object @implementation Object
...@@ -121,7 +120,7 @@ extern int errno; ...@@ -121,7 +120,7 @@ extern int errno;
return 0; return 0;
// Ordering objects by their address is pretty useless, // Ordering objects by their address is pretty useless,
// so subclasses should override this is some useful way. // so subclasses should override this is some useful way.
else if (self > anotherObject) else if ((id)self > anotherObject)
return 1; return 1;
else else
return -1; return -1;
......
...@@ -39,6 +39,7 @@ extern "C" { ...@@ -39,6 +39,7 @@ extern "C" {
#ifdef __vxworks #ifdef __vxworks
typedef int BOOL; typedef int BOOL;
#else #else
#undef BOOL
typedef unsigned char BOOL; typedef unsigned char BOOL;
#endif #endif
#define YES (BOOL)1 #define YES (BOOL)1
......
...@@ -687,14 +687,14 @@ __objc_print_dtable_stats () ...@@ -687,14 +687,14 @@ __objc_print_dtable_stats ()
#endif #endif
printf ("arrays: %d = %ld bytes\n", narrays, printf ("arrays: %d = %ld bytes\n", narrays,
(long) (narrays * sizeof (struct sarray))); (long) ((size_t) narrays * sizeof (struct sarray)));
total += narrays * sizeof (struct sarray); total += narrays * sizeof (struct sarray);
printf ("buckets: %d = %ld bytes\n", nbuckets, printf ("buckets: %d = %ld bytes\n", nbuckets,
(long) (nbuckets * sizeof (struct sbucket))); (long) ((size_t) nbuckets * sizeof (struct sbucket)));
total += nbuckets * sizeof (struct sbucket); total += nbuckets * sizeof (struct sbucket);
printf ("idxtables: %d = %ld bytes\n", printf ("idxtables: %d = %ld bytes\n",
idxsize, (long) (idxsize * sizeof (void *))); idxsize, (long) ((size_t) idxsize * sizeof (void *)));
total += idxsize * sizeof (void *); total += idxsize * sizeof (void *);
printf ("-----------------------------------\n"); printf ("-----------------------------------\n");
printf ("total: %d bytes\n", total); printf ("total: %d bytes\n", total);
......
...@@ -70,7 +70,7 @@ __objc_thread_detach(void (*func)(void *arg), void *arg) ...@@ -70,7 +70,7 @@ __objc_thread_detach(void (*func)(void *arg), void *arg)
arg, 0, &thread_id))) arg, 0, &thread_id)))
thread_id = 0; thread_id = 0;
return (objc_thread_t)thread_id; return (objc_thread_t)(size_t) thread_id;
} }
/* Set the current thread's priority. */ /* Set the current thread's priority. */
...@@ -151,7 +151,7 @@ __objc_thread_exit(void) ...@@ -151,7 +151,7 @@ __objc_thread_exit(void)
objc_thread_t objc_thread_t
__objc_thread_id(void) __objc_thread_id(void)
{ {
return (objc_thread_t)GetCurrentThreadId(); return (objc_thread_t)(size_t) GetCurrentThreadId();
} }
/* Sets the thread's local storage pointer. */ /* Sets the thread's local storage pointer. */
......
...@@ -114,6 +114,9 @@ __objc_thread_detach_function (struct __objc_thread_start_state *istate) ...@@ -114,6 +114,9 @@ __objc_thread_detach_function (struct __objc_thread_start_state *istate)
/* Exit the thread */ /* Exit the thread */
objc_thread_exit (); objc_thread_exit ();
/* Make sure compiler detects no return. */
__builtin_trap ();
} }
/* /*
......
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