From 415bd4fd3ec1d99adb26b1f76b897aab07a4c27f Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 6 Feb 2016 09:47:13 -0600 Subject: [PATCH] Address MinGW compiler warnings (harmless) --- programs/imagex.c | 13 ++++++++----- src/wimboot.c | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/programs/imagex.c b/programs/imagex.c index 48e7d31a..4abcbac2 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -2628,6 +2628,7 @@ print_blobs(WIMStruct *wim) wimlib_iterate_lookup_table(wim, 0, print_resource, NULL); } +#ifndef __WIN32__ static void default_print_security_descriptor(const uint8_t *sd, size_t size) { @@ -2635,6 +2636,7 @@ default_print_security_descriptor(const uint8_t *sd, size_t size) print_byte_field(sd, size); tputchar(T('\n')); } +#endif static void print_dentry_detailed(const struct wimlib_dir_entry *dentry) @@ -4571,16 +4573,17 @@ usage_all(FILE *fp) recommend_man_page(CMD_NONE, fp); } +#ifdef __WIN32__ +extern int wmain(int argc, wchar_t **argv); +#define main wmain +#endif + /* Entry point for wimlib's ImageX implementation. On UNIX the command * arguments will just be 'char' strings (ideally UTF-8 encoded, but could be * something else), while on Windows the command arguments will be UTF-16LE * encoded 'wchar_t' strings. */ int -#ifdef __WIN32__ -wmain(int argc, wchar_t **argv, wchar_t **envp) -#else -main(int argc, char **argv) -#endif +main(int argc, tchar **argv) { int ret; int init_flags = 0; diff --git a/src/wimboot.c b/src/wimboot.c index 467f9fb3..e8fecaf9 100644 --- a/src/wimboot.c +++ b/src/wimboot.c @@ -798,10 +798,10 @@ update_wimoverlay_manually(const wchar_t *drive, const wchar_t *wim_path, wchar_t path_backup[] = L"A:\\System Volume Information\\WimOverlay.backup"; wchar_t path_wimlib_backup[] = L"A:\\System Volume Information\\WimOverlay.wimlib_backup"; wchar_t path_new[] = L"A:\\System Volume Information\\WimOverlay.wimlib_new"; - void *old_contents; - void *new_contents; - u32 new_contents_size; - u64 new_data_source_id; + void *old_contents = NULL; + void *new_contents = NULL; + u32 new_contents_size = 0; + u64 new_data_source_id = -1; int ret; wimlib_assert(drive[0] != L'\0' && -- 2.43.0