From d244e8a0972d469650ca0584d3ceb739d777a2cb Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 15 Sep 2025 18:52:14 +0200 Subject: [PATCH] include: pixmapstr.h: inline PixmapBox() and fix signedness Not used anywhere else than just once in this header, so we can directly inline it. Also adding explicit typecast to silence signedness warning. Signed-off-by: Enrico Weigelt, metux IT consult --- include/pixmapstr.h | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/include/pixmapstr.h b/include/pixmapstr.h index 849f09573f..639046257a 100644 --- a/include/pixmapstr.h +++ b/include/pixmapstr.h @@ -97,23 +97,13 @@ typedef struct _PixmapDirtyUpdate { struct pixman_f_transform f_transform, f_inverse; } PixmapDirtyUpdateRec; -static inline void -PixmapBox(BoxPtr box, PixmapPtr pixmap) -{ - box->x1 = 0; - box->x2 = pixmap->drawable.width; - - box->y1 = 0; - box->y2 = pixmap->drawable.height; -} - - static inline void PixmapRegionInit(RegionPtr region, PixmapPtr pixmap) { - BoxRec box; - - PixmapBox(&box, pixmap); + BoxRec box = { + .x2 = (int16_t)pixmap->drawable.width, + .y2 = (int16_t)pixmap->drawable.height, + }; RegionInit(region, &box, 1); }