Fix formatting on Wayland and Pipewire function signatures Fixes the formatting on some function signatures that clang-format missed. (cherry picked from commit 378b1c286a9c3206e827a47f0147384e92c4c2b2)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340
diff --git a/src/audio/pipewire/SDL_pipewire.c b/src/audio/pipewire/SDL_pipewire.c
index b32be91..fcb50a4 100644
--- a/src/audio/pipewire/SDL_pipewire.c
+++ b/src/audio/pipewire/SDL_pipewire.c
@@ -205,8 +205,7 @@ static int load_pipewire_syms()
return 0;
}
-SDL_FORCE_INLINE SDL_bool
-pipewire_version_at_least(int major, int minor, int patch)
+SDL_FORCE_INLINE SDL_bool pipewire_version_at_least(int major, int minor, int patch)
{
return (pipewire_version_major >= major) &&
(pipewire_version_major > major || pipewire_version_minor >= minor) &&
@@ -376,8 +375,7 @@ static void io_list_clear()
}
}
-static struct io_node *
-io_list_get_by_id(Uint32 id)
+static struct io_node *io_list_get_by_id(Uint32 id)
{
struct io_node *n, *temp;
spa_list_for_each_safe (n, temp, &hotplug_io_list, link) {
@@ -388,8 +386,7 @@ io_list_get_by_id(Uint32 id)
return NULL;
}
-static struct io_node *
-io_list_get_by_path(char *path)
+static struct io_node *io_list_get_by_path(char *path)
{
struct io_node *n, *temp;
spa_list_for_each_safe (n, temp, &hotplug_io_list, link) {
diff --git a/src/video/wayland/SDL_waylandclipboard.c b/src/video/wayland/SDL_waylandclipboard.c
index efdcc17..7d442a8 100644
--- a/src/video/wayland/SDL_waylandclipboard.c
+++ b/src/video/wayland/SDL_waylandclipboard.c
@@ -89,8 +89,7 @@ int Wayland_SetPrimarySelectionText(_THIS, const char *text)
return status;
}
-char *
-Wayland_GetClipboardText(_THIS)
+char *Wayland_GetClipboardText(_THIS)
{
SDL_VideoData *video_data = NULL;
SDL_WaylandDataDevice *data_device = NULL;
@@ -124,8 +123,7 @@ Wayland_GetClipboardText(_THIS)
return text;
}
-char *
-Wayland_GetPrimarySelectionText(_THIS)
+char *Wayland_GetPrimarySelectionText(_THIS)
{
SDL_VideoData *video_data = NULL;
SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL;
@@ -159,8 +157,7 @@ Wayland_GetPrimarySelectionText(_THIS)
return text;
}
-SDL_bool
-Wayland_HasClipboardText(_THIS)
+SDL_bool Wayland_HasClipboardText(_THIS)
{
SDL_VideoData *video_data = NULL;
SDL_WaylandDataDevice *data_device = NULL;
@@ -180,8 +177,7 @@ Wayland_HasClipboardText(_THIS)
return result;
}
-SDL_bool
-Wayland_HasPrimarySelectionText(_THIS)
+SDL_bool Wayland_HasPrimarySelectionText(_THIS)
{
SDL_VideoData *video_data = NULL;
SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL;
diff --git a/src/video/wayland/SDL_waylanddatamanager.c b/src/video/wayland/SDL_waylanddatamanager.c
index bbcec9a..9971201 100644
--- a/src/video/wayland/SDL_waylanddatamanager.c
+++ b/src/video/wayland/SDL_waylanddatamanager.c
@@ -40,8 +40,7 @@
*/
#define PIPE_MS_TIMEOUT 14
-static ssize_t
-write_pipe(int fd, const void *buffer, size_t total_length, size_t *pos)
+static ssize_t write_pipe(int fd, const void *buffer, size_t total_length, size_t *pos)
{
int ready = 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;
}
-static ssize_t
-read_pipe(int fd, void **buffer, size_t *total_length, SDL_bool null_terminate)
+static ssize_t read_pipe(int fd, void **buffer, size_t *total_length, SDL_bool null_terminate)
{
int ready = 0;
void *output_buffer = NULL;
@@ -148,8 +146,7 @@ static const char *mime_conversion_list[MIME_LIST_SIZE][2] = {
{ "STRING", TEXT_MIME }
};
-const char *
-Wayland_convert_mime_type(const char *mime_type)
+const char *Wayland_convert_mime_type(const char *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);
}
-SDL_bool
-Wayland_data_source_has_mime(SDL_WaylandDataSource *source,
- const char *mime_type)
+SDL_bool Wayland_data_source_has_mime(SDL_WaylandDataSource *source,
+ const char *mime_type)
{
SDL_bool found = SDL_FALSE;
@@ -321,9 +317,8 @@ Wayland_data_source_has_mime(SDL_WaylandDataSource *source,
return found;
}
-SDL_bool
-Wayland_primary_selection_source_has_mime(SDL_WaylandPrimarySelectionSource *source,
- const char *mime_type)
+SDL_bool Wayland_primary_selection_source_has_mime(SDL_WaylandPrimarySelectionSource *source,
+ const char *mime_type)
{
SDL_bool found = SDL_FALSE;
@@ -360,10 +355,9 @@ static void *Wayland_source_get_data(SDL_MimeDataList *mime_data,
return buffer;
}
-void *
-Wayland_data_source_get_data(SDL_WaylandDataSource *source,
- size_t *length, const char *mime_type,
- SDL_bool null_terminate)
+void *Wayland_data_source_get_data(SDL_WaylandDataSource *source,
+ size_t *length, const char *mime_type,
+ SDL_bool null_terminate)
{
SDL_MimeDataList *mime_data = NULL;
void *buffer = NULL;
@@ -379,10 +373,9 @@ Wayland_data_source_get_data(SDL_WaylandDataSource *source,
return buffer;
}
-void *
-Wayland_primary_selection_source_get_data(SDL_WaylandPrimarySelectionSource *source,
- size_t *length, const char *mime_type,
- SDL_bool null_terminate)
+void *Wayland_primary_selection_source_get_data(SDL_WaylandPrimarySelectionSource *source,
+ size_t *length, const char *mime_type,
+ SDL_bool null_terminate)
{
SDL_MimeDataList *mime_data = NULL;
void *buffer = NULL;
@@ -458,10 +451,9 @@ void *Wayland_data_offer_receive(SDL_WaylandDataOffer *offer,
return buffer;
}
-void *
-Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer,
- size_t *length, const char *mime_type,
- SDL_bool null_terminate)
+void *Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer,
+ size_t *length, const char *mime_type,
+ SDL_bool null_terminate)
{
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);
}
-SDL_bool
-Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer,
- const char *mime_type)
+SDL_bool Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer,
+ const char *mime_type)
{
SDL_bool found = SDL_FALSE;
@@ -517,9 +508,8 @@ Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer,
return found;
}
-SDL_bool
-Wayland_primary_selection_offer_has_mime(SDL_WaylandPrimarySelectionOffer *offer,
- const char *mime_type)
+SDL_bool Wayland_primary_selection_offer_has_mime(SDL_WaylandPrimarySelectionOffer *offer,
+ const char *mime_type)
{
SDL_bool found = SDL_FALSE;
diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c
index 827d868..0ce0ecb 100644
--- a/src/video/wayland/SDL_waylandevents.c
+++ b/src/video/wayland/SDL_waylandevents.c
@@ -162,8 +162,7 @@ static void touch_del(SDL_TouchID id, float *x, float *y, struct wl_surface **su
}
}
-static struct wl_surface *
-touch_surface(SDL_TouchID id)
+static struct wl_surface *touch_surface(SDL_TouchID id)
{
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,
};
-SDL_WaylandDataSource *
-Wayland_data_source_create(_THIS)
+SDL_WaylandDataSource *Wayland_data_source_create(_THIS)
{
SDL_WaylandDataSource *data_source = NULL;
SDL_VideoData *driver_data = NULL;
@@ -1445,8 +1443,7 @@ Wayland_data_source_create(_THIS)
return data_source;
}
-SDL_WaylandPrimarySelectionSource *
-Wayland_primary_selection_source_create(_THIS)
+SDL_WaylandPrimarySelectionSource *Wayland_primary_selection_source_create(_THIS)
{
SDL_WaylandPrimarySelectionSource *primary_selection_source = 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
-tablet_tool_btn_to_sdl_button(struct SDL_WaylandTabletInput *input)
+uint32_t 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;
switch (tool_btn) {
@@ -2212,8 +2208,7 @@ static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = {
tablet_tool_handle_frame
};
-struct SDL_WaylandTabletObjectListNode *
-tablet_object_list_new_node(void *object)
+struct SDL_WaylandTabletObjectListNode *tablet_object_list_new_node(void *object)
{
struct SDL_WaylandTabletObjectListNode *node;
diff --git a/src/video/wayland/SDL_waylandkeyboard.c b/src/video/wayland/SDL_waylandkeyboard.c
index 676b536..66eb14a 100644
--- a/src/video/wayland/SDL_waylandkeyboard.c
+++ b/src/video/wayland/SDL_waylandkeyboard.c
@@ -141,8 +141,7 @@ void Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect)
#endif
}
-SDL_bool
-Wayland_HasScreenKeyboardSupport(_THIS)
+SDL_bool Wayland_HasScreenKeyboardSupport(_THIS)
{
/* 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
diff --git a/src/video/wayland/SDL_waylandopengles.c b/src/video/wayland/SDL_waylandopengles.c
index 677a247..72e1e9b 100644
--- a/src/video/wayland/SDL_waylandopengles.c
+++ b/src/video/wayland/SDL_waylandopengles.c
@@ -48,8 +48,7 @@ int Wayland_GLES_LoadLibrary(_THIS, const char *path)
return ret;
}
-SDL_GLContext
-Wayland_GLES_CreateContext(_THIS, SDL_Window *window)
+SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window *window)
{
SDL_GLContext context;
context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *)window->driverdata)->egl_surface);
diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
index 75ee711..d014cfe 100644
--- a/src/video/wayland/SDL_waylandvideo.c
+++ b/src/video/wayland/SDL_waylandvideo.c
@@ -905,8 +905,7 @@ static SDL_bool should_use_libdecor(SDL_VideoData *data, SDL_bool ignore_xdg)
}
#endif
-SDL_bool
-Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg)
+SDL_bool Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg)
{
#ifdef HAVE_LIBDECOR_H
if (data->shell.libdecor != NULL) {
@@ -1114,8 +1113,7 @@ static void Wayland_VideoCleanup(_THIS)
}
}
-SDL_bool
-Wayland_VideoReconnect(_THIS)
+SDL_bool Wayland_VideoReconnect(_THIS)
{
#if 0 /* TODO RECONNECT: Uncomment all when https://invent.kde.org/plasma/kwin/-/wikis/Restarting is completed */
SDL_VideoData *data = _this->driverdata;
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index e6defb8..8c76abb 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -48,8 +48,7 @@
#define FULLSCREEN_MASK (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP)
-SDL_FORCE_INLINE SDL_bool
-FloatEqual(float a, float b)
+SDL_FORCE_INLINE SDL_bool FloatEqual(float a, float b)
{
const float diff = SDL_fabsf(a - 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
-SurfaceScaleIsFractional(SDL_Window *window)
+SDL_FORCE_INLINE SDL_bool SurfaceScaleIsFractional(SDL_Window *window)
{
SDL_WindowData *data = window->driverdata;
return !FloatEqual(SDL_roundf(data->scale_factor), data->scale_factor);
}
-SDL_FORCE_INLINE SDL_bool
-FullscreenModeEmulation(SDL_Window *window)
+SDL_FORCE_INLINE SDL_bool FullscreenModeEmulation(SDL_Window *window)
{
return (window->flags & SDL_WINDOW_FULLSCREEN) &&
((window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP);