File tree Expand file tree Collapse file tree 5 files changed +8
-6
lines changed Expand file tree Collapse file tree 5 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ class TranslationServer : public Object {
77
77
(p_locale.variant == variant);
78
78
}
79
79
80
- operator String () const ;
80
+ explicit operator String () const ;
81
81
82
82
Locale (const TranslationServer &p_server, const String &p_locale, bool p_add_defaults);
83
83
};
Original file line number Diff line number Diff line change 55
55
#include " core/templates/pair.h"
56
56
#include " core/templates/rid.h"
57
57
#include " core/typedefs.h"
58
+ #include " core/variant/callable.h"
58
59
59
60
#ifdef _MSC_VER
60
61
#include < intrin.h> // Needed for `__umulh` below.
@@ -342,6 +343,7 @@ struct HashMapHasherDefault {
342
343
static _FORCE_INLINE_ uint32_t hash (const StringName &p_string_name) { return p_string_name.hash (); }
343
344
static _FORCE_INLINE_ uint32_t hash (const NodePath &p_path) { return p_path.hash (); }
344
345
static _FORCE_INLINE_ uint32_t hash (const ObjectID &p_id) { return hash_one_uint64 (p_id); }
346
+ static _FORCE_INLINE_ uint32_t hash (const Callable &p_callable) { return p_callable.hash (); }
345
347
346
348
static _FORCE_INLINE_ uint32_t hash (const uint64_t p_int) { return hash_one_uint64 (p_int); }
347
349
static _FORCE_INLINE_ uint32_t hash (const int64_t p_int) { return hash_one_uint64 (uint64_t (p_int)); }
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ class Callable {
123
123
124
124
void operator =(const Callable &p_callable);
125
125
126
- operator String () const ;
126
+ explicit operator String () const ;
127
127
128
128
static Callable create (const Variant &p_variant, const StringName &p_method);
129
129
@@ -190,7 +190,7 @@ class Signal {
190
190
bool operator !=(const Signal &p_signal) const ;
191
191
bool operator <(const Signal &p_signal) const ;
192
192
193
- operator String () const ;
193
+ explicit operator String () const ;
194
194
195
195
Error emit (const Variant **p_arguments, int p_argcount) const ;
196
196
Error connect (const Callable &p_callable, uint32_t p_flags = 0 );
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ struct PtrToArgStringConvertByReference {
131
131
// No EncodeT because direct pointer conversion not possible.
132
132
_FORCE_INLINE_ static void encode (const T &p_vec, void *p_ptr) {
133
133
String *arr = reinterpret_cast <String *>(p_ptr);
134
- *arr = p_vec;
134
+ *arr = String ( p_vec) ;
135
135
}
136
136
};
137
137
Original file line number Diff line number Diff line change @@ -1725,11 +1725,11 @@ String Variant::stringify(int recursion_count) const {
1725
1725
}
1726
1726
case CALLABLE: {
1727
1727
const Callable &c = *reinterpret_cast <const Callable *>(_data._mem );
1728
- return c ;
1728
+ return String (c) ;
1729
1729
}
1730
1730
case SIGNAL: {
1731
1731
const Signal &s = *reinterpret_cast <const Signal *>(_data._mem );
1732
- return s ;
1732
+ return String (s) ;
1733
1733
}
1734
1734
case RID: {
1735
1735
const ::RID &s = *reinterpret_cast <const ::RID *>(_data._mem );
You can’t perform that action at this time.
0 commit comments