summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-01-27 17:54:49 +0100
committerMatthias Melcher <github@matthiasm.com>2024-01-27 17:54:49 +0100
commit444ee8bc3674002d3aa315ad666638b00f145bed (patch)
tree211b5ef81779704fb174e6bd2a8109acb8042342
parent4123605aabb4f12bdf829df4a2abda40d62028ee (diff)
Fix warning for out of range index.
-rw-r--r--src/fl_boxtype.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx
index 4f446c8ec..708635fbb 100644
--- a/src/fl_boxtype.cxx
+++ b/src/fl_boxtype.cxx
@@ -58,7 +58,9 @@ int Fl::box_shadow_width_ = 3;
*/
int Fl::draw_box_active() { return draw_it_active; }
-const uchar *fl_gray_ramp() {return (draw_it_active?active_ramp:inactive_ramp)-'A';}
+// Note: the pointer that is returned by this function works only with indexes
+// between 65 ('A') and including 88 ('X').
+const uchar *fl_gray_ramp() {return (static_cast<const uchar*>(draw_it_active?active_ramp:inactive_ramp))-'A';}
/**
Gets the drawing color to be used for the background of a box.