summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
Diffstat (limited to 'core/object')
-rw-r--r--core/object/callable_method_pointer.h7
-rw-r--r--core/object/class_db.cpp4
-rw-r--r--core/object/object.cpp2
-rw-r--r--core/object/script_language.h3
4 files changed, 11 insertions, 5 deletions
diff --git a/core/object/callable_method_pointer.h b/core/object/callable_method_pointer.h
index 115797a00c..8ba01be4e4 100644
--- a/core/object/callable_method_pointer.h
+++ b/core/object/callable_method_pointer.h
@@ -32,7 +32,6 @@
#define CALLABLE_METHOD_POINTER_H
#include "core/object/object.h"
-#include "core/os/copymem.h"
#include "core/templates/hashfuncs.h"
#include "core/templates/simple_type.h"
#include "core/variant/binder_common.h"
@@ -98,7 +97,7 @@ public:
}
CallableCustomMethodPointer(T *p_instance, void (T::*p_method)(P...)) {
- zeromem(&data, sizeof(Data)); // Clear beforehand, may have padding bytes.
+ memset(&data, 0, sizeof(Data)); // Clear beforehand, may have padding bytes.
data.instance = p_instance;
#ifdef DEBUG_ENABLED
data.object_id = p_instance->get_instance_id();
@@ -153,7 +152,7 @@ public:
}
CallableCustomMethodPointerRet(T *p_instance, R (T::*p_method)(P...)) {
- zeromem(&data, sizeof(Data)); // Clear beforehand, may have padding bytes.
+ memset(&data, 0, sizeof(Data)); // Clear beforehand, may have padding bytes.
data.instance = p_instance;
#ifdef DEBUG_ENABLED
data.object_id = p_instance->get_instance_id();
@@ -208,7 +207,7 @@ public:
}
CallableCustomMethodPointerRetC(T *p_instance, R (T::*p_method)(P...) const) {
- zeromem(&data, sizeof(Data)); // Clear beforehand, may have padding bytes.
+ memset(&data, 0, sizeof(Data)); // Clear beforehand, may have padding bytes.
data.instance = p_instance;
#ifdef DEBUG_ENABLED
data.object_id = p_instance->get_instance_id();
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp
index 375ad8fae1..fb7eb42738 100644
--- a/core/object/class_db.cpp
+++ b/core/object/class_db.cpp
@@ -1095,6 +1095,8 @@ bool ClassDB::get_property_info(StringName p_class, StringName p_property, Prope
}
bool ClassDB::set_property(Object *p_object, const StringName &p_property, const Variant &p_value, bool *r_valid) {
+ ERR_FAIL_NULL_V(p_object, false);
+
ClassInfo *type = classes.getptr(p_object->get_class_name());
ClassInfo *check = type;
while (check) {
@@ -1142,6 +1144,8 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const
}
bool ClassDB::get_property(Object *p_object, const StringName &p_property, Variant &r_value) {
+ ERR_FAIL_NULL_V(p_object, false);
+
ClassInfo *type = classes.getptr(p_object->get_class_name());
ClassInfo *check = type;
while (check) {
diff --git a/core/object/object.cpp b/core/object/object.cpp
index 413f917518..a8b2c4a939 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -1345,7 +1345,7 @@ void Object::_disconnect(const StringName &p_signal, const Callable &p_callable,
if (!s) {
bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_signal) ||
(!script.is_null() && Ref<Script>(script)->has_script_signal(p_signal));
- ERR_FAIL_COND_MSG(signal_is_valid, "Attempt to disconnect a nonexistent connection from '" + to_string() + "'. signal: '" + p_signal + "', callable: '" + p_callable + "'.");
+ ERR_FAIL_COND_MSG(signal_is_valid, "Attempt to disconnect a nonexistent connection from '" + to_string() + "'. Signal: '" + p_signal + "', callable: '" + p_callable + "'.");
}
ERR_FAIL_COND_MSG(!s, vformat("Disconnecting nonexistent signal '%s' in %s.", p_signal, to_string()));
diff --git a/core/object/script_language.h b/core/object/script_language.h
index f9898ccd0c..9ed3c7e80f 100644
--- a/core/object/script_language.h
+++ b/core/object/script_language.h
@@ -242,6 +242,8 @@ public:
};
struct ScriptCodeCompletionOption {
+ /* Keep enum in Sync with: */
+ /* /scene/gui/code_edit.h - CodeEdit::CodeCompletionKind */
enum Kind {
KIND_CLASS,
KIND_FUNCTION,
@@ -303,6 +305,7 @@ public:
void get_core_type_words(List<String> *p_core_type_words) const;
virtual void get_reserved_words(List<String> *p_words) const = 0;
+ virtual bool is_control_flow_keyword(String p_string) const = 0;
virtual void get_comment_delimiters(List<String> *p_delimiters) const = 0;
virtual void get_string_delimiters(List<String> *p_delimiters) const = 0;
virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const = 0;