From 54ef53d4ae90760ecf2faf457d35b737e51eb13f Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 17 Apr 2023 10:28:27 +0200 Subject: Move constant expression out of loop --- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx index 7c3894440..fe8e75e0a 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx @@ -115,10 +115,10 @@ char *Fl_Wayland_Gl_Window_Driver::alpha_mask_for_string(const char *str, int n, fl_font(f, fs); fl_draw(str, n, 0, fl_height() - fl_descent()); // get the R channel only of the bitmap - char *alpha_buf = new char[w*h], *r = alpha_buf, *q; + char *alpha_buf = new char[w*h], *r = alpha_buf; + struct fl_wld_buffer *off = (struct fl_wld_buffer *)surf->offscreen(); for (int i = 0; i < h; i++) { - struct fl_wld_buffer *off = (struct fl_wld_buffer *)surf->offscreen(); - q = (char*)off->draw_buffer + i * off->stride; + uchar *q = off->draw_buffer + i * off->stride; for (int j = 0; j < w; j++) { *r++ = *q; q += 4; -- cgit v1.2.3