From 8d5eed3c82fa6f59c4f9d860f1d5c6bbdd837d80 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Jul 2020 18:07:50 -0700 Subject: Convert Fl_Group::array_ to union to better represent its behavior Amended by Albrecht: - rename union member variables as discussed - add comments to new array_ union members Fixes #96 Signed-off-by: Albrecht Schlosser --- FL/Fl_Group.H | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'FL') diff --git a/FL/Fl_Group.H b/FL/Fl_Group.H index 26baf9726..61ae51093 100644 --- a/FL/Fl_Group.H +++ b/FL/Fl_Group.H @@ -41,7 +41,10 @@ class Fl_Rect; */ class FL_EXPORT Fl_Group : public Fl_Widget { - Fl_Widget** array_; + union { + Fl_Widget** array_; // used if group has two or more children or NULL + Fl_Widget* child1_; // used if group has one child or NULL + }; Fl_Widget* savedfocus_; Fl_Widget* resizable_; int children_; -- cgit v1.2.3