diff options
| author | Matthias Melcher <github@matthiasm.com> | 2022-01-11 11:56:49 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2022-01-11 11:56:54 +0100 |
| commit | d699b617acb7f525294c531aa5ef48781cd5adf4 (patch) | |
| tree | 8cd4459c17cee02b13ef2de66473959bff50fc23 | |
| parent | 42a93eb8dec6e3c637442e23e156b3f72c7f8ca7 (diff) | |
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.
| -rw-r--r-- | fluid/Fl_Widget_Type.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 80537bb0f..68fb64b38 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/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(); } |
