Fix various compiler warnings (#5064)
authorcherusker <cherusker@users.noreply.github.com>
Tue, 27 Jun 2017 14:21:34 +0000 (16:21 +0200)
committerBernhard Urban <bernhard.urban@xamarin.com>
Tue, 27 Jun 2017 14:21:34 +0000 (16:21 +0200)
* Fix compiler warnings (w32)

- add explicit (long long (unsigned)) type casts

- change %ld to %lld once, to match the general style of these logging messages

* Fix compiler warnings (threadpool)

- add explicit (void *) type casts

* Fix compiler warnings (boehm)

- add an explicit (long) type cast; the values are defined as gint64, an upgrade to at least "%ld" seems like a good idea

- about dropping const: const does not seem to be necessary as g_getenv() returns pointers to freshly allocated buffers whenever called. const might have been used to protect the return value of g_getenv() on unix systems with earlier versions of Mono (as a comment in gmisc-unix.c suggests). keeping const here causes a compiler warning, as the const qualifier gets dropped when *env is being used with g_free(). that led to the decision to drop the qualifier altogether.

* Fix compiler warnings (sgen)

- specify the arguments (void) to avoid -Wstrict-prototypes warnings

* Fix compiler warnings (misc - metadata)

- specify the arguments (void) to avoid -Wstrict-prototypes warnings

* Fix compiler warnings (misc)

- specify the arguments (void) to avoid -Wstrict-prototypes warnings

- add an explicit (void *) type cast; changing the return type to char* might be more usable and could be discussed

- ret is not being used and can be removed; fixes a -Wunused-but-set-variable warning

* Fix compiler warnings (mini)

- specify the arguments (void) to avoid -Wstrict-prototypes warnings

* [fixup!] Correct indentation

* [fixup!] Correct (void *)
- use GUINT_TO_POINTER and MONO_NATIVE_THREAD_ID_TO_UINT instead of (void *) to cast mono_native_thread_id_get () to %p

* [fixup!] Correct indentation of boehm-gc.c and add FIXME

* include <inttypes.h> and test the G_GINT64_FORMAT macro

* [fixup!] Use G_G*_FORMAT and PRIx32 macros instead of type casts wherever possible

15 files changed:
eglib/src/glib.h
mono/btls/btls-util.c
mono/metadata/boehm-gc.c
mono/metadata/handle.c
mono/metadata/icall.c
mono/metadata/sgen-bridge.c
mono/metadata/sgen-tarjan-bridge.c
mono/metadata/threadpool-worker-default.c
mono/metadata/threadpool.c
mono/metadata/w32file-unix.c
mono/metadata/w32process-unix.c
mono/mini/debugger-agent.c
mono/mini/main.c
mono/unit-tests/test-mono-handle.c
support/stdlib.c

index 6f16fcb292bb692f2e2fc5daa5d7c3a5a8cd0189..060b99e51aef3996457e7dac5068e1207a2b578b 100644 (file)
@@ -14,6 +14,7 @@
 #endif
 
 #include <stdint.h>
+#include <inttypes.h>
 
 #include <eglib-config.h>
 #ifndef EGLIB_NO_REMAP
index 7c7f4ca5b41a511496b431425788a3531f425749..955b8c85aec4fa4eea5ae2bc972c0b88bdaa23e4 100644 (file)
@@ -27,12 +27,12 @@ mono_btls_util_asn1_time_to_ticks (ASN1_TIME *time)
        ASN1_GENERALIZEDTIME *gtime;
        struct tm tm;
        int64_t epoch;
-       int ret;
        
        memset (&tm, 0, sizeof (tm));
 
        gtime = ASN1_TIME_to_generalizedtime (time, NULL);
-       ret = asn1_generalizedtime_to_tm (&tm, gtime);
+       /* FIXME: check return value of  asn1_generalizedtime_to_tm () */
+       asn1_generalizedtime_to_tm (&tm, gtime);
        ASN1_GENERALIZEDTIME_free (gtime);
        epoch = btls_timegm64 (&tm);
 
index acbd4eae4b0735bdaef0564e5f2225c780bddddf..abbea870830954a4ac2f069f45a55ed69ae0c506 100644 (file)
@@ -102,7 +102,7 @@ static void on_gc_heap_resize (size_t new_size);
 void
 mono_gc_base_init (void)
 {
-       const char *env;
+       char *env;
 
        if (gc_initialized)
                return;
@@ -465,7 +465,7 @@ on_gc_notification (GC_EventType event)
                }
 #endif
                gc_stats.major_gc_time += mono_100ns_ticks () - gc_start_time;
-               mono_trace_message (MONO_TRACE_GC, "gc took %d usecs", (mono_100ns_ticks () - gc_start_time) / 10);
+               mono_trace_message (MONO_TRACE_GC, "gc took %" G_GINT64_FORMAT " usecs", (mono_100ns_ticks () - gc_start_time) / 10);
                break;
        default:
                break;
index 4fc959c242a6a6c33be9ca422e91a01dde498be9..5e32a478a382160b163cbd68fea7ad41f9f442e3 100644 (file)
@@ -71,7 +71,7 @@ Combine: MonoDefaults, GENERATE_GET_CLASS_WITH_CACHE, TYPED_HANDLE_DECL and frie
 
 #if defined(HAVE_BOEHM_GC) || defined(HAVE_NULL_GC)
 static HandleStack*
-new_handle_stack ()
+new_handle_stack (void)
 {
        return (HandleStack *)mono_gc_alloc_fixed (sizeof (HandleStack), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_HANDLE, "Thread Handle Stack");
 }
@@ -83,7 +83,7 @@ free_handle_stack (HandleStack *stack)
 }
 
 static HandleChunk*
