mirror of
https://github.com/encounter/SDL.git
synced 2025-12-17 00:47:15 +00:00
Fix warnings: static, include, un-initialized vairables
This commit is contained in:
@@ -119,7 +119,7 @@ KMSDRM_CreateCursorBO (SDL_VideoDisplay *display) {
|
||||
}
|
||||
|
||||
/* Remove a cursor buffer from a display's DRM cursor BO. */
|
||||
int
|
||||
static int
|
||||
KMSDRM_RemoveCursorFromBO(SDL_VideoDisplay *display)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -138,7 +138,7 @@ KMSDRM_RemoveCursorFromBO(SDL_VideoDisplay *display)
|
||||
}
|
||||
|
||||
/* Dump a cursor buffer to a display's DRM cursor BO. */
|
||||
int
|
||||
static int
|
||||
KMSDRM_DumpCursorToBO(SDL_VideoDisplay *display, SDL_Cursor *cursor)
|
||||
{
|
||||
SDL_DisplayData *dispdata = (SDL_DisplayData *) display->driverdata;
|
||||
@@ -403,8 +403,6 @@ KMSDRM_WarpMouseGlobal(int x, int y)
|
||||
} else {
|
||||
return SDL_SetError("No mouse or current cursor.");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -48,7 +48,7 @@ extern void KMSDRM_QuitMouse(_THIS);
|
||||
|
||||
extern void KMSDRM_CreateCursorBO(SDL_VideoDisplay *display);
|
||||
extern void KMSDRM_DestroyCursorBO(_THIS, SDL_VideoDisplay *display);
|
||||
extern void KMSDRM_InitCursor();
|
||||
extern void KMSDRM_InitCursor(void);
|
||||
|
||||
#endif /* SDL_KMSDRM_mouse_h_ */
|
||||
|
||||
|
||||
@@ -471,7 +471,7 @@ KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata) {
|
||||
available on the DRM connector of the display.
|
||||
We use the SDL mode list (which we filled in KMSDRM_GetDisplayModes)
|
||||
because it's ordered, while the list on the connector is mostly random.*/
|
||||
drmModeModeInfo*
|
||||
static drmModeModeInfo*
|
||||
KMSDRM_GetClosestDisplayMode(SDL_VideoDisplay * display,
|
||||
uint32_t width, uint32_t height, uint32_t refresh_rate){
|
||||
|
||||
@@ -502,7 +502,8 @@ uint32_t width, uint32_t height, uint32_t refresh_rate){
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Deinitializes the driverdata of the SDL Displays in the SDL display list. */
|
||||
void KMSDRM_DeinitDisplays (_THIS) {
|
||||
static void
|
||||
KMSDRM_DeinitDisplays (_THIS) {
|
||||
|
||||
SDL_DisplayData *dispdata;
|
||||
int num_displays, i;
|
||||
@@ -531,7 +532,8 @@ void KMSDRM_DeinitDisplays (_THIS) {
|
||||
|
||||
/* Gets a DRM connector, builds an SDL_Display with it, and adds it to the
|
||||
list of SDL Displays in _this->displays[] */
|
||||
void KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) {
|
||||
static void
|
||||
KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) {
|
||||
|
||||
SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata);
|
||||
SDL_DisplayData *dispdata = NULL;
|
||||
@@ -719,7 +721,8 @@ cleanup:
|
||||
closed when we get to the end of this function.
|
||||
This is to be called early, in VideoInit(), because it gets us
|
||||
the videomode information, which SDL needs immediately after VideoInit(). */
|
||||
int KMSDRM_InitDisplays (_THIS) {
|
||||
static int
|
||||
KMSDRM_InitDisplays (_THIS) {
|
||||
|
||||
SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata);
|
||||
drmModeRes *resources = NULL;
|
||||
@@ -813,7 +816,7 @@ cleanup:
|
||||
These things are incompatible with Vulkan, which accesses the same resources
|
||||
internally so they must be free when trying to build a Vulkan surface.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
KMSDRM_GBMInit (_THIS, SDL_DisplayData *dispdata)
|
||||
{
|
||||
SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata;
|
||||
@@ -837,7 +840,7 @@ KMSDRM_GBMInit (_THIS, SDL_DisplayData *dispdata)
|
||||
}
|
||||
|
||||
/* Deinit the Vulkan-incompatible KMSDRM stuff. */
|
||||
void
|
||||
static void
|
||||
KMSDRM_GBMDeinit (_THIS, SDL_DisplayData *dispdata)
|
||||
{
|
||||
SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata);
|
||||
@@ -858,7 +861,7 @@ KMSDRM_GBMDeinit (_THIS, SDL_DisplayData *dispdata)
|
||||
viddata->gbm_init = SDL_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
KMSDRM_DestroySurfaces(_THIS, SDL_Window *window)
|
||||
{
|
||||
SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata);
|
||||
|
||||
@@ -182,7 +182,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS,
|
||||
VkInstance instance,
|
||||
VkSurfaceKHR *surface)
|
||||
{
|
||||
VkPhysicalDevice gpu;
|
||||
VkPhysicalDevice gpu = NULL;
|
||||
uint32_t gpu_count;
|
||||
uint32_t display_count;
|
||||
uint32_t mode_count;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "SDL_waylanddatamanager.h"
|
||||
#include "SDL_waylandevents_c.h"
|
||||
#include "SDL_waylandclipboard.h"
|
||||
|
||||
int
|
||||
Wayland_SetClipboardText(_THIS, const char *text)
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <string.h> /* strerr */
|
||||
#include <errno.h>
|
||||
|
||||
#include "SDL_waylandmessagebox.h"
|
||||
|
||||
#define MAX_BUTTONS 8 /* Maximum number of buttons supported */
|
||||
|
||||
int
|
||||
@@ -186,7 +188,6 @@ Wayland_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
||||
return SDL_SetError("Waiting on zenity failed: %s", strerror(errno));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_WAYLAND */
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "SDL_waylandevents_c.h"
|
||||
|
||||
#include "wayland-cursor.h"
|
||||
|
||||
#include "SDL_waylandmouse.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -1693,7 +1693,7 @@ X11_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
|
||||
if (!data->videodata->broken_pointer_grab) {
|
||||
const unsigned int mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask;
|
||||
int attempts;
|
||||
int result;
|
||||
int result = 0;
|
||||
|
||||
/* Try for up to 5000ms (5s) to grab. If it still fails, stop trying. */
|
||||
for (attempts = 0; attempts < 100; attempts++) {
|
||||
|
||||
Reference in New Issue
Block a user