Many fallthrough switch cases now have the FALLTHROUGH macro to tell the compiler that this is intended.

This commit is contained in:
hbina085 2019-06-28 23:09:59 -04:00
parent 3942c939e3
commit 9f0c6a6009
7 changed files with 19 additions and 12 deletions

View File

@ -224,7 +224,8 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
string_cache[s] = tmpdata.size(); string_cache[s] = tmpdata.size();
}; //fallthrough FALLTHROUGH;
};
case Variant::NIL: case Variant::NIL:
case Variant::BOOL: case Variant::BOOL:
case Variant::INT: case Variant::INT:

View File

@ -232,7 +232,8 @@ void SpriteFramesEditor::_notification(int p_what) {
_delete->set_icon(get_icon("Remove", "EditorIcons")); _delete->set_icon(get_icon("Remove", "EditorIcons"));
new_anim->set_icon(get_icon("New", "EditorIcons")); new_anim->set_icon(get_icon("New", "EditorIcons"));
remove_anim->set_icon(get_icon("Remove", "EditorIcons")); remove_anim->set_icon(get_icon("Remove", "EditorIcons"));
} // Fallthrough. FALLTHROUGH;
}
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
splite_sheet_scroll->add_style_override("bg", get_stylebox("bg", "Tree")); splite_sheet_scroll->add_style_override("bg", get_stylebox("bg", "Tree"));
} break; } break;

View File

@ -61,8 +61,8 @@ void TileMapEditor::_notification(int p_what) {
if (is_visible_in_tree()) { if (is_visible_in_tree()) {
_update_palette(); _update_palette();
} }
FALLTHROUGH;
} // fallthrough }
case NOTIFICATION_ENTER_TREE: { case NOTIFICATION_ENTER_TREE: {

View File

@ -2498,7 +2498,8 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path
} break; } break;
case GDScriptParser::COMPLETION_FUNCTION: { case GDScriptParser::COMPLETION_FUNCTION: {
is_function = true; is_function = true;
} // fallthrough FALLTHROUGH;
}
case GDScriptParser::COMPLETION_IDENTIFIER: { case GDScriptParser::COMPLETION_IDENTIFIER: {
_find_identifiers(context, is_function, options); _find_identifiers(context, is_function, options);
} break; } break;
@ -2537,7 +2538,8 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path
} break; } break;
case GDScriptParser::COMPLETION_METHOD: { case GDScriptParser::COMPLETION_METHOD: {
is_function = true; is_function = true;
} // fallthrough FALLTHROUGH;
}
case GDScriptParser::COMPLETION_INDEX: { case GDScriptParser::COMPLETION_INDEX: {
const GDScriptParser::Node *node = parser.get_completion_node(); const GDScriptParser::Node *node = parser.get_completion_node();
if (node->type != GDScriptParser::Node::TYPE_OPERATOR) { if (node->type != GDScriptParser::Node::TYPE_OPERATOR) {
@ -3234,7 +3236,8 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
case GDScriptParser::COMPLETION_PARENT_FUNCTION: case GDScriptParser::COMPLETION_PARENT_FUNCTION:
case GDScriptParser::COMPLETION_FUNCTION: { case GDScriptParser::COMPLETION_FUNCTION: {
is_function = true; is_function = true;
} // fallthrough FALLTHROUGH;
}
case GDScriptParser::COMPLETION_IDENTIFIER: { case GDScriptParser::COMPLETION_IDENTIFIER: {
if (!is_function) { if (!is_function) {
@ -3365,7 +3368,8 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
} break; } break;
case GDScriptParser::COMPLETION_METHOD: { case GDScriptParser::COMPLETION_METHOD: {
is_function = true; is_function = true;
} // fallthrough FALLTHROUGH;
}
case GDScriptParser::COMPLETION_INDEX: { case GDScriptParser::COMPLETION_INDEX: {
const GDScriptParser::Node *node = parser.get_completion_node(); const GDScriptParser::Node *node = parser.get_completion_node();
if (node->type != GDScriptParser::Node::TYPE_OPERATOR) { if (node->type != GDScriptParser::Node::TYPE_OPERATOR) {

View File

@ -235,7 +235,7 @@ void GridMapEditor::_menu_option(int p_option) {
options->get_popup()->set_item_checked(idx, !options->get_popup()->is_item_checked(idx)); options->get_popup()->set_item_checked(idx, !options->get_popup()->is_item_checked(idx));
} break; } break;
case MENU_OPTION_SELECTION_DUPLICATE: // fallthrough case MENU_OPTION_SELECTION_DUPLICATE:
case MENU_OPTION_SELECTION_CUT: { case MENU_OPTION_SELECTION_CUT: {
if (!(selection.active && input_action == INPUT_NONE)) if (!(selection.active && input_action == INPUT_NONE))
break; break;

View File

@ -843,8 +843,8 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (wParam==VK_WIN) TODO wtf is this? if (wParam==VK_WIN) TODO wtf is this?
meta_mem=uMsg==WM_KEYDOWN; meta_mem=uMsg==WM_KEYDOWN;
*/ */
FALLTHROUGH;
} //fallthrough }
case WM_CHAR: { case WM_CHAR: {
ERR_BREAK(key_event_pos >= KEY_EVENT_BUFFER_SIZE); ERR_BREAK(key_event_pos >= KEY_EVENT_BUFFER_SIZE);

View File

@ -184,7 +184,8 @@ void ParticlesMaterial::_update_shader() {
} break; } break;
case EMISSION_SHAPE_DIRECTED_POINTS: { case EMISSION_SHAPE_DIRECTED_POINTS: {
code += "uniform sampler2D emission_texture_normal : hint_black;\n"; code += "uniform sampler2D emission_texture_normal : hint_black;\n";
} //fallthrough FALLTHROUGH;
}
case EMISSION_SHAPE_POINTS: { case EMISSION_SHAPE_POINTS: {
code += "uniform sampler2D emission_texture_points : hint_black;\n"; code += "uniform sampler2D emission_texture_points : hint_black;\n";
code += "uniform int emission_texture_point_count;\n"; code += "uniform int emission_texture_point_count;\n";