unicode,INIT_WARGV: add missing cast

CommandLineToArgvW() returns a LPWSTR*, storing to const LPWSTR* is
incorrect without a cast; fixes gcc -Wincompatible-pointer-types
and clang(-cl) -Wincompatible-pointer-types-discads-qualifiers warnings

Change-Id: Iad5b49c4862c7be68251272e50d3c751099559bc
(cherry picked from commit 2b7214ab99)
This commit is contained in:
James Zern 2019-01-23 22:59:48 -08:00
parent 84fdd0d12e
commit fa58371c6a

View File

@ -28,7 +28,8 @@
// Create a wchar_t array containing Unicode parameters. // Create a wchar_t array containing Unicode parameters.
#define INIT_WARGV(ARGC, ARGV) \ #define INIT_WARGV(ARGC, ARGV) \
int wargc; \ int wargc; \
const W_CHAR** const wargv = CommandLineToArgvW(GetCommandLineW(), &wargc); \ const W_CHAR** const wargv = \
(const W_CHAR**)CommandLineToArgvW(GetCommandLineW(), &wargc); \
do { \ do { \
if (wargv == NULL || wargc != (ARGC)) { \ if (wargv == NULL || wargc != (ARGC)) { \
fprintf(stderr, "Error: Unable to get Unicode arguments.\n"); \ fprintf(stderr, "Error: Unable to get Unicode arguments.\n"); \