aports/community/lswt/size_t.patch
2024-10-18 03:34:54 +02:00

98 lines
3.7 KiB
Diff

%ld isn't platform-independent to print a size_t,
use %zd instead - supported in C99 and newer
diff --git a/lswt.c b/lswt.c
index 2b4b2ed..3bbf056 100644
--- a/lswt.c
+++ b/lswt.c
@@ -205,7 +205,7 @@ static struct Toplevel *toplevel_new (void)
new->minimized = false;
if ( mode == WATCH || debug_log )
- fprintf(stdout, "toplevel %ld: created\n", new->id);
+ fprintf(stdout, "toplevel %zd: created\n", new->id);
return new;
}
@@ -214,7 +214,7 @@ static struct Toplevel *toplevel_new (void)
static void toplevel_destroy (struct Toplevel *self)
{
if ( mode == WATCH || debug_log )
- fprintf(stdout, "toplevel %ld: destroyed\n", self->id);
+ fprintf(stdout, "toplevel %zd: destroyed\n", self->id);
if ( self->zwlr_handle != NULL )
zwlr_foreign_toplevel_handle_v1_destroy(self->zwlr_handle);
@@ -235,7 +235,7 @@ static void toplevel_destroy (struct Toplevel *self)
static void toplevel_set_title (struct Toplevel *self, const char *title)
{
if ( mode == WATCH || debug_log )
- fprintf(stdout, "toplevel %ld: set title: '%s' -> '%s'\n",
+ fprintf(stdout, "toplevel %zd: set title: '%s' -> '%s'\n",
self->id, self->title, title);
if ( self->title != NULL )
@@ -250,7 +250,7 @@ static size_t real_strlen (const char *str);
static void toplevel_set_app_id (struct Toplevel *self, const char *app_id)
{
if ( mode == WATCH || debug_log )
- fprintf(stdout, "toplevel %ld: set app-id: '%s' -> '%s'\n",
+ fprintf(stdout, "toplevel %zd: set app-id: '%s' -> '%s'\n",
self->id, self->app_id, app_id);
if ( self->app_id != NULL )
@@ -272,7 +272,7 @@ static void toplevel_set_app_id (struct Toplevel *self, const char *app_id)
static void toplevel_set_identifier (struct Toplevel *self, const char *identifier)
{
if ( mode == WATCH || debug_log )
- fprintf(stdout, "toplevel %ld: set identifier: %s\n",
+ fprintf(stdout, "toplevel %zd: set identifier: %s\n",
self->id, identifier);
if ( self->identifier != NULL )
@@ -292,7 +292,7 @@ static void toplevel_set_identifier (struct Toplevel *self, const char *identifi
static void toplevel_set_fullscreen (struct Toplevel *self, bool fullscreen)
{
if (debug_log)
- fprintf(stdout, "[toplevel %ld: set fullscreen: %d]\n",
+ fprintf(stdout, "[toplevel %zd: set fullscreen: %d]\n",
self->id, fullscreen);
self->fullscreen = fullscreen;
}
@@ -300,7 +300,7 @@ static void toplevel_set_fullscreen (struct Toplevel *self, bool fullscreen)
static void toplevel_set_activated (struct Toplevel *self, bool activated)
{
if (debug_log)
- fprintf(stdout, "[toplevel %ld: set activated: %d]\n",
+ fprintf(stdout, "[toplevel %zd: set activated: %d]\n",
self->id, activated);
self->activated = activated;
}
@@ -308,7 +308,7 @@ static void toplevel_set_activated (struct Toplevel *self, bool activated)
static void toplevel_set_maximized (struct Toplevel *self, bool maximized)
{
if (debug_log)
- fprintf(stdout, "[toplevel %ld: set maximized: %d]\n",
+ fprintf(stdout, "[toplevel %zd: set maximized: %d]\n",
self->id, maximized);
self->maximized = maximized;
}
@@ -316,7 +316,7 @@ static void toplevel_set_maximized (struct Toplevel *self, bool maximized)
static void toplevel_set_minimized (struct Toplevel *self, bool minimized)
{
if (debug_log)
- fprintf(stdout, "[toplevel %ld: set minimized: %d]\n",
+ fprintf(stdout, "[toplevel %zd: set minimized: %d]\n",
self->id, minimized);
self->minimized = minimized;
}
@@ -324,7 +324,7 @@ static void toplevel_set_minimized (struct Toplevel *self, bool minimized)
static void toplevel_done (struct Toplevel *self)
{
if (debug_log)
- fprintf(stderr, "[toplevel %ld: done]\n", self->id);
+ fprintf(stderr, "[toplevel %zd: done]\n", self->id);
if (self->listed)
return;