From 247e0c42d38ee79c36fc2104c9e93666a29b1b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 28 Jun 2020 08:37:25 +0200 Subject: [PATCH] sixel: add local function sixel_insert() Replace all tll_push_*() calls with calls to this function. --- sixel.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sixel.c b/sixel.c index a4b27416..3c6d67af 100644 --- a/sixel.c +++ b/sixel.c @@ -87,6 +87,12 @@ sixel_erase(struct terminal *term, struct sixel *sixel) sixel_destroy(sixel); } +static void +sixel_insert(struct terminal *term, struct sixel sixel) +{ + tll_push_back(term->grid->sixel_images, sixel); +} + /* Row numbers are absolute */ static void sixel_delete_at_point(struct terminal *term, int row, int col) @@ -284,7 +290,7 @@ sixel_overwrite(struct terminal *term, struct sixel *six, PIXMAN_a8r8g8b8, imgs[i].width, imgs[i].height, imgs[i].data, imgs[i].width * sizeof(uint32_t)); - tll_push_front(term->grid->sixel_images, imgs[i]); + sixel_insert(term, imgs[i]); } } @@ -464,7 +470,7 @@ sixel_unhook(struct terminal *term) term_formfeed(term); render_refresh(term); - tll_push_back(term->grid->sixel_images, image); + sixel_insert(term, image); pixel_row_idx += height; pixel_rows_left -= height;