diff --git a/src_c/base.c b/src_c/base.c index d4f33c813c..04379ba0f2 100644 --- a/src_c/base.c +++ b/src_c/base.c @@ -81,7 +81,7 @@ static int pg_is_init = 0; static int pg_sdl_was_init = 0; SDL_Window *pg_default_window = NULL; pgSurfaceObject *pg_default_screen = NULL; -static char *pg_env_blend_alpha_SDL2 = NULL; +static int pg_env_blend_alpha_SDL2 = 0; static void pg_install_parachute(void); @@ -170,7 +170,7 @@ static pgSurfaceObject * pg_GetDefaultWindowSurface(void); static void pg_SetDefaultWindowSurface(pgSurfaceObject *); -static char * +static int pg_EnvShouldBlendAlphaSDL2(void); /* compare compiled to linked, raise python error on incompatibility */ @@ -347,7 +347,7 @@ pg_init(PyObject *self, PyObject *_null) pg_sdl_was_init = SDL_Init(PG_INIT_TIMER | PG_INIT_NOPARACHUTE) == 0; #endif - pg_env_blend_alpha_SDL2 = SDL_getenv("PYGAME_BLEND_ALPHA_SDL2"); + pg_env_blend_alpha_SDL2 = SDL_getenv("PYGAME_BLEND_ALPHA_SDL2") != NULL; /* initialize all pygame modules */ for (i = 0; modnames[i]; i++) { @@ -2096,7 +2096,7 @@ pg_SetDefaultConvertFormat(Uint32 format) return pg_default_convert_format; // returns for NULL error checking } -static char * +static int pg_EnvShouldBlendAlphaSDL2(void) { return pg_env_blend_alpha_SDL2; diff --git a/src_c/include/_pygame.h b/src_c/include/_pygame.h index bcfb0fdc8c..8158fe68df 100644 --- a/src_c/include/_pygame.h +++ b/src_c/include/_pygame.h @@ -181,7 +181,7 @@ typedef struct pg_bufferinfo_s { (*(void (*)(pgSurfaceObject *))PYGAMEAPI_GET_SLOT(base, 22)) #define pg_EnvShouldBlendAlphaSDL2 \ - (*(char *(*)(void))PYGAMEAPI_GET_SLOT(base, 23)) + (*(int (*)(void))PYGAMEAPI_GET_SLOT(base, 23)) #define pg_GetDefaultConvertFormat \ (*(SDL_PixelFormat * (*)(void)) PYGAMEAPI_GET_SLOT(base, 27))