summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-04-17 10:28:27 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-04-17 10:28:27 +0200
commit54ef53d4ae90760ecf2faf457d35b737e51eb13f (patch)
treea2595813ec1bbdb68d881e5f0de982792204881e /src/drivers
parent256e368368767da8166fb107b0882a4799f7d53f (diff)
Move constant expression out of loop
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx6
1 files changed, 3 insertions, 3 deletions
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;