-new_handle_chunk ()
+new_handle_chunk (void)
 {
 #if defined(HAVE_BOEHM_GC)
        return (HandleChunk *)GC_MALLOC (sizeof (HandleChunk));
@@ -101,7 +101,7 @@ free_handle_chunk (HandleChunk *chunk)
 }
 #else
 static HandleStack*
-new_handle_stack ()
+new_handle_stack (void)
 {
        return g_new (HandleStack, 1);
 }
@@ -113,7 +113,7 @@ free_handle_stack (HandleStack *stack)
 }
 
 static HandleChunk*
-new_handle_chunk ()
+new_handle_chunk (void)
 {
        return g_new (HandleChunk, 1);
 }
index cdbab7561d41be8e8e2cd0ddb13502f302925a37..9692845d19089e457199d61da221fa3df58f6cbc 100644 (file)
@@ -7866,7 +7866,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_GetRawIUnknownForComObjectNoAdd
 }
 
 ICALL_EXPORT MonoObject*
-ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_GetRestrictedErrorInfo()
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_GetRestrictedErrorInfo(void)
 {
        mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.GetRestrictedErrorInfo internal call is not implemented."));
        return NULL;
index 9bfb7245a63cd0dd1c6efbbd5c007884557c78cb..9d7809a211a4a550269488fa7dc2b18be7bb0e33 100644 (file)
@@ -94,7 +94,7 @@ bridge_processor_name (const char *name)
 }
 
 static gboolean
-bridge_processor_started ()
+bridge_processor_started (void)
 {
        return bridge_processor.reset_data != NULL;
 }
@@ -139,7 +139,7 @@ init_bridge_processor (SgenBridgeProcessor *processor, BridgeProcessorSelection
  * is done initing. Actual initialization then only occurs if it is ready.
  */
 void
-sgen_init_bridge ()
+sgen_init_bridge (void)
 {
        if (sgen_gc_initialized ()) {
                // This lock is not initialized until the GC is
index 8df0c6600ecece033d67ba1865e4dadaea245d17..77ea9f8a701df71b22b4ff543b0a9cae8d4b3840 100644 (file)
@@ -180,7 +180,7 @@ static DynPtrArray color_merge_array;
 // Running hash of the contents of the color_merge_array.
 static unsigned int color_merge_array_hash;
 
-static void color_merge_array_empty ()
+static void color_merge_array_empty (void)
 {
        dyn_array_ptr_empty (&color_merge_array);
        color_merge_array_hash = 0;
index 6c851db7370086b8abf12131ac74ef18e9b0f223..87256b511873d728e0124cb92180551a3b3dc15b 100644 (file)
@@ -387,7 +387,8 @@ worker_park (void)
        gboolean timeout = FALSE;
        gboolean interrupted = FALSE;
 
-       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker parking", mono_native_thread_id_get ());
+       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker parking",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
 
        mono_coop_mutex_lock (&worker.parked_threads_lock);
 
@@ -431,7 +432,7 @@ done:
        mono_coop_mutex_unlock (&worker.parked_threads_lock);
 
        mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker unparking, timeout? %s interrupted? %s",
-               mono_native_thread_id_get (), timeout ? "yes" : "no", interrupted ? "yes" : "no");
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), timeout ? "yes" : "no", interrupted ? "yes" : "no");
 
        return timeout;
 }
@@ -441,7 +442,8 @@ worker_try_unpark (void)
 {
        gboolean res = FALSE;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try unpark worker", mono_native_thread_id_get ());
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try unpark worker",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
 
        mono_coop_mutex_lock (&worker.parked_threads_lock);
        if (worker.parked_threads_count > 0) {
@@ -450,7 +452,8 @@ worker_try_unpark (void)
        }
        mono_coop_mutex_unlock (&worker.parked_threads_lock);
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try unpark worker, success? %s", mono_native_thread_id_get (), res ? "yes" : "no");
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try unpark worker, success? %s",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), res ? "yes" : "no");
 
        return res;
 }
