[Gc] [patch] cleanup a few compiler warnings on darwin

Andreas Tobler toa at pop.agri.ch
Sat Jan 27 13:27:58 PST 2007


Hello,

the subject says it.

Ok ?

Thanks,

Andreas

2007-01-27  Andreas Tobler  <a.tobler at schweiz.org>

	* darwin_stop_world.c (GC_push_all_stacks): Fix compiler warnings.
	Make i unsigned.
	(GC_stop_world): Likewise. Remove unused GC_thread p.
	(GC_start_world): Likewise.

	* os_dep.c: Define GC_darwin_register_mach_handler_thread extern.
	Remove double SIG_HNDLR_PTR definition.
	(GC_forward_exception): Fix compiler warnings, make i unsigned.
	Initialize thread_state to NULL.
	(catch_exception_raise): Fix compiler warnings, make i unsigned.
-------------- next part --------------
Index: darwin_stop_world.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/darwin_stop_world.c,v
retrieving revision 1.11
diff -u -r1.11 darwin_stop_world.c
--- darwin_stop_world.c	25 Jan 2007 05:18:27 -0000	1.11
+++ darwin_stop_world.c	27 Jan 2007 21:25:23 -0000
@@ -196,8 +196,8 @@
 #else /* !DARWIN_DONT_PARSE_STACK; Use FindTopOfStack() */
 
 void GC_push_all_stacks() {
-    int i;
-	task_t my_task;
+    unsigned int i;
+    task_t my_task;
     kern_return_t r;
     mach_port_t me;
     ptr_t lo, hi;
@@ -435,8 +435,7 @@
 /* Caller holds allocation lock.	*/
 void GC_stop_world()
 {
-    int i, changes;
-    GC_thread p;
+    unsigned int i, changes;
     task_t my_task = current_task();
     mach_port_t my_thread = mach_thread_self();
     kern_return_t kern_result;
@@ -524,8 +523,8 @@
 {
   task_t my_task = current_task();
   mach_port_t my_thread = mach_thread_self();
-  int i, j;
-  GC_thread p;
+  unsigned int i;
+  int j;
   kern_return_t kern_result;
   thread_act_array_t act_list;
   mach_msg_type_number_t listcount;
Index: os_dep.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/os_dep.c,v
retrieving revision 1.20
diff -u -r1.20 os_dep.c
--- os_dep.c	25 Jan 2007 05:18:27 -0000	1.20
+++ os_dep.c	27 Jan 2007 21:25:25 -0000
@@ -3445,7 +3445,7 @@
 /* The bug that caused all this trouble should now be fixed. This should
    eventually be removed if all goes well. */
 
-/* define BROKEN_EXCEPTION_HANDLING */
+/* #define BROKEN_EXCEPTION_HANDLING */
 
 #include <mach/mach.h>
 #include <mach/mach_error.h>
@@ -3454,6 +3454,8 @@
 #include <mach/task.h>
 #include <pthread.h>
 
+extern void GC_darwin_register_mach_handler_thread(mach_port_t);
+
 /* These are not defined in any header, although they are documented */
 extern boolean_t
 exc_server(mach_msg_header_t *, mach_msg_header_t *);
@@ -3665,7 +3667,6 @@
    meaningless and safe to ignore. */
 #ifdef BROKEN_EXCEPTION_HANDLING
 
-typedef void (* SIG_HNDLR_PTR)();
 static SIG_HNDLR_PTR GC_old_bus_handler;
 
 /* Updates to this aren't atomic, but the SIGBUSs seem pretty rare.
@@ -3778,13 +3779,13 @@
 					  exception_data_t data,
 					  mach_msg_type_number_t data_count)
 {
-  int i;
+  unsigned int i;
   kern_return_t r;
   mach_port_t port;
   exception_behavior_t behavior;
   thread_state_flavor_t flavor;
 
-  thread_state_t thread_state;
+  thread_state_t thread_state = NULL;
   mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX;
 
   for(i=0; i < GC_old_exc_ports.count; i++)
@@ -3845,7 +3846,7 @@
   kern_return_t r;
   char *addr;
   struct hblk *h;
-  int i;
+  unsigned int i;
 # if defined(POWERPC)
 #   if CPP_WORDSZ == 32
       thread_state_flavor_t flavor = PPC_EXCEPTION_STATE;


More information about the Gc mailing list