Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/string/translation_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class TranslationServer : public Object {
(p_locale.variant == variant);
}

operator String() const;
explicit operator String() const;

Locale(const TranslationServer &p_server, const String &p_locale, bool p_add_defaults);
};
Expand Down
2 changes: 2 additions & 0 deletions core/templates/hashfuncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "core/templates/pair.h"
#include "core/templates/rid.h"
#include "core/typedefs.h"
#include "core/variant/callable.h"

#ifdef _MSC_VER
#include <intrin.h> // Needed for `__umulh` below.
Expand Down Expand Up @@ -342,6 +343,7 @@ struct HashMapHasherDefault {
static _FORCE_INLINE_ uint32_t hash(const StringName &p_string_name) { return p_string_name.hash(); }
static _FORCE_INLINE_ uint32_t hash(const NodePath &p_path) { return p_path.hash(); }
static _FORCE_INLINE_ uint32_t hash(const ObjectID &p_id) { return hash_one_uint64(p_id); }
static _FORCE_INLINE_ uint32_t hash(const Callable &p_callable) { return p_callable.hash(); }

static _FORCE_INLINE_ uint32_t hash(const uint64_t p_int) { return hash_one_uint64(p_int); }
static _FORCE_INLINE_ uint32_t hash(const int64_t p_int) { return hash_one_uint64(uint64_t(p_int)); }
Expand Down
4 changes: 2 additions & 2 deletions core/variant/callable.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Callable {

void operator=(const Callable &p_callable);

operator String() const;
explicit operator String() const;

static Callable create(const Variant &p_variant, const StringName &p_method);

Expand Down Expand Up @@ -190,7 +190,7 @@ class Signal {
bool operator!=(const Signal &p_signal) const;
bool operator<(const Signal &p_signal) const;

operator String() const;
explicit operator String() const;

Error emit(const Variant **p_arguments, int p_argcount) const;
Error connect(const Callable &p_callable, uint32_t p_flags = 0);
Expand Down
2 changes: 1 addition & 1 deletion core/variant/method_ptrcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ struct PtrToArgStringConvertByReference {
// No EncodeT because direct pointer conversion not possible.
_FORCE_INLINE_ static void encode(const T &p_vec, void *p_ptr) {
String *arr = reinterpret_cast<String *>(p_ptr);
*arr = p_vec;
*arr = String(p_vec);
}
};

Expand Down
4 changes: 2 additions & 2 deletions core/variant/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1725,11 +1725,11 @@ String Variant::stringify(int recursion_count) const {
}
case CALLABLE: {
const Callable &c = *reinterpret_cast<const Callable *>(_data._mem);
return c;
return String(c);
}
case SIGNAL: {
const Signal &s = *reinterpret_cast<const Signal *>(_data._mem);
return s;
return String(s);
}
case RID: {
const ::RID &s = *reinterpret_cast<const ::RID *>(_data._mem);
Expand Down