@@ -461,7 +464,8 @@ worker_thread (gpointer unused)
        MonoInternalThread *thread;
        ThreadPoolWorkerCounter counter;
 
-       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker starting", mono_native_thread_id_get ());
+       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker starting",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
 
        if (!mono_refcount_tryinc (&worker))
                return 0;
@@ -489,7 +493,7 @@ worker_thread (gpointer unused)
                }
 
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker executing",
-                       mono_native_thread_id_get ());
+                       GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
 
                worker.callback ();
        }
@@ -498,7 +502,8 @@ worker_thread (gpointer unused)
                counter._.working --;
        });
 
-       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker finishing", mono_native_thread_id_get ());
+       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker finishing",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
 
        mono_refcount_dec (&worker);
 
@@ -519,7 +524,8 @@ worker_try_create (void)
 
        mono_coop_mutex_lock (&worker.worker_creation_lock);
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker", mono_native_thread_id_get ());
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
 
        current_ticks = mono_100ns_ticks ();
        if (0 == current_ticks) {
@@ -533,7 +539,7 @@ worker_try_create (void)
                        g_assert (worker.worker_creation_current_count <= WORKER_CREATION_MAX_PER_SEC);
                        if (worker.worker_creation_current_count == WORKER_CREATION_MAX_PER_SEC) {
                                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: maximum number of worker created per second reached, current count = %d",
-                                       mono_native_thread_id_get (), worker.worker_creation_current_count);
+                                       GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), worker.worker_creation_current_count);
                                mono_coop_mutex_unlock (&worker.worker_creation_lock);
                                return FALSE;
                        }
@@ -543,7 +549,7 @@ worker_try_create (void)
        COUNTER_ATOMIC (counter, {
                if (counter._.working >= counter._.max_working) {
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: maximum number of working threads reached",
-                               mono_native_thread_id_get ());
+                               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
                        mono_coop_mutex_unlock (&worker.worker_creation_lock);
                        return FALSE;
                }
@@ -552,7 +558,8 @@ worker_try_create (void)
 
        thread = mono_thread_create_internal (mono_get_root_domain (), worker_thread, NULL, MONO_THREAD_CREATE_FLAGS_THREADPOOL, &error);
        if (!thread) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: could not create thread due to %s", mono_native_thread_id_get (), mono_error_get_message (&error));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: could not create thread due to %s",
+                       GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), mono_error_get_message (&error));
                mono_error_cleanup (&error);
 
                COUNTER_ATOMIC (counter, {
@@ -567,7 +574,7 @@ worker_try_create (void)
        worker.worker_creation_current_count += 1;
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, created %p, now = %d count = %d",
-               mono_native_thread_id_get (), (gpointer) thread->tid, now, worker.worker_creation_current_count);
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), (gpointer) thread->tid, now, worker.worker_creation_current_count);
 
        mono_coop_mutex_unlock (&worker.worker_creation_lock);
        return TRUE;
@@ -584,16 +591,19 @@ worker_request (void)
        monitor_ensure_running ();
 
        if (worker_try_unpark ()) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] request worker, unparked", mono_native_thread_id_get ());
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] request worker, unparked",
+                       GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
                return;
        }
 
        if (worker_try_create ()) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] request worker, created", mono_native_thread_id_get ());
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] request worker, created",
+                       GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
                return;
        }
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] request worker, failed", mono_native_thread_id_get ());
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] request worker, failed",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
 }
 
 static gboolean
@@ -668,7 +678,8 @@ monitor_thread (gpointer unused)
 
        // printf ("monitor_thread: start\n");
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, started", mono_native_thread_id_get ());
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, started",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
 
        do {
                ThreadPoolWorkerCounter counter;
@@ -731,12 +742,14 @@ monitor_thread (gpointer unused)
                                break;
 
                        if (worker_try_unpark ()) {
-                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, unparked", mono_native_thread_id_get ());
+                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, unparked",
+                                       GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
                                break;
                        }
 
                        if (worker_try_create ()) {
-                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, created", mono_native_thread_id_get ());
+                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, created",
+                                       GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
                                break;
                        }
                }
@@ -744,7 +757,8 @@ monitor_thread (gpointer unused)
 
        // printf ("monitor_thread: stop\n");
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, finished", mono_native_thread_id_get ());
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, finished",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
 
        mono_refcount_dec (&worker);
        return 0;
@@ -790,7 +804,8 @@ hill_climbing_change_thread_count (gint16 new_thread_count, ThreadPoolHeuristicS
 
        hc = &worker.heuristic_hill_climbing;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] hill climbing, change max number of threads %d", mono_native_thread_id_get (), new_thread_count);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] hill climbing, change max number of threads %d",
+               GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), new_thread_count);
 
        hc->last_thread_count = new_thread_count;
        hc->current_sample_interval = rand_next (&hc->random_interval_generator, hc->sample_interval_low, hc->sample_interval_high);
