Fixed bug 3806 - Fixes for MSVC compiler warnings
authorSam Lantinga <slouken@libsdl.org>
Fri, 08 Sep 2017 18:26:25 -0700
changeset 11471510e461e584a
parent 11470 b3bb3855bc41
child 11472 f31b73040ea3
Fixed bug 3806 - Fixes for MSVC compiler warnings

Simon Hug

These are the remaining compiler warnings I see in the current tip b3bb3855bc41.

- SDL_test_log.c defines _CRT_SECURE_NO_WARNINGS without checking if it was already set.

- SDL_windowskeyboard.c converts integers to pointers without going over the (U)INT_PTR types. That bothers MSVC.
src/test/SDL_test_log.c
src/video/windows/SDL_windowskeyboard.c
     1.1 --- a/src/test/SDL_test_log.c	Fri Sep 08 07:15:47 2017 -0700
     1.2 +++ b/src/test/SDL_test_log.c	Fri Sep 08 18:26:25 2017 -0700
     1.3 @@ -26,7 +26,7 @@
     1.4  */
     1.5  
     1.6  /* quiet windows compiler warnings */
     1.7 -#if defined(_MSC_VER)
     1.8 +#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
     1.9  # define _CRT_SECURE_NO_WARNINGS
    1.10  #endif
    1.11  
     2.1 --- a/src/video/windows/SDL_windowskeyboard.c	Fri Sep 08 07:15:47 2017 -0700
     2.2 +++ b/src/video/windows/SDL_windowskeyboard.c	Fri Sep 08 18:26:25 2017 -0700
     2.3 @@ -295,11 +295,11 @@
     2.4  #define IMEID_VER(id) ((id) & 0xffff0000)
     2.5  #define IMEID_LANG(id) ((id) & 0x0000ffff)
     2.6  
     2.7 -#define CHT_HKL_DAYI            ((HKL)0xE0060404)
     2.8 -#define CHT_HKL_NEW_PHONETIC    ((HKL)0xE0080404)
     2.9 -#define CHT_HKL_NEW_CHANG_JIE   ((HKL)0xE0090404)
    2.10 -#define CHT_HKL_NEW_QUICK       ((HKL)0xE00A0404)
    2.11 -#define CHT_HKL_HK_CANTONESE    ((HKL)0xE00B0404)
    2.12 +#define CHT_HKL_DAYI            ((HKL)(UINT_PTR)0xE0060404)
    2.13 +#define CHT_HKL_NEW_PHONETIC    ((HKL)(UINT_PTR)0xE0080404)
    2.14 +#define CHT_HKL_NEW_CHANG_JIE   ((HKL)(UINT_PTR)0xE0090404)
    2.15 +#define CHT_HKL_NEW_QUICK       ((HKL)(UINT_PTR)0xE00A0404)
    2.16 +#define CHT_HKL_HK_CANTONESE    ((HKL)(UINT_PTR)0xE00B0404)
    2.17  #define CHT_IMEFILENAME1        "TINTLGNT.IME"
    2.18  #define CHT_IMEFILENAME2        "CINTLGNT.IME"
    2.19  #define CHT_IMEFILENAME3        "MSTCIPHA.IME"
    2.20 @@ -312,7 +312,7 @@
    2.21  #define IMEID_CHT_VER60         (LANG_CHT | MAKEIMEVERSION(6, 0))
    2.22  #define IMEID_CHT_VER_VISTA     (LANG_CHT | MAKEIMEVERSION(7, 0))
    2.23  
    2.24 -#define CHS_HKL                 ((HKL)0xE00E0804)
    2.25 +#define CHS_HKL                 ((HKL)(UINT_PTR)0xE00E0804)
    2.26  #define CHS_IMEFILENAME1        "PINTLGNT.IME"
    2.27  #define CHS_IMEFILENAME2        "MSSCIPYA.IME"
    2.28  #define IMEID_CHS_VER41         (LANG_CHS | MAKEIMEVERSION(4, 1))