Fix warnings about unhandled enum value in switch [-Wswitch]
Fixes GCC 5 warnings of the form: core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch] core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch] Those can be trivial cases where adding a default fallback is the solution, or more complex issues/hidden bugs where missed values are actually meant to be handled.
This commit is contained in:
@ -49,11 +49,6 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f
|
||||
err_str = String(p_file) + ":" + itos(p_line) + " - " + String(p_error);
|
||||
}
|
||||
|
||||
/*
|
||||
if (!self->is_visible_in_tree())
|
||||
self->emit_signal("show_request");
|
||||
*/
|
||||
|
||||
if (p_type == ERR_HANDLER_WARNING) {
|
||||
self->add_message(err_str, MSG_TYPE_WARNING);
|
||||
} else {
|
||||
@ -76,17 +71,6 @@ void EditorLog::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*if (p_what==NOTIFICATION_DRAW) {
|
||||
|
||||
RID ci = get_canvas_item();
|
||||
get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
|
||||
int top_ofs = 20;
|
||||
int border_ofs=4;
|
||||
Ref<StyleBox> style = get_stylebox("normal","TextEdit");
|
||||
|
||||
style->draw(ci,Rect2( Point2(border_ofs,top_ofs),get_size()-Size2(border_ofs*2,top_ofs+border_ofs)));
|
||||
}*/
|
||||
}
|
||||
|
||||
void EditorLog::_clear_request() {
|
||||
@ -105,6 +89,8 @@ void EditorLog::add_message(const String &p_msg, MessageType p_type) {
|
||||
|
||||
bool restore = p_type != MSG_TYPE_STD;
|
||||
switch (p_type) {
|
||||
case MSG_TYPE_STD: {
|
||||
} break;
|
||||
case MSG_TYPE_ERROR: {
|
||||
log->push_color(get_color("error_color", "Editor"));
|
||||
Ref<Texture> icon = get_icon("Error", "EditorIcons");
|
||||
@ -122,7 +108,6 @@ void EditorLog::add_message(const String &p_msg, MessageType p_type) {
|
||||
}
|
||||
|
||||
log->add_text(p_msg);
|
||||
//button->set_text(p_msg);
|
||||
|
||||
if (restore)
|
||||
log->pop();
|
||||
@ -132,21 +117,6 @@ void EditorLog::set_tool_button(ToolButton *p_tool_button) {
|
||||
tool_button = p_tool_button;
|
||||
}
|
||||
|
||||
/*
|
||||
void EditorLog::_dragged(const Point2& p_ofs) {
|
||||
|
||||
int ofs = ec->get_minsize().height;
|
||||
ofs = ofs-p_ofs.y;
|
||||
if (ofs<50)
|
||||
ofs=50;
|
||||
if (ofs>300)
|
||||
ofs=300;
|
||||
ec->set_minsize(Size2(ec->get_minsize().width,ofs));
|
||||
minimum_size_changed();
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
void EditorLog::_undo_redo_cbk(void *p_self, const String &p_name) {
|
||||
|
||||
EditorLog *self = (EditorLog *)p_self;
|
||||
@ -156,7 +126,6 @@ void EditorLog::_undo_redo_cbk(void *p_self, const String &p_name) {
|
||||
void EditorLog::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_clear_request"), &EditorLog::_clear_request);
|
||||
//ClassDB::bind_method(D_METHOD("_dragged"),&EditorLog::_dragged );
|
||||
ADD_SIGNAL(MethodInfo("clear_request"));
|
||||
}
|
||||
|
||||
@ -187,7 +156,6 @@ EditorLog::EditorLog() {
|
||||
log->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
vb->add_child(log);
|
||||
add_message(VERSION_FULL_NAME " (c) 2007-2018 Juan Linietsky, Ariel Manzur & Godot Contributors.");
|
||||
//log->add_text("Initialization Complete.\n"); //because it looks cool.
|
||||
|
||||
eh.errfunc = _error_handler;
|
||||
eh.userdata = this;
|
||||
|
||||
Reference in New Issue
Block a user