index fbdd359394a85ba6bf0883d4a4d2bc46c34df7f5..1c8c1f401a8fb0a49c3f0cdb8b9f1abeeedeeda4 100644 (file)
@@ -339,7 +339,7 @@ worker_callback (void)
                g_assert (tpdomain->outstanding_request >= 0);
 
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker running in domain %p (outstanding requests %d)",
-                       mono_native_thread_id_get (), tpdomain->domain, tpdomain->outstanding_request);
+                       GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), tpdomain->domain, tpdomain->outstanding_request);
 
                g_assert (tpdomain->threadpool_jobs >= 0);
                tpdomain->threadpool_jobs ++;
index 8c97b06cc8c9aaa91add0272f64f3ec381417f60..64e46c2d588487defd3ac2979aab5cdfc51d5396 100644 (file)
@@ -1368,19 +1368,20 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
 #ifdef HAVE_LARGE_FILE_SUPPORT
        if(highmovedistance==NULL) {
                offset=movedistance;
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: setting offset to %lld (low %d)", __func__,
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: setting offset to %" G_GINT64_FORMAT " (low %" G_GINT32_FORMAT ")", __func__,
                          offset, movedistance);
        } else {
                offset=((gint64) *highmovedistance << 32) | (guint32)movedistance;
                
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: setting offset to %lld 0x%llx (high %d 0x%x, low %d 0x%x)", __func__, offset, offset, *highmovedistance, *highmovedistance, movedistance, movedistance);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: setting offset to %" G_GINT64_FORMAT " 0x%" PRIx64 " (high %" G_GINT32_FORMAT " 0x%" PRIx32 ", low %" G_GINT32_FORMAT " 0x%" PRIx32 ")",
+                         __func__, offset, offset, *highmovedistance, *highmovedistance, movedistance, movedistance);
        }
 #else
        offset=movedistance;
 #endif
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: moving handle %p by %lld bytes from %d", __func__,
-                  handle, (long long)offset, whence);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: moving handle %p by %" G_GINT64_FORMAT " bytes from %d", __func__,
+                  handle, offset, whence);
 
 #ifdef PLATFORM_ANDROID
        /* bionic doesn't support -D_FILE_OFFSET_BITS=64 */
@@ -1400,7 +1401,7 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
                return(INVALID_SET_FILE_POINTER);
        }
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: lseek returns %lld", __func__, newpos);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: lseek returns %" G_GINT64_FORMAT, __func__, newpos);
 
 #ifdef HAVE_LARGE_FILE_SUPPORT
        ret=newpos & 0xFFFFFFFF;
@@ -1415,7 +1416,7 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
        }
 #endif
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: move of handle %p returning %d/%d", __func__,
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: move of handle %p returning %" G_GUINT32_FORMAT "/%" G_GINT32_FORMAT, __func__,
                   handle, ret, highmovedistance==NULL?0:*highmovedistance);
 
        return(ret);
@@ -1604,7 +1605,7 @@ static guint32 file_getfilesize(gpointer handle, guint32 *highsize)
                        *highsize = bigsize>>32;
                }
 
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Returning block device size %d/%d",
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Returning block device size %" G_GUINT32_FORMAT "/%" G_GUINT32_FORMAT,
                           __func__, size, *highsize);
        
                return(size);
@@ -1624,7 +1625,7 @@ static guint32 file_getfilesize(gpointer handle, guint32 *highsize)
        size = statbuf.st_size;
 #endif
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Returning size %d/%d", __func__, size, *highsize);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Returning size %" G_GUINT32_FORMAT "/%" G_GUINT32_FORMAT, __func__, size, *highsize);
        
        return(size);
 }
@@ -1690,7 +1691,7 @@ static gboolean file_getfiletime(gpointer handle, FILETIME *create_time,
        access_ticks=((guint64)statbuf.st_atime*10000000)+116444736000000000ULL;
        write_ticks=((guint64)statbuf.st_mtime*10000000)+116444736000000000ULL;
        
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: aticks: %llu cticks: %llu wticks: %llu", __func__,
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: aticks: %" G_GUINT64_FORMAT " cticks: %" G_GUINT64_FORMAT " wticks: %" G_GUINT64_FORMAT, __func__,
                  access_ticks, create_ticks, write_ticks);
 
        if(create_time!=NULL) {
@@ -2056,7 +2057,7 @@ pipe_read (gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesrea
                return(FALSE);
        }
        
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: reading up to %d bytes from pipe %p", __func__,
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: reading up to %" G_GUINT32_FORMAT " bytes from pipe %p", __func__,
                   numbytes, handle);
 
        do {
@@ -2117,8 +2118,8 @@ pipe_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byt
                return(FALSE);
        }
        
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: writing up to %d bytes to pipe %p", __func__, numbytes,
-                  handle);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: writing up to %" G_GUINT32_FORMAT " bytes to pipe %p", __func__,
+                  numbytes, handle);
 
        do {
                MONO_ENTER_GC_SAFE;
@@ -2161,7 +2162,7 @@ static gint convert_flags(guint32 fileaccess, guint32 createmode)
                flags=O_RDWR;
                break;
        default:
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unknown access type 0x%x", __func__,
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unknown access type 0x%" PRIx32, __func__,
                          fileaccess);
                break;
        }
