|
|
commit d699b617acb7f525294c531aa5ef48781cd5adf4
Author: Matthias Melcher <github@matthiasm.com>
AuthorDate: Tue Jan 11 11:56:49 2022 +0100
Commit: Matthias Melcher <github@matthiasm.com>
CommitDate: Tue Jan 11 11:56:54 2022 +0100
Avoiding CodeQL warning.
Changed a statement emitted by Fluid to avoid 'unused'
warnings: if(w){} into (void)w; to avoid triggering 'Bad
error checking' warnings.
fluid/Fl_Widget_Type.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git fluid/Fl_Widget_Type.cxx fluid/Fl_Widget_Type.cxx
index 80537bb..68fb64b 100644
--- fluid/Fl_Widget_Type.cxx
+++ fluid/Fl_Widget_Type.cxx
@@ -2200,7 +2200,9 @@ void Fl_Widget_Type::write_code1() {
indentation++;
- if (wused) write_c("%sw = o; if (w) {/* empty */}\n", indent());
+ // Avoid compiler warning for unused variable.
+ // Also avoid quality control warnings about incorrect allocation error handling.
+ if (wused) write_c("%sw = o; (void)w;\n", indent());
write_widget_code();
}
[ Direct Link to Message ] | |
|
| |