Browse Source

Fix warnings.

Zoltan Varga 13 years ago
parent
commit
b5a61875a0

+ 2 - 2
libgc/include/private/gc_priv.h

@@ -403,9 +403,9 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
 #     define ENABLE_SIGNALS()
 #   else
 #     define DISABLE_SIGNALS() GC_disable_signals()
-	void GC_disable_signals();
+	void GC_disable_signals(void);
 #     define ENABLE_SIGNALS() GC_enable_signals()
-	void GC_enable_signals();
+	void GC_enable_signals(void);
 #   endif
 # endif
 

+ 2 - 0
libgc/include/private/gcconfig.h

@@ -326,7 +326,9 @@
 #    define DATASTART ((ptr_t) get_etext())
 #    define DATAEND	((ptr_t) get_end())
 #    define STACKBOTTOM ((ptr_t) pthread_get_stackaddr_np(pthread_self()))
+#ifndef USE_MMAP
 #    define USE_MMAP
+#endif
 #    define USE_MMAP_ANON
 #    define USE_ASM_PUSH_REGS
      /* This is potentially buggy. It needs more testing. See the comments in

+ 1 - 1
mono/metadata/assembly.c

@@ -585,7 +585,7 @@ fallback (void)
 	mono_set_dirs (MONO_ASSEMBLIES, MONO_CFG_DIR);
 }
 
-static void
+static G_GNUC_UNUSED void
 set_dirs (char *exe)
 {
 	char *base;

+ 0 - 1
mono/metadata/sgen-fin-weak-hash.c

@@ -482,7 +482,6 @@ remove_finalizers_for_domain (MonoDomain *domain, int generation)
 	gpointer dummy;
 
 	SGEN_HASH_TABLE_FOREACH (hash_table, object, dummy) {
-		int tag = tagged_object_get_tag (object);
 		object = tagged_object_get_object (object);
 
 		if (mono_object_domain (object) == domain) {

+ 1 - 1
mono/metadata/threads.c

@@ -3884,7 +3884,7 @@ mono_thread_alloc_tls (MonoReflectionType *type)
 	/* TlsDatum is a struct, so we subtract the object header size offset */
 	bitmap = mono_class_compute_bitmap (klass, default_bitmap, sizeof (default_bitmap) * 8, - (int)(sizeof (MonoObject) / sizeof (gpointer)), &max_set, FALSE);
 	size = mono_type_size (type->type, &align);
-	tls_offset = mono_alloc_special_static_data (SPECIAL_STATIC_THREAD, size, align, bitmap, max_set);
+	tls_offset = mono_alloc_special_static_data (SPECIAL_STATIC_THREAD, size, align, (uintptr_t*)bitmap, max_set);
 	if (bitmap != default_bitmap)
 		g_free (bitmap);
 	tlsrec = g_new0 (MonoTlsDataRecord, 1);

+ 8 - 11
mono/utils/mono-proclib.c

@@ -137,7 +137,7 @@ mono_process_list (int *size)
 #endif
 }
 
-static char*
+static G_GNUC_UNUSED char*
 get_pid_status_item_buf (int pid, const char *item, char *rbuf, int blen, MonoProcessError *error)
 {
 	char buf [256];
@@ -271,27 +271,24 @@ get_process_stat_item (int pid, int pos, int sum, MonoProcessError *error)
 #if defined(__APPLE__) 
 	double process_user_time = 0, process_system_time = 0;//, process_percent = 0;
 	task_t task;
+	struct task_basic_info t_info;
+	mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT, th_count;
+	thread_array_t th_array;
+	size_t i;
 
 	if (task_for_pid(mach_task_self(), pid, &task) != KERN_SUCCESS)
 		RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
-	
-	struct task_basic_info t_info;
-	mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT, th_count;
 
 	if (task_info(task, TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count) != KERN_SUCCESS) {
 		mach_port_deallocate (mach_task_self (), task);
 		RET_ERROR (MONO_PROCESS_ERROR_OTHER);
 	}
 	
-	thread_array_t th_array;
-
 	if (task_threads(task, &th_array, &th_count) != KERN_SUCCESS) {
 		mach_port_deallocate (mach_task_self (), task);
 		RET_ERROR (MONO_PROCESS_ERROR_OTHER);
 	}
 		
-	size_t i;
-
 	for (i = 0; i < th_count; i++) {
 		double thread_user_time, thread_system_time;//, thread_percent;
 		
@@ -407,11 +404,11 @@ get_pid_status_item (int pid, const char *item, MonoProcessError *error, int mul
 	
 	gint64 ret;
 	task_t task;
-	if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
-		RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
-
 	struct task_basic_info t_info;
 	mach_msg_type_number_t th_count = TASK_BASIC_INFO_COUNT;
+
+	if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
+		RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
 	
 	if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS) {
 		mach_port_deallocate (mach_task_self (), task);