@@ -2182,7 +2183,7 @@ static gint convert_flags(guint32 fileaccess, guint32 createmode)
                flags|=O_TRUNC;
                break;
        default:
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unknown create mode 0x%x", __func__,
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unknown create mode 0x%" PRIx32, __func__,
                          createmode);
                break;
        }
@@ -2222,7 +2223,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode,
                 */
                if (file_existing_share == 0) {
                        /* Quick and easy, no possibility to share */
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%x, file has sharing = NONE", __func__, fileaccess);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%" PRIx32 ", file has sharing = NONE", __func__, fileaccess);
 
                        file_share_release (*share_info);
                        
@@ -2234,7 +2235,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode,
                    ((file_existing_share == FILE_SHARE_WRITE) &&
                     (fileaccess != GENERIC_WRITE))) {
                        /* New access mode doesn't match up */
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%x, file has sharing: 0x%x", __func__, fileaccess, file_existing_share);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%" PRIx32 ", file has sharing: 0x%" PRIx32, __func__, fileaccess, file_existing_share);
 
                        file_share_release (*share_info);
                
@@ -2246,7 +2247,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode,
                    ((file_existing_access & GENERIC_WRITE) &&
                     !(sharemode & FILE_SHARE_WRITE))) {
                        /* New share mode doesn't match up */
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Access mode prevents open: requested share: 0x%x, file has access: 0x%x", __func__, sharemode, file_existing_access);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Access mode prevents open: requested share: 0x%" PRIx32 ", file has access: 0x%" PRIx32, __func__, sharemode, file_existing_access);
 
                        file_share_release (*share_info);
                
@@ -2275,7 +2276,7 @@ share_allows_delete (struct stat *statbuf, FileShare **share_info)
                 */
                if (file_existing_share == 0) {
                        /* Quick and easy, no possibility to share */
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%x, file has sharing = NONE", __func__, (*share_info)->access);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%" PRIx32 ", file has sharing = NONE", __func__, (*share_info)->access);
 
                        file_share_release (*share_info);
 
@@ -2284,7 +2285,7 @@ share_allows_delete (struct stat *statbuf, FileShare **share_info)
 
                if (!(file_existing_share & FILE_SHARE_DELETE)) {
                        /* New access mode doesn't match up */
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%x, file has sharing: 0x%x", __func__, (*share_info)->access, file_existing_share);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%" PRIx32 ", file has sharing: 0x%" PRIx32, __func__, (*share_info)->access, file_existing_share);
 
                        file_share_release (*share_info);
 
@@ -2338,7 +2339,7 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
                return(INVALID_HANDLE_VALUE);
        }
        
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Opening %s with share 0x%x and access 0x%x", __func__,
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Opening %s with share 0x%" PRIx32 " and access 0x%" PRIx32, __func__,
                   filename, sharemode, fileaccess);
        
        fd = _wapi_open (filename, flags, perms);
