From 910d6d8e62d0dfc25f31ff073e83a30785fd49f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 24 Nov 2022 11:50:32 +0100 Subject: GDScript: Only check if ignoring warnings in debug build --- modules/gdscript/gdscript_parser.cpp | 2 ++ modules/gdscript/gdscript_parser.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/gdscript') diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index d24cba4c59..7f2f49f336 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -148,7 +148,9 @@ GDScriptParser::GDScriptParser() { // Networking. register_annotation(MethodInfo("@rpc", PropertyInfo(Variant::STRING, "mode"), PropertyInfo(Variant::STRING, "sync"), PropertyInfo(Variant::STRING, "transfer_mode"), PropertyInfo(Variant::INT, "transfer_channel")), AnnotationInfo::FUNCTION, &GDScriptParser::rpc_annotation, varray("", "", "", 0), true); +#ifdef DEBUG_ENABLED is_ignoring_warnings = !(bool)GLOBAL_GET("debug/gdscript/warnings/enable"); +#endif } GDScriptParser::~GDScriptParser() { diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 7baa3ca3d9..f9a1c5a697 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -1217,13 +1217,14 @@ private: bool can_break = false; bool can_continue = false; bool is_continue_match = false; // Whether a `continue` will act on a `match`. - bool is_ignoring_warnings = false; List multiline_stack; ClassNode *head = nullptr; Node *list = nullptr; List errors; + #ifdef DEBUG_ENABLED + bool is_ignoring_warnings = false; List warnings; HashSet ignored_warnings; HashSet ignored_warning_codes; -- cgit v1.2.3