add ifdefs to avoid unnecessary 64bit strtoull() in win32 builds SDL-1.2
authorOzkan Sezer <sezeroz@gmail.com>
Sat, 24 Mar 2018 22:54:16 +0300
branchSDL-1.2
changeset 11974b8aca1c1ad6e
parent 11973 94f71f4d90e9
child 11975 addd798b16a0
add ifdefs to avoid unnecessary 64bit strtoull() in win32 builds
src/video/windib/SDL_dibevents.c
src/video/windx5/SDL_dx5events.c
     1.1 --- a/src/video/windib/SDL_dibevents.c	Sat Mar 24 22:44:12 2018 +0300
     1.2 +++ b/src/video/windib/SDL_dibevents.c	Sat Mar 24 22:54:16 2018 +0300
     1.3 @@ -654,8 +654,10 @@
     1.4  		MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, windowid, -1, windowid_t, SDL_strlen(windowid) + 1);
     1.5  		SDL_Window = (HWND)wcstol(windowid_t, NULL, 0);
     1.6  		SDL_free(windowid_t);
     1.7 +#elif defined(_WIN64)
     1.8 +		SDL_Window = (HWND)SDL_strtoull(windowid, NULL, 0);
     1.9  #else
    1.10 -		SDL_Window = (HWND)((size_t)SDL_strtoull(windowid, NULL, 0));
    1.11 +		SDL_Window = (HWND)SDL_strtoul(windowid, NULL, 0);
    1.12  #endif
    1.13  		if ( SDL_Window == NULL ) {
    1.14  			SDL_SetError("Couldn't get user specified window");
     2.1 --- a/src/video/windx5/SDL_dx5events.c	Sat Mar 24 22:44:12 2018 +0300
     2.2 +++ b/src/video/windx5/SDL_dx5events.c	Sat Mar 24 22:54:16 2018 +0300
     2.3 @@ -947,7 +947,11 @@
     2.4  
     2.5  	SDL_windowid = (windowid != NULL);
     2.6  	if ( SDL_windowid ) {
     2.7 -		SDL_Window = (HWND)((size_t)SDL_strtoull(windowid, NULL, 0));
     2.8 +		#ifdef _WIN64
     2.9 +		SDL_Window = (HWND)SDL_strtoull(windowid, NULL, 0);
    2.10 +		#else
    2.11 +		SDL_Window = (HWND)SDL_strtoul(windowid, NULL, 0);
    2.12 +		#endif
    2.13  		if ( SDL_Window == NULL ) {
    2.14  			SDL_SetError("Couldn't get user specified window");
    2.15  			return(-1);