@@ -3278,21 +3279,23 @@ mono_w32file_filetime_to_systemtime(const FILETIME *file_time, SYSTEMTIME *syste
 
        totaldays=(file_ticks / TICKS_PER_DAY);
        rem = file_ticks % TICKS_PER_DAY;
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: totaldays: %lld rem: %lld", __func__, totaldays, rem);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: totaldays: %" G_GINT64_FORMAT " rem: %" G_GINT64_FORMAT, __func__,
+                 totaldays, rem);
 
        system_time->wHour=rem/TICKS_PER_HOUR;
        rem %= TICKS_PER_HOUR;
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Hour: %d rem: %lld", __func__, system_time->wHour, rem);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Hour: %d rem: %" G_GINT64_FORMAT,  __func__,
+                 system_time->wHour, rem);
        
        system_time->wMinute = rem / TICKS_PER_MINUTE;
        rem %= TICKS_PER_MINUTE;
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Minute: %d rem: %lld", __func__, system_time->wMinute,
-                 rem);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Minute: %d rem: %" G_GINT64_FORMAT, __func__,
+                 system_time->wMinute, rem);
        
        system_time->wSecond = rem / TICKS_PER_SECOND;
        rem %= TICKS_PER_SECOND;
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Second: %d rem: %lld", __func__, system_time->wSecond,
-                 rem);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Second: %d rem: %" G_GINT64_FORMAT, __func__,
+                 system_time->wSecond, rem);
        
        system_time->wMilliseconds = rem / TICKS_PER_MILLISECOND;
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Milliseconds: %d", __func__,
@@ -3313,19 +3316,19 @@ mono_w32file_filetime_to_systemtime(const FILETIME *file_time, SYSTEMTIME *syste
        while(totaldays < 0 || totaldays >= (isleap(y)?366:365)) {
                /* Guess a corrected year, assuming 365 days per year */
                gint64 yg = y + totaldays / 365 - (totaldays % 365 < 0);
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: totaldays: %lld yg: %lld y: %lld", __func__,
-                         totaldays, yg,
-                         y);
-               g_message("%s: LEAPS(yg): %lld LEAPS(y): %lld", __func__,
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: totaldays: %" G_GINT64_FORMAT " yg: %" G_GINT64_FORMAT " y: %" G_GINT64_FORMAT, __func__,
+                         totaldays, yg, y);
+               g_message("%s: LEAPS(yg): %li LEAPS(y): %li", __func__,
                          LEAPS_THRU_END_OF(yg-1), LEAPS_THRU_END_OF(y-1));
                
                /* Adjust days and y to match the guessed year. */
                totaldays -= ((yg - y) * 365
                              + LEAPS_THRU_END_OF (yg - 1)
                              - LEAPS_THRU_END_OF (y - 1));
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: totaldays: %lld", __func__, totaldays);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: totaldays: %" G_GINT64_FORMAT,
+                         __func__, totaldays);
                y = yg;
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: y: %lld", __func__, y);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: y: %" G_GINT64_FORMAT, __func__, y);
        }
        
        system_time->wYear = y;
@@ -3337,7 +3340,7 @@ mono_w32file_filetime_to_systemtime(const FILETIME *file_time, SYSTEMTIME *syste
                continue;
        }
        totaldays-=ip[y];
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: totaldays: %lld", __func__, totaldays);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: totaldays: %" G_GINT64_FORMAT, __func__, totaldays);
        
        system_time->wMonth = y + 1;
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Month: %d", __func__, system_time->wMonth);
@@ -4967,7 +4970,8 @@ LockFile (gpointer handle, guint32 offset_low, guint32 offset_high, guint32 leng
        offset = ((gint64)offset_high << 32) | offset_low;
        length = ((gint64)length_high << 32) | length_low;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Locking handle %p, offset %lld, length %lld", __func__, handle, offset, length);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Locking handle %p, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__,
+                 handle, (gint64) offset, (gint64) length);
 #else
        if (offset_high > 0 || length_high > 0) {
                mono_w32error_set_last (ERROR_INVALID_PARAMETER);
@@ -4976,7 +4980,8 @@ LockFile (gpointer handle, guint32 offset_low, guint32 offset_high, guint32 leng
        offset = offset_low;
        length = length_low;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Locking handle %p, offset %ld, length %ld", __func__, handle, offset, length);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Locking handle %p, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__,
+                 handle, (gint64) offset, (gint64) length);
 #endif
 
        return _wapi_lock_file_region (GPOINTER_TO_UINT(handle), offset, length);
@@ -5004,12 +5009,13 @@ UnlockFile (gpointer handle, guint32 offset_low, guint32 offset_high, guint32 le
        offset = ((gint64)offset_high << 32) | offset_low;
        length = ((gint64)length_high << 32) | length_low;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unlocking handle %p, offset %lld, length %lld", __func__, handle, offset, length);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unlocking handle %p, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__,
+                 handle, (gint64) offset, (gint64) length);
 #else
        offset = offset_low;
        length = length_low;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unlocking handle %p, offset %ld, length %ld", __func__, handle, offset, length);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unlocking handle %p, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__, handle, (gint64) offset, (gint64) length);
 #endif
 
        return _wapi_unlock_file_region (GPOINTER_TO_UINT(handle), offset, length);
index 596af9b321d07ae1945e3e4d46e55a52c5b4d8fb..559939c9b61722492b2738121a798ca189c8a6e9 100644 (file)
@@ -610,7 +610,7 @@ process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
        Process *process;
        gboolean res;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u)", __func__, handle, timeout);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT ")", __func__, handle, timeout);
 
        if (alerted)
                *alerted = FALSE;
