summaryrefslogtreecommitdiff
path: root/modules/gdnative
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2020-07-24 14:07:57 -0400
committerAaron Franke <arnfranke@yahoo.com>2020-07-27 18:38:53 -0400
commit56e2c6c7043ca14159284b7b1f07e95d6fcf9a9e (patch)
treea332137aefabdfc21f7f5f317096a1895e9f1dc9 /modules/gdnative
parent4e825539e590c6ce06e54fbb05571efce7fb181c (diff)
Make all String float conversion methods be 64-bit
Diffstat (limited to 'modules/gdnative')
-rw-r--r--modules/gdnative/gdnative/string.cpp16
-rw-r--r--modules/gdnative/gdnative_api.json13
-rw-r--r--modules/gdnative/include/gdnative/string.h7
3 files changed, 11 insertions, 25 deletions
diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp
index 8b0c7474e8..26c40b625c 100644
--- a/modules/gdnative/gdnative/string.cpp
+++ b/modules/gdnative/gdnative/string.cpp
@@ -541,13 +541,7 @@ godot_string GDAPI godot_string_substr(const godot_string *p_self, godot_int p_f
return result;
}
-double GDAPI godot_string_to_double(const godot_string *p_self) {
- const String *self = (const String *)p_self;
-
- return self->to_double();
-}
-
-godot_real GDAPI godot_string_to_float(const godot_string *p_self) {
+double GDAPI godot_string_to_float(const godot_string *p_self) {
const String *self = (const String *)p_self;
return self->to_float();
@@ -583,8 +577,8 @@ godot_string GDAPI godot_string_camelcase_to_underscore_lowercased(const godot_s
return result;
}
-double GDAPI godot_string_char_to_double(const char *p_what) {
- return String::to_double(p_what);
+double GDAPI godot_string_char_to_float(const char *p_what) {
+ return String::to_float(p_what);
}
godot_int GDAPI godot_string_char_to_int(const char *p_what) {
@@ -621,8 +615,8 @@ int64_t GDAPI godot_string_to_int64(const godot_string *p_self) {
return self->to_int();
}
-double GDAPI godot_string_unicode_char_to_double(const wchar_t *p_str, const wchar_t **r_end) {
- return String::to_double(p_str, r_end);
+double GDAPI godot_string_unicode_char_to_float(const wchar_t *p_str, const wchar_t **r_end) {
+ return String::to_float(p_str, r_end);
}
godot_string GDAPI godot_string_get_slice(const godot_string *p_self, godot_string p_splitter, godot_int p_slice) {
diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json
index 9852928d22..8ccf44ff1a 100644
--- a/modules/gdnative/gdnative_api.json
+++ b/modules/gdnative/gdnative_api.json
@@ -4237,15 +4237,8 @@
]
},
{
- "name": "godot_string_to_double",
- "return_type": "double",
- "arguments": [
- ["const godot_string *", "p_self"]
- ]
- },
- {
"name": "godot_string_to_float",
- "return_type": "godot_real",
+ "return_type": "double",
"arguments": [
["const godot_string *", "p_self"]
]
@@ -4279,7 +4272,7 @@
]
},
{
- "name": "godot_string_char_to_double",
+ "name": "godot_string_char_to_float",
"return_type": "double",
"arguments": [
["const char *", "p_what"]
@@ -4337,7 +4330,7 @@
]
},
{
- "name": "godot_string_unicode_char_to_double",
+ "name": "godot_string_unicode_char_to_float",
"return_type": "double",
"arguments": [
["const wchar_t *", "p_str"],
diff --git a/modules/gdnative/include/gdnative/string.h b/modules/gdnative/include/gdnative/string.h
index dfd4fcab89..d89383dc1b 100644
--- a/modules/gdnative/include/gdnative/string.h
+++ b/modules/gdnative/include/gdnative/string.h
@@ -145,14 +145,13 @@ godot_string GDAPI godot_string_rpad_with_custom_character(const godot_string *p
godot_real GDAPI godot_string_similarity(const godot_string *p_self, const godot_string *p_string);
godot_string GDAPI godot_string_sprintf(const godot_string *p_self, const godot_array *p_values, godot_bool *p_error);
godot_string GDAPI godot_string_substr(const godot_string *p_self, godot_int p_from, godot_int p_chars);
-double GDAPI godot_string_to_double(const godot_string *p_self);
-godot_real GDAPI godot_string_to_float(const godot_string *p_self);
+double GDAPI godot_string_to_float(const godot_string *p_self);
godot_int GDAPI godot_string_to_int(const godot_string *p_self);
godot_string GDAPI godot_string_camelcase_to_underscore(const godot_string *p_self);
godot_string GDAPI godot_string_camelcase_to_underscore_lowercased(const godot_string *p_self);
godot_string GDAPI godot_string_capitalize(const godot_string *p_self);
-double GDAPI godot_string_char_to_double(const char *p_what);
+double GDAPI godot_string_char_to_float(const char *p_what);
godot_int GDAPI godot_string_char_to_int(const char *p_what);
int64_t GDAPI godot_string_wchar_to_int(const wchar_t *p_str);
godot_int GDAPI godot_string_char_to_int_with_len(const char *p_what, godot_int p_len);
@@ -160,7 +159,7 @@ int64_t GDAPI godot_string_char_to_int64_with_len(const wchar_t *p_str, int p_le
int64_t GDAPI godot_string_hex_to_int64(const godot_string *p_self);
int64_t GDAPI godot_string_hex_to_int64_with_prefix(const godot_string *p_self);
int64_t GDAPI godot_string_to_int64(const godot_string *p_self);
-double GDAPI godot_string_unicode_char_to_double(const wchar_t *p_str, const wchar_t **r_end);
+double GDAPI godot_string_unicode_char_to_float(const wchar_t *p_str, const wchar_t **r_end);
godot_int GDAPI godot_string_get_slice_count(const godot_string *p_self, godot_string p_splitter);
godot_string GDAPI godot_string_get_slice(const godot_string *p_self, godot_string p_splitter, godot_int p_slice);