Issues found by Cppcheck 1.82

src/io/streamwrite.h:88: (warning) Redundant assignment of 'y' to itself.
src/third_party/gettext/gettext.h:188: (style) The scope of the variable 'translation' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/third_party/gettext/gettext.h:226: (style) The scope of the variable 'translation' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/base/md5.h:77: (warning) Member variable 'MD5Checksum < StreamWrite >::sum' is not initialized in the constructor.
src/logic/map_objects/map_object.h:450: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'lastserial_' a value by passing the value to the constructor in the initialization list.
src/logic/findimmovable.h:66: (style) Value of pointer 'capsule', which points to allocated memory, is copied in copy constructor instead of allocating new memory.
src/economy/trackptr.h:41: (style) class 'Trackable' does not have a copy constructor which is recommended since the class contains a pointer to allocated memory.
src/logic/findnode.h:69: (style) Value of pointer 'capsule', which points to allocated memory, is copied in copy constructor instead of allocating new memory.
src/graphic/color.h:58: (style) Struct 'RGBAColor' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:497: (style) Struct 'ObjectPointer' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/path.h:46: (style) Struct 'Path' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/path.h:48: (style) Struct 'Path' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/path.h:88: (style) Struct 'CoordPath' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/findimmovable.h:80: (style) Struct 'FindImmovable' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/io/fileread.h:40: (style) Struct 'Pos' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/io/filewrite.h:39: (style) Struct 'Pos' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/tribes/worker.h:269: (style) Struct 'PlaceToScout' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/tribes/requirements.h:83: (style) Struct 'Requirements' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/findnode.h:83: (style) Struct 'FindNode' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/checkstep.h:75: (style) Struct 'CheckStep' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/checkstep.h:51: (style) Struct 'Capsule' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/checkstep.h:125: (style) Struct 'CheckStepDefault' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < PlayerImmovable >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Carrier >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Worker >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < PortDock >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < WareInstance >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/economy/trackptr.h:97: (warning) The class 'BaseTrackPtr' has 'copy constructor' but lack of 'operator='.
src/base/md5.h:75: (warning) The class 'MD5Checksum < StreamWrite >' has 'copy constructor' but lack of 'operator='.
src/ai/computer_player.h:70: (performance) Parameter 'init_name' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/ai/computer_player.h:71: (performance) Parameter 'init_descname' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/ai/computer_player.h:72: (performance) Parameter 'init_icon_filename' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/ai/defaultai.cc:1281: (style) The scope of the variable 'kBuildableSpotsCheckArea' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/ai/defaultai.cc:541: (warning) Non-pure function: 'get_military_number_at' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:542: (warning) Non-pure function: 'get_military_number_at' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:862: (warning) Non-pure function: 'count_buildings_with_attribute' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:863: (warning) Non-pure function: 'count_buildings_with_attribute' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:864: (warning) Non-pure function: 'count_buildings_with_attribute' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:865: (warning) Non-pure function: 'count_buildings_with_attribute' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:866: (warning) Non-pure function: 'count_buildings_with_attribute' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:867: (warning) Non-pure function: 'count_buildings_with_attribute' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:868: (warning) Non-pure function: 'count_buildings_with_attribute' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:870: (warning) Non-pure function: 'count_buildings_with_attribute' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:1581: (warning) Non-pure function: 'players_in_same_team' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:1605: (warning) Non-pure function: 'get_is_enemy' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai.cc:2508: (warning) Non-pure function: 'aimode_limit_status' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ai/defaultai_seafaring.cc:226: (warning) Comparison of a boolean expression with an integer.
src/economy/fleet.h:128] -> [src/logic/map_objects/map_object.h:424: (warning) The struct 'Fleet' defines member variable with name 'owner_' also defined in its parent class 'MapObject'.
src/ai/defaultai_warfare.cc:250] -> [src/ai/defaultai_warfare.cc:373: (style) Condition 'own_power_growth>105' is always false
src/ai/defaultai_warfare.cc:250] -> [src/ai/defaultai_warfare.cc:374: (style) Condition 'own_power_growth>110' is always false
src/ai/defaultai_warfare.cc:250] -> [src/ai/defaultai_warfare.cc:375: (style) Condition 'own_power_growth>115' is always false
src/ai/defaultai_warfare.cc:250] -> [src/ai/defaultai_warfare.cc:376: (style) Condition 'own_power_growth>120' is always false
src/ai/defaultai_warfare.cc:250] -> [src/ai/defaultai_warfare.cc:377: (style) Condition 'own_power_growth<95' is always true
src/ai/defaultai_warfare.cc:250] -> [src/ai/defaultai_warfare.cc:378: (style) Condition 'own_power_growth<90' is always true
src/ai/defaultai_warfare.cc:250] -> [src/ai/defaultai_warfare.cc:379: (style) Condition 'own_power_growth<85' is always true
src/ai/defaultai_warfare.cc:250] -> [src/ai/defaultai_warfare.cc:380: (style) Condition 'own_power_growth<80' is always true
src/ai/defaultai_warfare.cc:288: (style) Finding the same expression in both branches of ternary operator is suspicious as the same code is executed regardless of the condition.
src/ai/defaultai_warfare.cc:917: (style) The scope of the variable 'health' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/ai/defaultai_warfare.cc:918: (style) The scope of the variable 'attack' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/ai/defaultai_warfare.cc:919: (style) The scope of the variable 'defense' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/ai/defaultai_warfare.cc:920: (style) The scope of the variable 'evade' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/base/i18n.cc:243: (style) Variable 'alt_str' is assigned a value that is never used.
src/base/i18n.cc:70: (information) Skipping configuration 'DEFAULT_TEXT_DOMAIN' since the value of 'DEFAULT_TEXT_DOMAIN' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/base/i18n.cc:73: (information) Skipping configuration 'DEFAULT_TEXT_DOMAIN' since the value of 'DEFAULT_TEXT_DOMAIN' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/base/md5.h:77: (warning) Member variable 'MD5Checksum::sum' is not initialized in the constructor.
src/base/md5.h:75: (warning) The class 'MD5Checksum' has 'copy constructor' but lack of 'operator='.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Flag >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/economy/economy.cc:354: (warning) Non-pure function: 'egbase' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/economy/economy.cc:403: (warning) Non-pure function: 'has_request' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/economy/test/test_routing.cc:189: (style) struct 'TestingNodeDefaultNodesFixture' does not have a copy constructor which is recommended since the class contains a pointer to allocated memory.
src/economy/test/test_routing.cc:231: (style) struct 'SimpleRouterFixture' does not have a copy constructor which is recommended since the class contains a pointer to allocated memory.
src/economy/test/test_routing.cc:378: (style) struct 'ComplexRouterFixture' does not have a copy constructor which is recommended since the class contains a pointer to allocated memory.
src/economy/transfer.cc:194: (warning) Non-pure function: 'get_flag' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/economy/transfer.cc:199: (warning) Non-pure function: 'get_flag' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/economy/workers_queue.cc:82: (warning) Non-pure function: 'get_location' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/economy/workers_queue.cc:133: (warning) Non-pure function: 'get_location' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/economy/workers_queue.cc:146: (warning) Non-pure function: 'get_location' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ui_basic/table.h:127: (style) The class 'Table < void * >' does not have a constructor although it has private member variables. Member variables of builtin types are left uninitialized when the class is instantiated. That may cause bugs or undefined behavior.
src/editor/tools/tool_action.h:64: (style) Value of pointer 'args', which points to allocated memory, is copied in copy constructor instead of allocating new memory.
src/wui/mapdata.h:49: (style) Struct 'MapAuthorData' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/editor/tools/tool_action.h:34: (warning) The struct 'EditorToolAction' has 'copy constructor' but lack of 'operator='.
src/editor/map_generator.cc:811] -> [src/editor/map_generator.cc:819: (warning) Opposite inner 'if' condition leads to a dead code block (outer condition is 'ch<'O'' and inner condition is 'ch>'O'').
src/logic/map_objects/map_object.h:535: (style) Struct 'OPtr' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/editor/tools/info_tool.cc:187: (error) Memory leak: multiline_textarea
src/third_party/minizip/ioapi.h:45: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/ioapi.h:46: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/ioapi.h:47: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/ioapi.h:49: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/ioapi.h:50: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/ioapi.h:52: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/ioapi.h:53: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/editor/ui_menus/categorized_item_selection_menu.h:54: (performance) Parameter 'select_correct_tool' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/editor/ui_menus/toolsize_menu.cc:89: (warning) Non-pure function: 'eia' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/editor/ui_menus/toolsize_menu.cc:93: (warning) Non-pure function: 'eia' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/graphic/text/font_io.cc:53] -> [src/graphic/text/font_io.cc:56: (warning) Identical condition '!font', second condition is always false
src/graphic/text/rendered_text.cc:58: (warning) Member variable 'RenderedRect::permanent_image_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:58: (warning) Member variable 'RenderedRect::visited_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:58: (warning) Member variable 'RenderedRect::is_background_color_set_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:58: (warning) Member variable 'RenderedRect::mode_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:61: (warning) Member variable 'RenderedRect::permanent_image_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:61: (warning) Member variable 'RenderedRect::visited_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:61: (warning) Member variable 'RenderedRect::is_background_color_set_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:61: (warning) Member variable 'RenderedRect::mode_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:64: (warning) Member variable 'RenderedRect::permanent_image_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:64: (warning) Member variable 'RenderedRect::visited_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:64: (warning) Member variable 'RenderedRect::is_background_color_set_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:64: (warning) Member variable 'RenderedRect::mode_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:72: (warning) Member variable 'RenderedRect::permanent_image_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:72: (warning) Member variable 'RenderedRect::visited_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:72: (warning) Member variable 'RenderedRect::is_background_color_set_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:72: (warning) Member variable 'RenderedRect::mode_' is not initialized in the constructor.
src/graphic/text/rendered_text.cc:30: (performance) Parameter 'init_image' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rendered_text.cc:64: (performance) Parameter 'init_image' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rt_render.cc:968: (performance) Parameter 'ns' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rt_render.cc:1103: (performance) Parameter 'ns' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rt_render.cc:1135: (performance) Parameter 'ns' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rt_render.cc:1189: (performance) Parameter 'ns' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rt_render.cc:1235: (performance) Parameter 'ns' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rt_render.cc:1260: (performance) Parameter 'ns' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rt_render.cc:1322: (performance) Parameter 'ns' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rt_render.cc:1338: (performance) Parameter 'ns' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text/rt_render.cc:1509: (performance) Parameter 'ns' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
src/graphic/text_parser.h:125: (warning) The struct 'RichtextBlock' has 'copy constructor' but lack of 'operator='.
src/io/filesystem/filesystem.cc:202: (performance) Either inefficient or wrong usage of string::find(). string::compare() will be faster if string::find's result is compared with 0, because it will not scan the whole string. If your intention is to check that there are no findings in the string, you should compare with std::string::npos.
src/io/filesystem/filesystem.cc:358: (information) Skipping configuration 'ELOOP' since the value of 'ELOOP' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/io/filesystem/zip_filesystem.cc:376: (performance) The conversion from const char* as returned by c_str() to std::string creates an unnecessary string copy. Solve that by directly passing the string.
src/io/streamread.cc:96: (warning) Redundant assignment of 'x' to itself.
src/logic/map_objects/bob.cc:236: (warning) Non-pure function: 'get_state' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/map_objects/bob.cc:549: (error) Memory leak: state.path
src/logic/map_objects/bob.cc:569: (error) Memory leak: state.path
src/logic/map_objects/immovable.cc:258: (warning) Member variable 'ImmovableDescr::size_' is not initialized in the constructor.
src/logic/map_objects/immovable.cc:258: (warning) Member variable 'ImmovableDescr::owner_type_' is not initialized in the constructor.
src/logic/map_objects/immovable.cc:278: (warning) Member variable 'ImmovableDescr::size_' is not initialized in the constructor.
src/logic/map_objects/immovable.cc:278: (warning) Member variable 'ImmovableDescr::owner_type_' is not initialized in the constructor.
src/logic/map_objects/immovable.cc:278: (warning) Member variable 'ImmovableDescr::editor_category_' is not initialized in the constructor.
src/logic/map_objects/map_object.cc:226: (warning) Member variable 'MapObjectDescr::type_' is not initialized in the constructor.
src/logic/map_objects/tribes/carrier.cc:173: (warning) Non-pure function: 'get_location' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/map_objects/tribes/market.cc:174: (warning) Non-pure function: 'is_ready_to_launch_batch' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/map_objects/tribes/market.cc:183: (warning) Non-pure function: 'is_idle' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/map_objects/tribes/ship.h:260: (style) Unused private function: 'Ship::ship_update'
src/logic/map_objects/tribes/ship.h:268: (style) Unused private function: 'Ship::set_fleet'
src/logic/map_objects/tribes/trainingsite.cc:407: (style) Condition 'soldiers_.size()>=capacity_' is always true
src/logic/map_objects/tribes/trainingsite.cc:308: (warning) Non-pure function: 'get_state' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/map_objects/tribes/trainingsite.cc:433: (warning) Non-pure function: 'get_location' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/map_objects/tribes/warehouse.cc:1336: (warning) Non-pure function: 'expedition_bootstrap' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/map_objects/tribes/warehouse.cc:373: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'next_stock_remove_act_' a value by passing the value to the constructor in the initialization list.
src/logic/map_objects/tribes/warehouse.cc:1107: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code.
src/logic/map_objects/tribes/worker.cc:2070: (warning) Non-pure function: 'base_flag' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/map_objects/world/critter.h:90: (style) Unused private function: 'Critter::roam_update'
src/logic/map_objects/world/critter.h:91: (style) Unused private function: 'Critter::program_update'
src/logic/map_objects/world/critter.h:93: (style) Unused private function: 'Critter::run_remove'
src/logic/player.cc:1136: (warning) Non-pure function: 'egbase' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/player.cc:1137: (warning) Non-pure function: 'egbase' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/player.cc:1138: (warning) Non-pure function: 'egbase' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/player.cc:1171: (warning) Non-pure function: 'egbase' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/player.cc:1172: (warning) Non-pure function: 'egbase' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/player.cc:1180: (warning) Non-pure function: 'egbase' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/player.cc:1198: (warning) Non-pure function: 'egbase' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/player.cc:1199: (warning) Non-pure function: 'egbase' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/logic/player.cc:971: (warning) Result of operator '|' is always true if one operand is non-zero. Did you intend to use '&'?
src/logic/player.cc:973: (warning) Result of operator '|' is always true if one operand is non-zero. Did you intend to use '&'?
src/logic/player.cc:975: (warning) Result of operator '|' is always true if one operand is non-zero. Did you intend to use '&'?
src/logic/playercommand.cc:1813: (warning) Member variable 'CmdProposeTrade::trade_' is not initialized in the constructor.
src/logic/playercommand.cc:265: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'bi' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:485: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:527: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:581: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:624: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:672: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:714: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:758: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:819: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:877: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:937: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:982: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:1165: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial_' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:1426: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:1479: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:1531: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'serial' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:1727: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'warehouse_' a value by passing the value to the constructor in the initialization list.
src/logic/playercommand.cc:1765: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'warehouse_' a value by passing the value to the constructor in the initialization list.
src/map_io/map_flagdata_packet.cc:168: (warning) Non-pure function: 'is_object_saved' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/map_io/map_flagdata_packet.cc:206: (warning) Non-pure function: 'get_state' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/map_io/map_flagdata_packet.cc:207: (warning) Non-pure function: 'get_state' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/map_io/map_object_packet.h:46: (warning) Non-pure function: 'get_object' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/map_io/map_players_messages_packet.cc:115: (warning) Non-pure function: 'is_object_known' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/map_io/map_players_messages_packet.cc:117: (warning) Non-pure function: 'is_object_loaded' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/map_io/map_players_view_packet.cc:607: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:612: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:638: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:643: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:717: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:752: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:950: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:960: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:978: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:988: (style) Suspicious expression. Boolean result is used in bitwise operation. The operator '!' and the comparison operators have higher precedence than bitwise operators. It is recommended that the expression is clarified with parentheses.
src/map_io/map_players_view_packet.cc:303: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:401: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:434: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:439: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:443: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:446: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:449: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:454: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:459: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:462: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:465: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:469: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:472: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:475: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:475: (warning) %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed char'.
src/map_io/map_players_view_packet.cc:1014: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1016: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1019: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1022: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1024: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1026: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1029: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1032: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1034: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1036: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1039: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1041: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1043: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/map_players_view_packet.cc:1045: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'Widelands::PlayerNumber'.
src/map_io/s2map.cc:53: (style) struct member 'S2MapDescrHeader::magic' is never used.
src/map_io/s2map.cc:61: (style) struct member 'S2MapDescrHeader::bulk' is never used.
src/network/netrelayconnection.h:73: (style) Class 'Peeker' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/network/gamehost.cc:858: (style) The scope of the variable 'client' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/network/internet_gaming.cc:453: (information) Skipping configuration 'DEFAULT_TEXT_DOMAIN' since the value of 'DEFAULT_TEXT_DOMAIN' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/scripting/lua_bases.h:90: (performance) When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'player_number_' a value by passing the value to the constructor in the initialization list.
src/scripting/lua_editor.h:36] -> [src/scripting/lua_bases.h:82: (warning) The class 'LuaPlayer' defines member variable with name 'className' also defined in its parent class 'LuaPlayerBase'.
src/scripting/lua_editor.h:36] -> [src/scripting/lua_bases.h:82: (warning) The class 'LuaPlayer' defines member variable with name 'Methods' also defined in its parent class 'LuaPlayerBase'.
src/scripting/lua_editor.h:36] -> [src/scripting/lua_bases.h:82: (warning) The class 'LuaPlayer' defines member variable with name 'Properties' also defined in its parent class 'LuaPlayerBase'.
src/scripting/lua_game.h:55] -> [src/scripting/lua_bases.h:82: (warning) The class 'LuaPlayer' defines member variable with name 'className' also defined in its parent class 'LuaPlayerBase'.
src/scripting/lua_game.h:55] -> [src/scripting/lua_bases.h:82: (warning) The class 'LuaPlayer' defines member variable with name 'Methods' also defined in its parent class 'LuaPlayerBase'.
src/scripting/lua_game.h:55] -> [src/scripting/lua_bases.h:82: (warning) The class 'LuaPlayer' defines member variable with name 'Properties' also defined in its parent class 'LuaPlayerBase'.
src/scripting/lua_map.h:225] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaImmovableDescription' defines member variable with name 'className' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:225] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaImmovableDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:225] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaImmovableDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:267] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaBuildingDescription' defines member variable with name 'className' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:267] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaBuildingDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:267] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaBuildingDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:317] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaConstructionSiteDescription' defines member variable with name 'className' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:317] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaConstructionSiteDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:317] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaConstructionSiteDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:337] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaDismantleSiteDescription' defines member variable with name 'className' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:337] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaDismantleSiteDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:337] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaDismantleSiteDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:357] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaProductionSiteDescription' defines member variable with name 'className' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:357] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaProductionSiteDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:357] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaProductionSiteDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:398] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaMilitarySiteDescription' defines member variable with name 'className' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:398] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaMilitarySiteDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:398] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaMilitarySiteDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:431] -> [src/scripting/lua_map.h:357: (warning) The class 'LuaTrainingSiteDescription' defines member variable with name 'className' also defined in its parent class 'LuaProductionSiteDescription'.
src/scripting/lua_map.h:431] -> [src/scripting/lua_map.h:357: (warning) The class 'LuaTrainingSiteDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaProductionSiteDescription'.
src/scripting/lua_map.h:431] -> [src/scripting/lua_map.h:357: (warning) The class 'LuaTrainingSiteDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaProductionSiteDescription'.
src/scripting/lua_map.h:479] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaWarehouseDescription' defines member variable with name 'className' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:479] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaWarehouseDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:479] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaWarehouseDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:511] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaMarketDescription' defines member variable with name 'className' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:511] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaMarketDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:511] -> [src/scripting/lua_map.h:267: (warning) The class 'LuaMarketDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaBuildingDescription'.
src/scripting/lua_map.h:542] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaWareDescription' defines member variable with name 'className' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:542] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaWareDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:542] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaWareDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:579] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaWorkerDescription' defines member variable with name 'className' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:579] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaWorkerDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:579] -> [src/scripting/lua_map.h:170: (warning) The class 'LuaWorkerDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaMapObjectDescription'.
src/scripting/lua_map.h:618] -> [src/scripting/lua_map.h:579: (warning) The class 'LuaSoldierDescription' defines member variable with name 'className' also defined in its parent class 'LuaWorkerDescription'.
src/scripting/lua_map.h:618] -> [src/scripting/lua_map.h:579: (warning) The class 'LuaSoldierDescription' defines member variable with name 'Methods' also defined in its parent class 'LuaWorkerDescription'.
src/scripting/lua_map.h:618] -> [src/scripting/lua_map.h:579: (warning) The class 'LuaSoldierDescription' defines member variable with name 'Properties' also defined in its parent class 'LuaWorkerDescription'.
src/scripting/lua_map.h:865] -> [src/scripting/lua_map.h:825: (warning) The class 'LuaBaseImmovable' defines member variable with name 'className' also defined in its parent class 'LuaMapObject'.
src/scripting/lua_map.h:865] -> [src/scripting/lua_map.h:825: (warning) The class 'LuaBaseImmovable' defines member variable with name 'Methods' also defined in its parent class 'LuaMapObject'.
src/scripting/lua_map.h:865] -> [src/scripting/lua_map.h:825: (warning) The class 'LuaBaseImmovable' defines member variable with name 'Properties' also defined in its parent class 'LuaMapObject'.
src/scripting/lua_map.h:893] -> [src/scripting/lua_map.h:865: (warning) The class 'LuaPlayerImmovable' defines member variable with name 'className' also defined in its parent class 'LuaBaseImmovable'.
src/scripting/lua_map.h:893] -> [src/scripting/lua_map.h:865: (warning) The class 'LuaPlayerImmovable' defines member variable with name 'Methods' also defined in its parent class 'LuaBaseImmovable'.
src/scripting/lua_map.h:893] -> [src/scripting/lua_map.h:865: (warning) The class 'LuaPlayerImmovable' defines member variable with name 'Properties' also defined in its parent class 'LuaBaseImmovable'.
src/scripting/lua_map.h:922] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaPortDock' defines member variable with name 'className' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:922] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaPortDock' defines member variable with name 'Methods' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:922] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaPortDock' defines member variable with name 'Properties' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:949] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaBuilding' defines member variable with name 'className' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:949] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaBuilding' defines member variable with name 'Methods' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:949] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaBuilding' defines member variable with name 'Properties' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:977] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaFlag' defines member variable with name 'className' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:977] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaFlag' defines member variable with name 'Methods' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:977] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaFlag' defines member variable with name 'Properties' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:1008] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaRoad' defines member variable with name 'className' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:1008] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaRoad' defines member variable with name 'Methods' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:1008] -> [src/scripting/lua_map.h:893: (warning) The class 'LuaRoad' defines member variable with name 'Properties' also defined in its parent class 'LuaPlayerImmovable'.
src/scripting/lua_map.h:1045] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaConstructionSite' defines member variable with name 'className' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1045] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaConstructionSite' defines member variable with name 'Methods' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1045] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaConstructionSite' defines member variable with name 'Properties' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1073] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaWarehouse' defines member variable with name 'className' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1073] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaWarehouse' defines member variable with name 'Methods' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1073] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaWarehouse' defines member variable with name 'Properties' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1112] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaMarket' defines member variable with name 'className' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1112] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaMarket' defines member variable with name 'Methods' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1112] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaMarket' defines member variable with name 'Properties' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1140] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaProductionSite' defines member variable with name 'className' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1140] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaProductionSite' defines member variable with name 'Methods' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1140] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaProductionSite' defines member variable with name 'Properties' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1176] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaMilitarySite' defines member variable with name 'className' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1176] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaMilitarySite' defines member variable with name 'Methods' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1176] -> [src/scripting/lua_map.h:949: (warning) The class 'LuaMilitarySite' defines member variable with name 'Properties' also defined in its parent class 'LuaBuilding'.
src/scripting/lua_map.h:1206] -> [src/scripting/lua_map.h:1140: (warning) The class 'LuaTrainingSite' defines member variable with name 'className' also defined in its parent class 'LuaProductionSite'.
src/scripting/lua_map.h:1206] -> [src/scripting/lua_map.h:1140: (warning) The class 'LuaTrainingSite' defines member variable with name 'Methods' also defined in its parent class 'LuaProductionSite'.
src/scripting/lua_map.h:1206] -> [src/scripting/lua_map.h:1140: (warning) The class 'LuaTrainingSite' defines member variable with name 'Properties' also defined in its parent class 'LuaProductionSite'.
src/scripting/lua_map.h:1236] -> [src/scripting/lua_map.h:825: (warning) The class 'LuaBob' defines member variable with name 'className' also defined in its parent class 'LuaMapObject'.
src/scripting/lua_map.h:1236] -> [src/scripting/lua_map.h:825: (warning) The class 'LuaBob' defines member variable with name 'Methods' also defined in its parent class 'LuaMapObject'.
src/scripting/lua_map.h:1236] -> [src/scripting/lua_map.h:825: (warning) The class 'LuaBob' defines member variable with name 'Properties' also defined in its parent class 'LuaMapObject'.
src/scripting/lua_map.h:1265] -> [src/scripting/lua_map.h:1236: (warning) The class 'LuaWorker' defines member variable with name 'className' also defined in its parent class 'LuaBob'.
src/scripting/lua_map.h:1265] -> [src/scripting/lua_map.h:1236: (warning) The class 'LuaWorker' defines member variable with name 'Methods' also defined in its parent class 'LuaBob'.
src/scripting/lua_map.h:1265] -> [src/scripting/lua_map.h:1236: (warning) The class 'LuaWorker' defines member variable with name 'Properties' also defined in its parent class 'LuaBob'.
src/scripting/lua_map.h:1294] -> [src/scripting/lua_map.h:1265: (warning) The class 'LuaSoldier' defines member variable with name 'className' also defined in its parent class 'LuaWorker'.
src/scripting/lua_map.h:1294] -> [src/scripting/lua_map.h:1265: (warning) The class 'LuaSoldier' defines member variable with name 'Methods' also defined in its parent class 'LuaWorker'.
src/scripting/lua_map.h:1294] -> [src/scripting/lua_map.h:1265: (warning) The class 'LuaSoldier' defines member variable with name 'Properties' also defined in its parent class 'LuaWorker'.
src/scripting/lua_map.h:1325] -> [src/scripting/lua_map.h:1236: (warning) The class 'LuaShip' defines member variable with name 'className' also defined in its parent class 'LuaBob'.
src/scripting/lua_map.h:1325] -> [src/scripting/lua_map.h:1236: (warning) The class 'LuaShip' defines member variable with name 'Methods' also defined in its parent class 'LuaBob'.
src/scripting/lua_map.h:1325] -> [src/scripting/lua_map.h:1236: (warning) The class 'LuaShip' defines member variable with name 'Properties' also defined in its parent class 'LuaBob'.
src/scripting/lua_root.h:41] -> [src/scripting/lua_bases.h:42: (warning) The class 'LuaGame' defines member variable with name 'className' also defined in its parent class 'LuaEditorGameBase'.
src/scripting/lua_root.h:41] -> [src/scripting/lua_bases.h:42: (warning) The class 'LuaGame' defines member variable with name 'Methods' also defined in its parent class 'LuaEditorGameBase'.
src/scripting/lua_root.h:41] -> [src/scripting/lua_bases.h:42: (warning) The class 'LuaGame' defines member variable with name 'Properties' also defined in its parent class 'LuaEditorGameBase'.
src/scripting/lua_root.h:78] -> [src/scripting/lua_bases.h:42: (warning) The class 'LuaEditor' defines member variable with name 'className' also defined in its parent class 'LuaEditorGameBase'.
src/scripting/lua_root.h:78] -> [src/scripting/lua_bases.h:42: (warning) The class 'LuaEditor' defines member variable with name 'Methods' also defined in its parent class 'LuaEditorGameBase'.
src/scripting/lua_root.h:78] -> [src/scripting/lua_bases.h:42: (warning) The class 'LuaEditor' defines member variable with name 'Properties' also defined in its parent class 'LuaEditorGameBase'.
src/scripting/lua_ui.h:94] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaButton' defines member variable with name 'className' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:94] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaButton' defines member variable with name 'Methods' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:94] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaButton' defines member variable with name 'Properties' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:126] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaTab' defines member variable with name 'className' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:126] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaTab' defines member variable with name 'Methods' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:126] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaTab' defines member variable with name 'Properties' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:158] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaWindow' defines member variable with name 'className' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:158] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaWindow' defines member variable with name 'Methods' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:158] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaWindow' defines member variable with name 'Properties' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:189] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaMapView' defines member variable with name 'className' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:189] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaMapView' defines member variable with name 'Methods' also defined in its parent class 'LuaPanel'.
src/scripting/lua_ui.h:189] -> [src/scripting/lua_ui.h:47: (warning) The class 'LuaMapView' defines member variable with name 'Properties' also defined in its parent class 'LuaPanel'.
src/scripting/lua_bases.cc:134: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code.
src/scripting/lua_map.cc:3019: (style) The scope of the variable 'index' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/scripting/lua_map.cc:1224: (performance) Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code.
src/scripting/test/test_luna.cc:98] -> [src/scripting/test/test_luna.cc:54: (warning) The class 'LuaSubClass' defines member variable with name 'className' also defined in its parent class 'LuaClass'.
src/scripting/test/test_luna.cc:98] -> [src/scripting/test/test_luna.cc:54: (warning) The class 'LuaSubClass' defines member variable with name 'Methods' also defined in its parent class 'LuaClass'.
src/scripting/test/test_luna.cc:98] -> [src/scripting/test/test_luna.cc:54: (warning) The class 'LuaSubClass' defines member variable with name 'Properties' also defined in its parent class 'LuaClass'.
src/scripting/test/test_luna.cc:125] -> [src/scripting/test/test_luna.cc:54: (warning) The class 'LuaVirtualClass' defines member variable with name 'className' also defined in its parent class 'LuaClass'.
src/scripting/test/test_luna.cc:125] -> [src/scripting/test/test_luna.cc:54: (warning) The class 'LuaVirtualClass' defines member variable with name 'Methods' also defined in its parent class 'LuaClass'.
src/scripting/test/test_luna.cc:125] -> [src/scripting/test/test_luna.cc:54: (warning) The class 'LuaVirtualClass' defines member variable with name 'Properties' also defined in its parent class 'LuaClass'.
src/scripting/test/test_luna.cc:168] -> [src/scripting/test/test_luna.cc:54: (warning) The class 'LuaMultiClass' defines member variable with name 'className' also defined in its parent class 'LuaClass'.
src/scripting/test/test_luna.cc:168] -> [src/scripting/test/test_luna.cc:54: (warning) The class 'LuaMultiClass' defines member variable with name 'Methods' also defined in its parent class 'LuaClass'.
src/scripting/test/test_luna.cc:168] -> [src/scripting/test/test_luna.cc:54: (warning) The class 'LuaMultiClass' defines member variable with name 'Properties' also defined in its parent class 'LuaClass'.
src/sound/sound_handler.cc:258: (warning) Non-pure function: 'is_directory' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/sound/sound_handler.cc:447: (warning) Non-pure function: 'is_directory' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/third_party/eris/eris.c:2637: (warning) Size of pointer 'kSettingMetafield' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingMetafield)'.
src/third_party/eris/eris.c:2642: (warning) Size of pointer 'kSettingPassIOToPersist' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingPassIOToPersist)'.
src/third_party/eris/eris.c:2647: (warning) Size of pointer 'kSettingWriteDebugInfo' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingWriteDebugInfo)'.
src/third_party/eris/eris.c:2652: (warning) Size of pointer 'kSettingGeneratePath' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingGeneratePath)'.
src/third_party/eris/eris.c:2657: (warning) Size of pointer 'kSettingMaxComplexity' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingMaxComplexity)'.
src/third_party/eris/eris.c:2670: (warning) Size of pointer 'kSettingMetafield' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingMetafield)'.
src/third_party/eris/eris.c:2674: (warning) Size of pointer 'kSettingPassIOToPersist' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingPassIOToPersist)'.
src/third_party/eris/eris.c:2678: (warning) Size of pointer 'kSettingWriteDebugInfo' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingWriteDebugInfo)'.
src/third_party/eris/eris.c:2682: (warning) Size of pointer 'kSettingGeneratePath' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingGeneratePath)'.
src/third_party/eris/eris.c:2686: (warning) Size of pointer 'kSettingMaxComplexity' used instead of size of its data. This is likely to lead to a buffer overflow. You probably intend to write 'sizeof(*kSettingMaxComplexity)'.
src/third_party/eris/lapi.c:352: (error) Uninitialized variable: n
src/third_party/eris/lapi.c:363: (error) Uninitialized variable: res
src/third_party/eris/lauxlib.c:657: (style) The scope of the variable 'c' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/third_party/eris/lcode.c:55: (style) The scope of the variable 'previous' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/third_party/eris/ldblib.c:197: (style) The scope of the variable 'name' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/third_party/eris/liolib.c:654: (information) Skipping configuration 'LUA_USE_WINDOWS;_CRTIMP_TYPEINFO;_MSC_VER;l_fseek' since the value of 'l_fseek' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/liolib.c:274: (information) Skipping configuration 'LUA_USE_WINDOWS;l_popen' since the value of 'l_popen' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/llex.c:61: (information) Skipping configuration 'LLONG_MAX' since the value of 'LLONG_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/lmathlib.c:266: (information) Skipping configuration 'LLONG_MAX' since the value of 'LLONG_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/lmathlib.c:401: (information) Skipping configuration 'LLONG_MAX' since the value of 'LLONG_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/loslib.c:263: (style) Variable 'tmr' is not assigned a value.
src/third_party/eris/loslib.c:233: (information) Skipping configuration 'LUA_STRFTIMEOPTIONS;LUA_USE_C89' since the value of 'LUA_STRFTIMEOPTIONS' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/lstring.c:204: (information) Skipping configuration 'LLONG_MAX' since the value of 'LLONG_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/lstring.c:239: (information) Skipping configuration 'LLONG_MAX' since the value of 'LLONG_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/lstrlib.c:1099: (style) struct member 'cD::c' is never used.
src/third_party/eris/lstrlib.c:1100: (style) union member 'Anonymous1::i' is never used.
src/third_party/eris/ltable.c:168: (style) The scope of the variable 'nx' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/third_party/eris/ltable.c:337: (style) The scope of the variable 'i' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x) { int i = 0; if (x) { // it's safe to move 'int i = 0;' here for (int n = 0; n < 10; ++n) { // it is possible but not safe to move 'int i = 0;' here do_something(&i); } } } When you see this message it is always safe to reduce the variable scope 1 level. src/third_party/eris/ltablib.c:137: (information) Skipping configuration 'LLONG_MAX' since the value of 'LLONG_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/ltablib.c:140: (information) Skipping configuration 'LLONG_MAX' since the value of 'LLONG_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/ltablib.c:259: (warning) Division by result of sizeof(). memcpy() expects a size in bytes, did you intend to multiply instead?
src/third_party/eris/ltablib.c:260: (warning) Division by result of sizeof(). memcpy() expects a size in bytes, did you intend to multiply instead?
src/third_party/eris/lua.c:582: (information) Skipping configuration 'LUA_USE_WINDOWS;lua_stdin_is_tty' since the value of 'lua_stdin_is_tty' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/lvm.c:143: (information) Skipping configuration 'LLONG_MAX' since the value of 'LLONG_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/eris/lvm.c:480: (information) Skipping configuration 'LLONG_MAX' since the value of 'LLONG_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:296: (style) Condition 'unz_copyright[0]!=' '' is always false
src/third_party/minizip/unzip.cc:550: (style) Variable 'lSeek' is assigned a value that is never used.
src/third_party/minizip/unzip.cc:1974: (style) Suspicious calculation. Please use parentheses to clarify the code. The code ''a&b?c:d'' should be written as either ''(a&b)?c:d'' or ''a&(b?c:d)''.
src/third_party/minizip/unzip.cc:1955: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1957: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1959: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1961: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1963: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1965: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1967: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1969: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1982: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1986: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1990: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:1994: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:2013: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/third_party/minizip/unzip.cc:2017: (information) Skipping configuration 'CALLBACK;USEWINDOWS_CALLBACK;_WIN32' since the value of 'CALLBACK' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/ui_basic/fileview_panel.cc:69: (warning) Non-pure function: 'tabs' is called inside assert statement. Assert statements are removed from release builds so the code inside assert statement is not executed. If the code is needed also in release builds, this is a bug.
src/ui_fsmenu/launch_mpg.cc:72: (error) Memory leak: btn
src/wlapplication.cc:380: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Widelands :: Building >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/wui/buildingwindow.cc:341: (error) Memory leak: helpbtn
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Widelands :: ConstructionSite >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Widelands :: DismantleSite >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/wui/general_statistics_menu.cc:113: (style) Variable 'plr_in_game' is modified but its new value is never used.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Widelands :: MilitarySite >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Widelands :: ProductionSite >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Widelands :: TrainingSite >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/logic/map_objects/map_object.h:535: (style) Struct 'Widelands :: OPtr < Widelands :: Warehouse >' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
src/wui/load_or_save_game.h:32: (style) class 'LoadOrSaveGame' does not have a copy constructor which is recommended since the class contains a pointer to allocated memory.
src/wui/watchwindow.cc:128: (error) Memory leak: closebtn
src/ai/defaultai.cc:6316: (style) The function 'check_range' is never used.
src/graphic/text/rt_render.cc:507: (style) The function 'debug_info' is never used.
src/third_party/eris/eris.c:2768: (style) The function 'eris_get_setting' is never used.
src/third_party/eris/eris.c:2746: (style) The function 'eris_persist' is never used.
src/third_party/eris/eris.c:2757: (style) The function 'eris_unpersist' is never used.
src/ai/ai_help_structs.cc:365: (style) The function 'get_result' is never used.
src/profile/profile.cc:286: (style) The function 'get_safe_natural' is never used.
src/profile/profile.cc:214: (style) The function 'has_val' is never used.
src/graphic/text/bidi.cc:711: (style) The function 'icuchar2string' is never used.
src/ai/ai_help_structs.cc:911: (style) The function 'print' is never used.
src/wlapplication.cc:1458: (style) The function 'redirect_output' is never used.
src/logic/game.cc:712: (style) The function 'send_player_change_training_options' is never used.
src/logic/game.cc:762: (style) The function 'send_player_propose_trade' is never used.
src/graphic/richtext.cc:187: (style) The function 'set_background_color' is never used.
src/ui_basic/slider.cc:129: (style) The function 'set_min_value' is never used.
src/logic/map_objects/tribes/worker.cc:1769: (style) The function 'update_task_carry_trade_item' is never used.
(information) Cppcheck cannot find all the include files. Cppcheck can check the code without the include files found. But the results will probably be more accurate if all the include files are found. Please check your project's include directories and add all of them as include directories for Cppcheck. To see what files Cppcheck cannot find use --check-config.