Fix formatting on Wayland and Pipewire function signatures

Fixes the formatting on some function signatures that clang-format missed.

(cherry picked from commit 378b1c286a9c3206e827a47f0147384e92c4c2b2)
This commit is contained in:
Frank Praznik 2022-12-01 18:03:36 -05:00 committed by Sam Lantinga
parent b990e9145b
commit b5483f2c68
8 changed files with 39 additions and 68 deletions

View file

@ -205,8 +205,7 @@ static int load_pipewire_syms()
return 0; return 0;
} }
SDL_FORCE_INLINE SDL_bool SDL_FORCE_INLINE SDL_bool pipewire_version_at_least(int major, int minor, int patch)
pipewire_version_at_least(int major, int minor, int patch)
{ {
return (pipewire_version_major >= major) && return (pipewire_version_major >= major) &&
(pipewire_version_major > major || pipewire_version_minor >= minor) && (pipewire_version_major > major || pipewire_version_minor >= minor) &&
@ -376,8 +375,7 @@ static void io_list_clear()
} }
} }
static struct io_node * static struct io_node *io_list_get_by_id(Uint32 id)
io_list_get_by_id(Uint32 id)
{ {
struct io_node *n, *temp; struct io_node *n, *temp;
spa_list_for_each_safe (n, temp, &hotplug_io_list, link) { spa_list_for_each_safe (n, temp, &hotplug_io_list, link) {
@ -388,8 +386,7 @@ io_list_get_by_id(Uint32 id)
return NULL; return NULL;
} }
static struct io_node * static struct io_node *io_list_get_by_path(char *path)
io_list_get_by_path(char *path)
{ {
struct io_node *n, *temp; struct io_node *n, *temp;
spa_list_for_each_safe (n, temp, &hotplug_io_list, link) { spa_list_for_each_safe (n, temp, &hotplug_io_list, link) {

View file

@ -89,8 +89,7 @@ int Wayland_SetPrimarySelectionText(_THIS, const char *text)
return status; return status;
} }
char * char *Wayland_GetClipboardText(_THIS)
Wayland_GetClipboardText(_THIS)
{ {
SDL_VideoData *video_data = NULL; SDL_VideoData *video_data = NULL;
SDL_WaylandDataDevice *data_device = NULL; SDL_WaylandDataDevice *data_device = NULL;
@ -124,8 +123,7 @@ Wayland_GetClipboardText(_THIS)
return text; return text;
} }
char * char *Wayland_GetPrimarySelectionText(_THIS)
Wayland_GetPrimarySelectionText(_THIS)
{ {
SDL_VideoData *video_data = NULL; SDL_VideoData *video_data = NULL;
SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL;
@ -159,8 +157,7 @@ Wayland_GetPrimarySelectionText(_THIS)
return text; return text;
} }
SDL_bool SDL_bool Wayland_HasClipboardText(_THIS)
Wayland_HasClipboardText(_THIS)
{ {
SDL_VideoData *video_data = NULL; SDL_VideoData *video_data = NULL;
SDL_WaylandDataDevice *data_device = NULL; SDL_WaylandDataDevice *data_device = NULL;
@ -180,8 +177,7 @@ Wayland_HasClipboardText(_THIS)
return result; return result;
} }
SDL_bool SDL_bool Wayland_HasPrimarySelectionText(_THIS)
Wayland_HasPrimarySelectionText(_THIS)
{ {
SDL_VideoData *video_data = NULL; SDL_VideoData *video_data = NULL;
SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL;

View file

@ -40,8 +40,7 @@
*/ */
#define PIPE_MS_TIMEOUT 14 #define PIPE_MS_TIMEOUT 14
static ssize_t static ssize_t write_pipe(int fd, const void *buffer, size_t total_length, size_t *pos)
write_pipe(int fd, const void *buffer, size_t total_length, size_t *pos)
{ {
int ready = 0; int ready = 0;
ssize_t bytes_written = 0; ssize_t bytes_written = 0;
@ -87,8 +86,7 @@ write_pipe(int fd, const void *buffer, size_t total_length, size_t *pos)
return bytes_written; return bytes_written;
} }
static ssize_t static ssize_t read_pipe(int fd, void **buffer, size_t *total_length, SDL_bool null_terminate)
read_pipe(int fd, void **buffer, size_t *total_length, SDL_bool null_terminate)
{ {
int ready = 0; int ready = 0;
void *output_buffer = NULL; void *output_buffer = NULL;
@ -148,8 +146,7 @@ static const char *mime_conversion_list[MIME_LIST_SIZE][2] = {
{ "STRING", TEXT_MIME } { "STRING", TEXT_MIME }
}; };
const char * const char *Wayland_convert_mime_type(const char *mime_type)
Wayland_convert_mime_type(const char *mime_type)
{ {
const char *found = mime_type; const char *found = mime_type;
@ -309,9 +306,8 @@ int Wayland_primary_selection_source_add_data(SDL_WaylandPrimarySelectionSource
return mime_data_list_add(&source->mimes, mime_type, buffer, length); return mime_data_list_add(&source->mimes, mime_type, buffer, length);
} }
SDL_bool SDL_bool Wayland_data_source_has_mime(SDL_WaylandDataSource *source,
Wayland_data_source_has_mime(SDL_WaylandDataSource *source, const char *mime_type)
const char *mime_type)
{ {
SDL_bool found = SDL_FALSE; SDL_bool found = SDL_FALSE;
@ -321,9 +317,8 @@ Wayland_data_source_has_mime(SDL_WaylandDataSource *source,
return found; return found;
} }
SDL_bool SDL_bool Wayland_primary_selection_source_has_mime(SDL_WaylandPrimarySelectionSource *source,
Wayland_primary_selection_source_has_mime(SDL_WaylandPrimarySelectionSource *source, const char *mime_type)
const char *mime_type)
{ {
SDL_bool found = SDL_FALSE; SDL_bool found = SDL_FALSE;
@ -360,10 +355,9 @@ static void *Wayland_source_get_data(SDL_MimeDataList *mime_data,
return buffer; return buffer;
} }
void * void *Wayland_data_source_get_data(SDL_WaylandDataSource *source,
Wayland_data_source_get_data(SDL_WaylandDataSource *source, size_t *length, const char *mime_type,
size_t *length, const char *mime_type, SDL_bool null_terminate)
SDL_bool null_terminate)
{ {
SDL_MimeDataList *mime_data = NULL; SDL_MimeDataList *mime_data = NULL;
void *buffer = NULL; void *buffer = NULL;
@ -379,10 +373,9 @@ Wayland_data_source_get_data(SDL_WaylandDataSource *source,
return buffer; return buffer;
} }
void * void *Wayland_primary_selection_source_get_data(SDL_WaylandPrimarySelectionSource *source,
Wayland_primary_selection_source_get_data(SDL_WaylandPrimarySelectionSource *source, size_t *length, const char *mime_type,
size_t *length, const char *mime_type, SDL_bool null_terminate)
SDL_bool null_terminate)
{ {
SDL_MimeDataList *mime_data = NULL; SDL_MimeDataList *mime_data = NULL;
void *buffer = NULL; void *buffer = NULL;
@ -458,10 +451,9 @@ void *Wayland_data_offer_receive(SDL_WaylandDataOffer *offer,
return buffer; return buffer;
} }
void * void *Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer,
Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer, size_t *length, const char *mime_type,
size_t *length, const char *mime_type, SDL_bool null_terminate)
SDL_bool null_terminate)
{ {
SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL;
@ -505,9 +497,8 @@ int Wayland_primary_selection_offer_add_mime(SDL_WaylandPrimarySelectionOffer *o
return mime_data_list_add(&offer->mimes, mime_type, NULL, 0); return mime_data_list_add(&offer->mimes, mime_type, NULL, 0);
} }
SDL_bool SDL_bool Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer,
Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer, const char *mime_type)
const char *mime_type)
{ {
SDL_bool found = SDL_FALSE; SDL_bool found = SDL_FALSE;
@ -517,9 +508,8 @@ Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer,
return found; return found;
} }
SDL_bool SDL_bool Wayland_primary_selection_offer_has_mime(SDL_WaylandPrimarySelectionOffer *offer,
Wayland_primary_selection_offer_has_mime(SDL_WaylandPrimarySelectionOffer *offer, const char *mime_type)
const char *mime_type)
{ {
SDL_bool found = SDL_FALSE; SDL_bool found = SDL_FALSE;

View file

@ -162,8 +162,7 @@ static void touch_del(SDL_TouchID id, float *x, float *y, struct wl_surface **su
} }
} }
static struct wl_surface * static struct wl_surface *touch_surface(SDL_TouchID id)
touch_surface(SDL_TouchID id)
{ {
struct SDL_WaylandTouchPoint *tp = touch_points.head; struct SDL_WaylandTouchPoint *tp = touch_points.head;
@ -1409,8 +1408,7 @@ static const struct zwp_primary_selection_source_v1_listener primary_selection_s
primary_selection_source_cancelled, primary_selection_source_cancelled,
}; };
SDL_WaylandDataSource * SDL_WaylandDataSource *Wayland_data_source_create(_THIS)
Wayland_data_source_create(_THIS)
{ {
SDL_WaylandDataSource *data_source = NULL; SDL_WaylandDataSource *data_source = NULL;
SDL_VideoData *driver_data = NULL; SDL_VideoData *driver_data = NULL;
@ -1445,8 +1443,7 @@ Wayland_data_source_create(_THIS)
return data_source; return data_source;
} }
SDL_WaylandPrimarySelectionSource * SDL_WaylandPrimarySelectionSource *Wayland_primary_selection_source_create(_THIS)
Wayland_primary_selection_source_create(_THIS)
{ {
SDL_WaylandPrimarySelectionSource *primary_selection_source = NULL; SDL_WaylandPrimarySelectionSource *primary_selection_source = NULL;
SDL_VideoData *driver_data = NULL; SDL_VideoData *driver_data = NULL;
@ -2060,8 +2057,7 @@ static void tablet_tool_handle_proximity_out(void *data, struct zwp_tablet_tool_
} }
} }
uint32_t uint32_t tablet_tool_btn_to_sdl_button(struct SDL_WaylandTabletInput *input)
tablet_tool_btn_to_sdl_button(struct SDL_WaylandTabletInput *input)
{ {
unsigned int tool_btn = input->btn_stylus3 << 2 | input->btn_stylus2 << 1 | input->btn_stylus << 0; unsigned int tool_btn = input->btn_stylus3 << 2 | input->btn_stylus2 << 1 | input->btn_stylus << 0;
switch (tool_btn) { switch (tool_btn) {
@ -2212,8 +2208,7 @@ static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = {
tablet_tool_handle_frame tablet_tool_handle_frame
}; };
struct SDL_WaylandTabletObjectListNode * struct SDL_WaylandTabletObjectListNode *tablet_object_list_new_node(void *object)
tablet_object_list_new_node(void *object)
{ {
struct SDL_WaylandTabletObjectListNode *node; struct SDL_WaylandTabletObjectListNode *node;

View file

@ -141,8 +141,7 @@ void Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect)
#endif #endif
} }
SDL_bool SDL_bool Wayland_HasScreenKeyboardSupport(_THIS)
Wayland_HasScreenKeyboardSupport(_THIS)
{ {
/* In reality we just want to return true when the screen keyboard is the /* In reality we just want to return true when the screen keyboard is the
* _only_ way to get text input. So, in addition to checking for the text * _only_ way to get text input. So, in addition to checking for the text

View file

@ -48,8 +48,7 @@ int Wayland_GLES_LoadLibrary(_THIS, const char *path)
return ret; return ret;
} }
SDL_GLContext SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window *window)
Wayland_GLES_CreateContext(_THIS, SDL_Window *window)
{ {
SDL_GLContext context; SDL_GLContext context;
context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *)window->driverdata)->egl_surface); context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *)window->driverdata)->egl_surface);

View file

@ -905,8 +905,7 @@ static SDL_bool should_use_libdecor(SDL_VideoData *data, SDL_bool ignore_xdg)
} }
#endif #endif
SDL_bool SDL_bool Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg)
Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg)
{ {
#ifdef HAVE_LIBDECOR_H #ifdef HAVE_LIBDECOR_H
if (data->shell.libdecor != NULL) { if (data->shell.libdecor != NULL) {
@ -1114,8 +1113,7 @@ static void Wayland_VideoCleanup(_THIS)
} }
} }
SDL_bool SDL_bool Wayland_VideoReconnect(_THIS)
Wayland_VideoReconnect(_THIS)
{ {
#if 0 /* TODO RECONNECT: Uncomment all when https://invent.kde.org/plasma/kwin/-/wikis/Restarting is completed */ #if 0 /* TODO RECONNECT: Uncomment all when https://invent.kde.org/plasma/kwin/-/wikis/Restarting is completed */
SDL_VideoData *data = _this->driverdata; SDL_VideoData *data = _this->driverdata;

View file

@ -48,8 +48,7 @@
#define FULLSCREEN_MASK (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP) #define FULLSCREEN_MASK (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP)
SDL_FORCE_INLINE SDL_bool SDL_FORCE_INLINE SDL_bool FloatEqual(float a, float b)
FloatEqual(float a, float b)
{ {
const float diff = SDL_fabsf(a - b); const float diff = SDL_fabsf(a - b);
const float largest = SDL_max(SDL_fabsf(a), SDL_fabsf(b)); const float largest = SDL_max(SDL_fabsf(a), SDL_fabsf(b));
@ -118,15 +117,13 @@ static void GetFullScreenDimensions(SDL_Window *window, int *width, int *height,
} }
} }
SDL_FORCE_INLINE SDL_bool SDL_FORCE_INLINE SDL_bool SurfaceScaleIsFractional(SDL_Window *window)
SurfaceScaleIsFractional(SDL_Window *window)
{ {
SDL_WindowData *data = window->driverdata; SDL_WindowData *data = window->driverdata;
return !FloatEqual(SDL_roundf(data->scale_factor), data->scale_factor); return !FloatEqual(SDL_roundf(data->scale_factor), data->scale_factor);
} }
SDL_FORCE_INLINE SDL_bool SDL_FORCE_INLINE SDL_bool FullscreenModeEmulation(SDL_Window *window)
FullscreenModeEmulation(SDL_Window *window)
{ {
return (window->flags & SDL_WINDOW_FULLSCREEN) && return (window->flags & SDL_WINDOW_FULLSCREEN) &&
((window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP); ((window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP);