From cce975eb77c0e63c69ba55be562f2cde9756e96f Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Sat, 8 Aug 2026 09:19:39 +0100 Subject: [PATCH] Move RB_GENERATE_STATIC to top of file. --- image.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/image.c b/image.c index 3fadd82ac..70e479a27 100644 --- a/image.c +++ b/image.c @@ -101,6 +101,18 @@ static const struct image_backend image_backend_sixel = { sixel_free_output, sixel_geometry_changed }; +/* Compare images by server ID. */ +static int +image_cmp(struct image *a, struct image *b) +{ + if (a->id < b->id) + return (-1); + if (a->id > b->id) + return (1); + return (0); +} +RB_GENERATE_STATIC(images, image, entry, image_cmp); + /* Find the image backend supported by a terminal. */ static const struct image_backend * image_tty_find_backend(struct tty *tty) @@ -164,18 +176,6 @@ image_tty_free(struct tty *tty, int send) tty->image_data = NULL; } -/* Compare images by server ID. */ -static int -image_cmp(struct image *a, struct image *b) -{ - if (a->id < b->id) - return (-1); - if (a->id > b->id) - return (1); - return (0); -} -RB_GENERATE_STATIC(images, image, entry, image_cmp); - /* Average a rectangle of image pixels into one fallback sample. */ static void image_sample(struct image *im, uint64_t sample_x, uint64_t sample_y,