Workaround for Visual Studio 2019 const warning
Visual Studio 2022, gcc, and clang all agree that "const SDL_DisplayMode **" is a non-const pointer to const data, but Visual Studio 2019 warns about this, so we'll just add a cast to the SDL_free() call for now. Apparently this was a legitimate bug that has been recently fixed: https://stackoverflow.com/questions/10403713/why-does-visual-c-warn-on-implicit-cast-from-const-void-to-void-in-c-but
This commit is contained in:
@@ -138,7 +138,7 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_FRect viewport)
|
||||
column_chars = 0;
|
||||
}
|
||||
}
|
||||
SDL_free(modes);
|
||||
SDL_free((void *)modes);
|
||||
}
|
||||
|
||||
void loop()
|
||||
@@ -212,7 +212,7 @@ void loop()
|
||||
SDL_memcpy(&state->fullscreen_mode, modes[highlighted_mode], sizeof(state->fullscreen_mode));
|
||||
SDL_SetWindowFullscreenMode(window, modes[highlighted_mode]);
|
||||
}
|
||||
SDL_free(modes);
|
||||
SDL_free((void *)modes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user