@@ -623,21 +623,21 @@ process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
 
        if (process_handle->exited) {
                /* We've already done this one */
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): Process already exited", __func__, handle, timeout);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): Process already exited", __func__, handle, timeout);
                return MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
        }
 
        pid = process_handle->pid;
 
        if (pid == mono_process_current_pid ()) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on current process", __func__, handle, timeout);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): waiting on current process", __func__, handle, timeout);
                return MONO_W32HANDLE_WAIT_RET_TIMEOUT;
        }
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): PID: %d", __func__, handle, timeout, pid);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): PID: %d", __func__, handle, timeout, pid);
 
        if (!process_handle->child) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on non-child process", __func__, handle, timeout);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): waiting on non-child process", __func__, handle, timeout);
 
                if (!process_is_alive (pid)) {
                        /* assume the process has exited */
@@ -645,11 +645,11 @@ process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
                        process_handle->exitstatus = -1;
                        mono_w32handle_set_signal_state (handle, TRUE, TRUE);
 
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process is not alive anymore (2)", __func__, handle, timeout);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): non-child process is not alive anymore (2)", __func__, handle, timeout);
                        return MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
                }
 
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process wait failed, error : %s (%d))", __func__, handle, timeout, g_strerror (errno), errno);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): non-child process wait failed, error : %s (%d))", __func__, handle, timeout, g_strerror (errno), errno);
                return MONO_W32HANDLE_WAIT_RET_FAILED;
        }
 
@@ -663,11 +663,11 @@ process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
 
        while (1) {
                if (timeout != MONO_INFINITE_WAIT) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on semaphore for %li ms...",
-                               __func__, handle, timeout, (long)(timeout - (now - start)));
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): waiting on semaphore for %" G_GINT64_FORMAT " ms...",
+                               __func__, handle, timeout, timeout - (now - start));
                        ret = mono_os_sem_timedwait (&process->exit_sem, (timeout - (now - start)), alerted ? MONO_SEM_FLAGS_ALERTABLE : MONO_SEM_FLAGS_NONE);
                } else {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on semaphore forever...",
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): waiting on semaphore forever...",
                                __func__, handle, timeout);
                        ret = mono_os_sem_wait (&process->exit_sem, alerted ? MONO_SEM_FLAGS_ALERTABLE : MONO_SEM_FLAGS_NONE);
                }
@@ -679,25 +679,25 @@ process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
                }
 
                if (ret == MONO_SEM_TIMEDWAIT_RET_TIMEDOUT) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): wait timeout (timeout = 0)", __func__, handle, timeout);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): wait timeout (timeout = 0)", __func__, handle, timeout);
                        return MONO_W32HANDLE_WAIT_RET_TIMEOUT;
                }
 
                now = mono_msec_ticks ();
                if (now - start >= timeout) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): wait timeout", __func__, handle, timeout);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): wait timeout", __func__, handle, timeout);
                        return MONO_W32HANDLE_WAIT_RET_TIMEOUT;
                }
 
                if (alerted && ret == MONO_SEM_TIMEDWAIT_RET_ALERTED) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): wait alerted", __func__, handle, timeout);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): wait alerted", __func__, handle, timeout);
                        *alerted = TRUE;
                        return MONO_W32HANDLE_WAIT_RET_ALERTED;
                }
        }
 
        /* Process must have exited */
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): Waited successfully", __func__, handle, timeout);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): Waited successfully", __func__, handle, timeout);
 
        status = process->status;
        if (WIFSIGNALED (status))
@@ -709,7 +709,7 @@ process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
 
        process_handle->exited = TRUE;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): Setting pid %d signalled, exit status %d",
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %" G_GUINT32_FORMAT "): Setting pid %d signalled, exit status %d",
                   __func__, handle, timeout, process_handle->pid, process_handle->exitstatus);
 
        mono_w32handle_set_signal_state (handle, TRUE, TRUE);
@@ -1053,7 +1053,7 @@ match_procname_to_modulename (char *procname, char *modulename)
        g_free (pname);
        g_free (mname);
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: result is %d", __func__, result);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: result is %" G_GINT32_FORMAT, __func__, result);
        return result;
 }
 
@@ -1171,10 +1171,10 @@ mono_w32process_module_get_filename (gpointer process, gpointer module, gunichar
        bytes += 2;
 
        if (size < bytes) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d smaller than needed (%zd); truncating", __func__, size, bytes);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %" G_GUINT32_FORMAT " smaller than needed (%zd); truncating", __func__, size, bytes);
                memcpy (basename, proc_path, size);
        } else {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d larger than needed (%zd)", __func__, size, bytes);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %" G_GUINT32_FORMAT " larger than needed (%zd)", __func__, size, bytes);
                memcpy (basename, proc_path, bytes);
        }
 
@@ -1197,7 +1197,7 @@ mono_w32process_module_get_name (gpointer process, gpointer module, gunichar2 *b
        char *pname = NULL;
        gboolean res;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Getting module base name, process handle %p module %p basename %p size %d",
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Getting module base name, process handle %p module %p basename %p size %" G_GUINT32_FORMAT,
                   __func__, process, module, basename, size);
 
        size = size * sizeof (gunichar2); /* adjust for unicode characters */
