summaryrefslogtreecommitdiff
path: root/libobjc
diff options
context:
space:
mode:
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-21 12:07:43 +0000
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-21 12:07:43 +0000
commita5095f658307b9a28644862f860fb4ecfe4a69b3 (patch)
treec34afc739ede871b04ed0871c5f5da770d62d0a6 /libobjc
parent33adfe37b74d39dd44153ded999fdec09236b383 (diff)
downloadgcc-a5095f658307b9a28644862f860fb4ecfe4a69b3.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142087 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r--libobjc/ChangeLog12
-rw-r--r--libobjc/Object.m5
-rw-r--r--libobjc/objc/objc.h1
-rw-r--r--libobjc/sendmsg.c6
-rw-r--r--libobjc/thr-win32.c4
-rw-r--r--libobjc/thr.c3
6 files changed, 23 insertions, 8 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 40cbd012c0f..a3330eefdcd 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -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>
diff --git a/libobjc/Object.m b/libobjc/Object.m
index 1830acf4502..38016085b4f 100644
--- a/libobjc/Object.m
+++ b/libobjc/Object.m
@@ -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;
diff --git a/libobjc/objc/objc.h b/libobjc/objc/objc.h
index ee7612c9754..cc822edf5d3 100644
--- a/libobjc/objc/objc.h
+++ b/libobjc/objc/objc.h
@@ -39,6 +39,7 @@ extern "C" {
#ifdef __vxworks
typedef int BOOL;
#else
+#undef BOOL
typedef unsigned char BOOL;
#endif
#define YES (BOOL)1
diff --git a/libobjc/sendmsg.c b/libobjc/sendmsg.c
index b132a153ff3..42d3e02af9f 100644
--- a/libobjc/sendmsg.c
+++ b/libobjc/sendmsg.c
@@ -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);
diff --git a/libobjc/thr-win32.c b/libobjc/thr-win32.c
index cc4bb746e13..35a1c9e6833 100644
--- a/libobjc/thr-win32.c
+++ b/libobjc/thr-win32.c
@@ -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. */
diff --git a/libobjc/thr.c b/libobjc/thr.c
index 17f6f7e2920..c70c5bf5a01 100644
--- a/libobjc/thr.c
+++ b/libobjc/thr.c
@@ -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 ();
}
/*