From a06e4c949d10be51e0d8ce6a6e7bfee6d1ee9a11 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Fri, 6 Jan 2023 18:29:23 -0800 Subject: [PATCH] Move temporary colormap variables to stack allocated in the only routine in which they are used --- src/llcolor.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/llcolor.c b/src/llcolor.c index e36bbf8..e5d8419 100644 --- a/src/llcolor.c +++ b/src/llcolor.c @@ -207,15 +207,15 @@ LispPTR cgfour_change_screen_mode(LispPTR which_screen) By Takeshi */ /*******************************************************************/ -unsigned char RED_colormap; -unsigned char GRN_colormap; -unsigned char BLU_colormap; - #ifdef COLOR LispPTR cgfour_set_colormap(LispPTR args[]) { int index; struct pixrect *ColorFb; + unsigned char RED_colormap; + unsigned char GRN_colormap; + unsigned char BLU_colormap; + index = args[0] & 0xff; @@ -225,6 +225,12 @@ LispPTR cgfour_set_colormap(LispPTR args[]) ColorFb = pr_open("/dev/fb"); + /* + * pr_putcolormap(pr, index, count, red, green, blue) + * struct pixrect *pr; + * int index, count; + * unsigned char red[], green[], blue[]; + */ if (pr_putcolormap(ColorFb, index, 1, &RED_colormap, &GRN_colormap, &BLU_colormap) == -1) perror("putcolormap:"); pr_close(ColorFb);