diff options
author | Nikolay Sivov <nsivov@codeweavers.com> | 2019-07-31 15:18:53 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-07-31 15:18:53 +0300 |
commit | c8fd75734b7f34ed42968bf7ed9b315303b31abc (patch) | |
tree | 693d73144dea377ba62f5248c28c4198a8a18ab6 | |
parent | bed4c00e02400bc49431af8b8095c76caea71220 (diff) |
Fix some compiler warnings for Win32/mingw64 build (#15903)
* [mono] Fix unused variable warning in mono_config_parse().
* [ligc] Fix strict prototype warning for Win32 build.
* Add some casts.
-rw-r--r-- | libgc/include/gc.h | 2 | ||||
-rw-r--r-- | libgc/os_dep.c | 2 | ||||
-rw-r--r-- | mono/metadata/mono-config.c | 20 |
3 files changed, 9 insertions, 15 deletions
diff --git a/libgc/include/gc.h b/libgc/include/gc.h index 960481db876..a31b7071843 100644 --- a/libgc/include/gc.h +++ b/libgc/include/gc.h @@ -1106,7 +1106,7 @@ extern "C" { || defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)) /* win32S may not free all resources on process exit. */ /* This explicitly deallocates the heap. */ - GC_API void GC_win32_free_heap (); + GC_API void GC_win32_free_heap (void); #endif #ifdef __cplusplus diff --git a/libgc/os_dep.c b/libgc/os_dep.c index dca79850754..2c4e3a8ef76 100644 --- a/libgc/os_dep.c +++ b/libgc/os_dep.c @@ -1884,7 +1884,7 @@ word bytes; return(result); } -void GC_win32_free_heap () +void GC_win32_free_heap (void) { if (GC_no_win32_dlls) { while (GC_n_heap_bases > 0) { diff --git a/mono/metadata/mono-config.c b/mono/metadata/mono-config.c index 8c1c6442702..287fa2afc0a 100644 --- a/mono/metadata/mono-config.c +++ b/mono/metadata/mono-config.c @@ -661,35 +661,29 @@ mono_config_for_assembly_internal (MonoImage *assembly) * (or the file in the \c MONO_CONFIG env var). */ void -mono_config_parse (const char *filename) { - const char *home; - char *mono_cfg; -#ifndef TARGET_WIN32 - char *user_cfg; -#endif - +mono_config_parse (const char *filename) +{ if (filename) { mono_config_parse_file (filename); return; } - // FIXME: leak, do we store any references to home - char *env_home = g_getenv ("MONO_CONFIG"); - if (env_home) { - mono_config_parse_file (env_home); + const char *home = g_getenv ("MONO_CONFIG"); + if (home) { + mono_config_parse_file (home); return; } const char *cfg_dir = mono_get_config_dir (); if (cfg_dir) { - mono_cfg = g_build_filename (cfg_dir, "mono", "config", NULL); + char *mono_cfg = g_build_filename (cfg_dir, "mono", "config", (const char *)NULL); mono_config_parse_file (mono_cfg); g_free (mono_cfg); } #if !defined(TARGET_WIN32) home = g_get_home_dir (); - user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, ".mono/config", NULL); + char *user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, ".mono/config", (const char *)NULL); mono_config_parse_file (user_cfg); g_free (user_cfg); #endif |