diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-04-17 10:28:27 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-04-17 10:28:27 +0200 |
| commit | 54ef53d4ae90760ecf2faf457d35b737e51eb13f (patch) | |
| tree | a2595813ec1bbdb68d881e5f0de982792204881e /src | |
| parent | 256e368368767da8166fb107b0882a4799f7d53f (diff) | |
Move constant expression out of loop
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 6 |
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; |
