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 {
7777 (p_locale.variant == variant);
7878 }
7979
80- operator String () const ;
80+ explicit operator String () const ;
8181
8282 Locale (const TranslationServer &p_server, const String &p_locale, bool p_add_defaults);
8383 };
Original file line number Diff line number Diff line change 5555#include " core/templates/pair.h"
5656#include " core/templates/rid.h"
5757#include " core/typedefs.h"
58+ #include " core/variant/callable.h"
5859
5960#ifdef _MSC_VER
6061#include < intrin.h> // Needed for `__umulh` below.
@@ -342,6 +343,7 @@ struct HashMapHasherDefault {
342343 static _FORCE_INLINE_ uint32_t hash (const StringName &p_string_name) { return p_string_name.hash (); }
343344 static _FORCE_INLINE_ uint32_t hash (const NodePath &p_path) { return p_path.hash (); }
344345 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 (); }
345347
346348 static _FORCE_INLINE_ uint32_t hash (const uint64_t p_int) { return hash_one_uint64 (p_int); }
347349 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 {
123123
124124 void operator =(const Callable &p_callable);
125125
126- operator String () const ;
126+ explicit operator String () const ;
127127
128128 static Callable create (const Variant &p_variant, const StringName &p_method);
129129
@@ -190,7 +190,7 @@ class Signal {
190190 bool operator !=(const Signal &p_signal) const ;
191191 bool operator <(const Signal &p_signal) const ;
192192
193- operator String () const ;
193+ explicit operator String () const ;
194194
195195 Error emit (const Variant **p_arguments, int p_argcount) const ;
196196 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 {
131131 // No EncodeT because direct pointer conversion not possible.
132132 _FORCE_INLINE_ static void encode (const T &p_vec, void *p_ptr) {
133133 String *arr = reinterpret_cast <String *>(p_ptr);
134- *arr = p_vec;
134+ *arr = String ( p_vec) ;
135135 }
136136};
137137
Original file line number Diff line number Diff line change @@ -1725,11 +1725,11 @@ String Variant::stringify(int recursion_count) const {
17251725 }
17261726 case CALLABLE: {
17271727 const Callable &c = *reinterpret_cast <const Callable *>(_data._mem );
1728- return c ;
1728+ return String (c) ;
17291729 }
17301730 case SIGNAL: {
17311731 const Signal &s = *reinterpret_cast <const Signal *>(_data._mem );
1732- return s ;
1732+ return String (s) ;
17331733 }
17341734 case RID: {
17351735 const ::RID &s = *reinterpret_cast <const ::RID *>(_data._mem );
You can’t perform that action at this time.
0 commit comments