diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/SCsub | 16 | ||||
-rw-r--r-- | core/input/SCsub | 2 | ||||
-rw-r--r-- | core/io/json.cpp | 2 | ||||
-rw-r--r-- | core/math/expression.cpp | 2 | ||||
-rw-r--r-- | core/script_language.cpp | 3 | ||||
-rw-r--r-- | core/string_buffer.h | 2 | ||||
-rw-r--r-- | core/ustring.cpp | 14 | ||||
-rw-r--r-- | core/ustring.h | 7 | ||||
-rw-r--r-- | core/variant.cpp | 4 | ||||
-rw-r--r-- | core/variant_call.cpp | 2 |
10 files changed, 28 insertions, 26 deletions
diff --git a/core/SCsub b/core/SCsub index 80a5f6b623..d08f17c60a 100644 --- a/core/SCsub +++ b/core/SCsub @@ -149,28 +149,34 @@ env.Depends( env.CommandNoCache( "#core/io/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt", - run_in_subprocess(core_builders.make_certs_header), + env.Run(core_builders.make_certs_header, "Building ca-certificates header."), ) # Make binders env.CommandNoCache( ["method_bind.gen.inc", "method_bind_ext.gen.inc", "method_bind_free_func.gen.inc"], "make_binders.py", - run_in_subprocess(make_binders.run), + env.Run(make_binders.run, "Generating method binders."), ) # Authors env.Depends("#core/authors.gen.h", "../AUTHORS.md") -env.CommandNoCache("#core/authors.gen.h", "../AUTHORS.md", run_in_subprocess(core_builders.make_authors_header)) +env.CommandNoCache( + "#core/authors.gen.h", "../AUTHORS.md", env.Run(core_builders.make_authors_header, "Generating authors header."), +) # Donors env.Depends("#core/donors.gen.h", "../DONORS.md") -env.CommandNoCache("#core/donors.gen.h", "../DONORS.md", run_in_subprocess(core_builders.make_donors_header)) +env.CommandNoCache( + "#core/donors.gen.h", "../DONORS.md", env.Run(core_builders.make_donors_header, "Generating donors header."), +) # License env.Depends("#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"]) env.CommandNoCache( - "#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"], run_in_subprocess(core_builders.make_license_header) + "#core/license.gen.h", + ["../COPYRIGHT.txt", "../LICENSE.txt"], + env.Run(core_builders.make_license_header, "Generating license header."), ) # Chain load SCsubs diff --git a/core/input/SCsub b/core/input/SCsub index c641819698..f40978911b 100644 --- a/core/input/SCsub +++ b/core/input/SCsub @@ -16,7 +16,7 @@ env.Depends("#core/input/default_controller_mappings.gen.cpp", controller_databa env.CommandNoCache( "#core/input/default_controller_mappings.gen.cpp", controller_databases, - run_in_subprocess(input_builders.make_default_controller_mappings), + env.Run(input_builders.make_default_controller_mappings, "Generating default controller mappings."), ) env.add_source_files(env.core_sources, "*.cpp") diff --git a/core/io/json.cpp b/core/io/json.cpp index b90841a5ef..8bdd6385cb 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -265,7 +265,7 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to if (p_str[index] == '-' || (p_str[index] >= '0' && p_str[index] <= '9')) { //a number const CharType *rptr; - double number = String::to_double(&p_str[index], &rptr); + double number = String::to_float(&p_str[index], &rptr); index += (rptr - &p_str[index]); r_token.type = TK_NUMBER; r_token.value = number; diff --git a/core/math/expression.cpp b/core/math/expression.cpp index 13a49feb6b..735a30f6cc 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -1062,7 +1062,7 @@ Error Expression::_get_token(Token &r_token) { r_token.type = TK_CONSTANT; if (is_float) { - r_token.value = num.to_double(); + r_token.value = num.to_float(); } else { r_token.value = num.to_int(); } diff --git a/core/script_language.cpp b/core/script_language.cpp index b63aeb952c..5176882662 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -33,6 +33,7 @@ #include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/debugger/script_debugger.h" +#include "core/os/file_access.h" #include "core/project_settings.h" #include <stdint.h> @@ -162,7 +163,7 @@ void ScriptServer::init_languages() { for (int i = 0; i < script_classes.size(); i++) { Dictionary c = script_classes[i]; - if (!c.has("class") || !c.has("language") || !c.has("path") || !c.has("base")) { + if (!c.has("class") || !c.has("language") || !c.has("path") || !FileAccess::exists(c["path"]) || !c.has("base")) { continue; } add_global_class(c["class"], c["base"], c["language"], c["path"]); diff --git a/core/string_buffer.h b/core/string_buffer.h index 956a6333d9..f9cf31075a 100644 --- a/core/string_buffer.h +++ b/core/string_buffer.h @@ -150,7 +150,7 @@ String StringBuffer<SHORT_BUFFER_SIZE>::as_string() { template <int SHORT_BUFFER_SIZE> double StringBuffer<SHORT_BUFFER_SIZE>::as_double() { current_buffer_ptr()[string_length] = '\0'; - return String::to_double(current_buffer_ptr()); + return String::to_float(current_buffer_ptr()); } template <int SHORT_BUFFER_SIZE> diff --git a/core/ustring.cpp b/core/ustring.cpp index 572ad1af59..957caf1015 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -851,7 +851,7 @@ Vector<float> String::split_floats(const String &p_splitter, bool p_allow_empty) end = len; } if (p_allow_empty || (end > from)) { - ret.push_back(String::to_double(&c_str()[from])); + ret.push_back(String::to_float(&c_str()[from])); } if (end == len) { @@ -880,7 +880,7 @@ Vector<float> String::split_floats_mk(const Vector<String> &p_splitters, bool p_ } if (p_allow_empty || (end > from)) { - ret.push_back(String::to_double(&c_str()[from])); + ret.push_back(String::to_float(&c_str()[from])); } if (end == len) { @@ -2006,7 +2006,7 @@ done: #define READING_EXP 3 #define READING_DONE 4 -double String::to_double(const char *p_str) { +double String::to_float(const char *p_str) { #ifndef NO_USE_STDLIB return built_in_strtod<char>(p_str); //return atof(p_str); DOES NOT WORK ON ANDROID(??) @@ -2015,11 +2015,7 @@ double String::to_double(const char *p_str) { #endif } -float String::to_float() const { - return to_double(); -} - -double String::to_double(const CharType *p_str, const CharType **r_end) { +double String::to_float(const CharType *p_str, const CharType **r_end) { return built_in_strtod<CharType>(p_str, (CharType **)r_end); } @@ -2087,7 +2083,7 @@ int64_t String::to_int(const CharType *p_str, int p_len, bool p_clamp) { return sign * integer; } -double String::to_double() const { +double String::to_float() const { if (empty()) { return 0; } diff --git a/core/ustring.h b/core/ustring.h index e745475f11..d37346fbd6 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -242,15 +242,14 @@ public: static String md5(const uint8_t *p_md5); static String hex_encode_buffer(const uint8_t *p_buffer, int p_len); bool is_numeric() const; - double to_double() const; - float to_float() const; + double to_float() const; int64_t hex_to_int(bool p_with_prefix = true) const; int64_t bin_to_int(bool p_with_prefix = true) const; int64_t to_int() const; static int64_t to_int(const char *p_str, int p_len = -1); - static double to_double(const char *p_str); - static double to_double(const CharType *p_str, const CharType **r_end = nullptr); + static double to_float(const char *p_str); + static double to_float(const CharType *p_str, const CharType **r_end = nullptr); static int64_t to_int(const CharType *p_str, int p_len = -1, bool p_clamp = false); String capitalize() const; String camelcase_to_underscore(bool lowercase = true) const; diff --git a/core/variant.cpp b/core/variant.cpp index afd01b3359..c19ce79e64 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -1573,7 +1573,7 @@ Variant::operator float() const { case FLOAT: return _data._float; case STRING: - return operator String().to_double(); + return operator String().to_float(); default: { return 0; } @@ -1591,7 +1591,7 @@ Variant::operator double() const { case FLOAT: return _data._float; case STRING: - return operator String().to_double(); + return operator String().to_float(); default: { return 0; } diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 8afa24e63d..b96fd0c103 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1405,7 +1405,7 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i return (int64_t(*p_args[0])); } case FLOAT: { - return real_t(*p_args[0]); + return double(*p_args[0]); } case STRING: { return String(*p_args[0]); |