From 75eefbcd42e7117de110f1d77e892912a24fc0a4 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 27 Dec 2018 13:05:35 +0100 Subject: Fixing some minor lint, found by Pavel Shlyak using PVS studio --- fluid/Fl_Menu_Type.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'fluid/Fl_Menu_Type.cxx') diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx index 5e51a6ee2..e4c09be01 100644 --- a/fluid/Fl_Menu_Type.cxx +++ b/fluid/Fl_Menu_Type.cxx @@ -360,27 +360,27 @@ void Fl_Menu_Item_Type::write_code1() { } } - int init = 0; + int menuItemInitialized = 0; // if the name is an array variable, assign the value here if (name() && strchr(name(), '[')) { write_c("%s%s = &%s[%d];\n", indent(), name(), mname, i); } if (image) { - if (!init) { - init = 1; - write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", indent(), mname, i); - } + menuItemInitialized = 1; + write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", indent(), mname, i); image->write_code("o"); } - for (int n=0; n < NUM_EXTRA_CODE; n++) + for (int n=0; n < NUM_EXTRA_CODE; n++) { if (extra_code(n) && !isdeclare(extra_code(n))) { - if (!init) { - init = 1; - write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", indent(), mname, i); + if (!menuItemInitialized) { + menuItemInitialized = 1; + write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", indent(), mname, i); } write_c("%s %s\n", indent(), extra_code(n)); } - if (init) write_c("%s}\n",indent()); + } + if (menuItemInitialized) + write_c("%s}\n",indent()); } void Fl_Menu_Item_Type::write_code2() {} -- cgit v1.2.3