@@ -1268,11 +1268,11 @@ mono_w32process_module_get_name (gpointer process, gpointer module, gunichar2 *b
                bytes += 2;
 
                if (size < bytes) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d smaller than needed (%zd); truncating", __func__, size, bytes);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %" G_GUINT32_FORMAT " smaller than needed (%zd); truncating", __func__, size, bytes);
 
                        memcpy (basename, procname, size);
                } else {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d larger than needed (%zd)",
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %" G_GUINT32_FORMAT " larger than needed (%zd)",
                                   __func__, size, bytes);
 
                        memcpy (basename, procname, bytes);
@@ -1968,10 +1968,10 @@ process_create (const gunichar2 *appname, const gunichar2 *cmdline,
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: exec()ing [%s] in dir [%s]", __func__, cmd,
                           dir == NULL?".":dir);
                for (i = 0; argv[i] != NULL; i++)
-                       g_message ("arg %d: [%s]", i, argv[i]);
+                       g_message ("arg %" G_GUINT32_FORMAT ": [%s]", i, argv[i]);
 
                for (i = 0; env_strings[i] != NULL; i++)
-                       g_message ("env %d: [%s]", i, env_strings[i]);
+                       g_message ("env %" G_GUINT32_FORMAT ": [%s]", i, env_strings[i]);
 #endif
 
                /* set cwd */
@@ -2753,7 +2753,7 @@ find_pe_file_resources32 (gpointer file_map, guint32 map_size, guint32 res_id, g
        }
 
        if (map_size < sizeof(IMAGE_NT_HEADERS32) + GUINT32_FROM_LE (dos_header->e_lfanew)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File is too small: %d", __func__, map_size);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File is too small: %" G_GUINT32_FORMAT, __func__, map_size);
 
                mono_w32error_set_last (ERROR_BAD_LENGTH);
                return(NULL);
@@ -2825,7 +2825,7 @@ find_pe_file_resources64 (gpointer file_map, guint32 map_size, guint32 res_id, g
        }
 
        if (map_size < sizeof(IMAGE_NT_HEADERS64) + GUINT32_FROM_LE (dos_header->e_lfanew)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File is too small: %d", __func__, map_size);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File is too small: %" G_GUINT32_FORMAT, __func__, map_size);
 
                mono_w32error_set_last (ERROR_BAD_LENGTH);
                return(NULL);
@@ -2958,7 +2958,7 @@ map_pe_file (gunichar2 *filename, gint32 *map_size, void **handle)
 
        /* Check basic file size */
        if (statbuf.st_size < sizeof(IMAGE_DOS_HEADER)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File %s is too small: %lld", __func__, filename_ext, statbuf.st_size);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File %s is too small: %lld", __func__, filename_ext, (long long) statbuf.st_size);
 
                mono_w32error_set_last (ERROR_BAD_LENGTH);
                g_free (filename_ext);
index b887931ac0e37c068ecbe2fd58899c7e60c2dd04..0c1a63db2e7a23b506f0d83c35e1384b50f8e2fd 100644 (file)
@@ -4792,7 +4792,7 @@ set_set_notification_for_wait_completion_flag (StackFrame *frame)
 static MonoMethod* notify_debugger_of_wait_completion_method_cache = NULL;
 
 static MonoMethod*
-get_notify_debugger_of_wait_completion_method ()
+get_notify_debugger_of_wait_completion_method (void)
 {
        if (notify_debugger_of_wait_completion_method_cache != NULL)
                return notify_debugger_of_wait_completion_method_cache;
index 41511ce34b0e1f4e425f455f5d37bf819d0817ff..bd4f6674dfbc0d82273461ef9aabab9b56689604 100644 (file)
@@ -136,7 +136,7 @@ static GSList *bundle_library_paths;
 static char *bundled_dylibrary_directory;
 
 static void
-delete_bundled_libraries ()
+delete_bundled_libraries (void)
 {
        GSList *list;
 
@@ -147,7 +147,7 @@ delete_bundled_libraries ()
 }
 
 static void
-bundle_save_library_initialize ()
+bundle_save_library_initialize (void)
 {
        bundle_save_library_initialized = 1;
        char *path = g_build_filename (g_get_tmp_dir (), "mono-bundle-XXXXXX", NULL);
index 95ebae349c29aa1cbd562a8642ec09a17299c5b1..0d8febaa709eb56721bdc155fab4dd1fc260fb15 100644 (file)
 #include <mono/metadata/handle.h>
 
 static void
-test2_arena_push_pop ()
+test2_arena_push_pop (void)
 {
        HandleStack *h = mono_handle_stack_alloc ();
        mono_handle_stack_free (h);
 }
 
-
-
 int
 main (int argc, const char* argv[])
 {
index 077a85e58f56388f1ab9357ccbfbc5f2ba8cdc4f..5c4c57638c9e6ad560129077f56d1eff334cb12e 100644 (file)
@@ -18,7 +18,7 @@ G_BEGIN_DECLS
 void*
 Mono_Unix_VersionString ()
 {
-       return "MonoProject-2015-12-1";
+       return (void *) "MonoProject-2015-12-1";
 }
 
 gint32