You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-04 17:04:49 +00:00
Fix -Wimplicit-fallthrough warnings from GCC 8
Adds `FALLTHROUGH` macro to specify when a fallthrough is intentional.
Can be replaced by `[[fallthrough]]` if/when we switch to C++17.
The warning is now enabled by default for GCC on `extra` warnings level
(part of GCC's `-Wextra`). It's not enabled in Clang's `-Wextra` yet,
but we could enable it manually once we switch to C++11. There's no
equivalent feature in MSVC for now.
Fixes #26135.
(cherry picked from commit fc370b3feb)
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
/*************************************************************************/
|
||||
|
||||
#include "tree.h"
|
||||
#include <limits.h>
|
||||
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/os/input.h"
|
||||
@@ -43,6 +42,8 @@
|
||||
#include "editor/editor_node.h"
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
void TreeItem::move_to_top() {
|
||||
|
||||
if (!parent || parent->children == this)
|
||||
@@ -940,6 +941,7 @@ int Tree::compute_item_height(TreeItem *p_item) const {
|
||||
int check_icon_h = cache.checked->get_height();
|
||||
if (height < check_icon_h)
|
||||
height = check_icon_h;
|
||||
FALLTHROUGH;
|
||||
}
|
||||
case TreeItem::CELL_MODE_STRING:
|
||||
case TreeItem::CELL_MODE_CUSTOM:
|
||||
|
||||
Reference in New Issue
Block a user