summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndy Maloney <asmaloney@gmail.com>2022-11-18 13:33:28 -0500
committerAndy Maloney <asmaloney@gmail.com>2022-11-18 17:46:13 -0500
commitc7e34c2f9da1c8e644d3828d60947deea4afccee (patch)
treed6217402fb676d7bb60a6044887f365f94aed652 /include
parent6c2f9196d76b81de0ea0ff7480767c4c34336882 (diff)
downloadredot-cpp-c7e34c2f9da1c8e644d3828d60947deea4afccee.tar.gz
Basic static analysis fixes
- remove extraneous semicolons - use "nullptr" instead of "0" - remove "break" after "return" - use <cstdio> instead of <stdio.h>
Diffstat (limited to 'include')
-rw-r--r--include/godot_cpp/classes/wrapped.hpp12
-rw-r--r--include/godot_cpp/core/memory.hpp2
-rw-r--r--include/godot_cpp/core/method_bind.hpp2
-rw-r--r--include/godot_cpp/godot.hpp2
-rw-r--r--include/godot_cpp/templates/cowdata.hpp2
-rw-r--r--include/godot_cpp/templates/hashfuncs.hpp2
-rw-r--r--include/godot_cpp/templates/rb_set.hpp2
-rw-r--r--include/godot_cpp/templates/rid_owner.hpp2
-rw-r--r--include/godot_cpp/variant/basis.hpp2
-rw-r--r--include/godot_cpp/variant/plane.hpp2
-rw-r--r--include/godot_cpp/variant/quaternion.hpp2
11 files changed, 16 insertions, 16 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp
index 91431ed..867ce37 100644
--- a/include/godot_cpp/classes/wrapped.hpp
+++ b/include/godot_cpp/classes/wrapped.hpp
@@ -52,12 +52,12 @@ protected:
virtual const StringName *_get_extension_class_name() const; // This is needed to retrieve the class name before the godot object has its _extension and _extension_instance members assigned.
virtual const GDNativeInstanceBindingCallbacks *_get_bindings_callbacks() const = 0;
- void _notification(int p_what){};
- bool _set(const StringName &p_name, const Variant &p_property) { return false; };
- bool _get(const StringName &p_name, Variant &r_property) const { return false; };
- void _get_property_list(List<PropertyInfo> *p_list) const {};
- bool _property_can_revert(const StringName &p_name) const { return false; };
- bool _property_get_revert(const StringName &p_name, Variant &r_property) const { return false; };
+ void _notification(int p_what) {}
+ bool _set(const StringName &p_name, const Variant &p_property) { return false; }
+ bool _get(const StringName &p_name, Variant &r_property) const { return false; }
+ void _get_property_list(List<PropertyInfo> *p_list) const {}
+ bool _property_can_revert(const StringName &p_name) const { return false; }
+ bool _property_get_revert(const StringName &p_name, Variant &r_property) const { return false; }
String _to_string() const { return "[" + String(get_class_static()) + ":" + itos(get_instance_id()) + "]"; }
static void notification_bind(GDExtensionClassInstancePtr p_instance, int32_t p_what) {}
diff --git a/include/godot_cpp/core/memory.hpp b/include/godot_cpp/core/memory.hpp
index 8a549fe..2dce44f 100644
--- a/include/godot_cpp/core/memory.hpp
+++ b/include/godot_cpp/core/memory.hpp
@@ -107,7 +107,7 @@ public:
};
template <class T>
-void memdelete(T *p_class, typename std::enable_if<!std::is_base_of_v<godot::Wrapped, T>>::type * = 0) {
+void memdelete(T *p_class, typename std::enable_if<!std::is_base_of_v<godot::Wrapped, T>>::type * = nullptr) {
if (!__has_trivial_destructor(T)) {
p_class->~T();
}
diff --git a/include/godot_cpp/core/method_bind.hpp b/include/godot_cpp/core/method_bind.hpp
index d7d747d..c211676 100644
--- a/include/godot_cpp/core/method_bind.hpp
+++ b/include/godot_cpp/core/method_bind.hpp
@@ -98,7 +98,7 @@ public:
_FORCE_INLINE_ StringName get_instance_class() const { return instance_class; }
_FORCE_INLINE_ void set_instance_class(StringName p_class) { instance_class = p_class; }
- _FORCE_INLINE_ int get_argument_count() const { return argument_count; };
+ _FORCE_INLINE_ int get_argument_count() const { return argument_count; }
_FORCE_INLINE_ bool is_const() const { return _is_const; }
_FORCE_INLINE_ bool is_static() const { return _static; }
_FORCE_INLINE_ bool is_vararg() const { return _vararg; }
diff --git a/include/godot_cpp/godot.hpp b/include/godot_cpp/godot.hpp
index 9417bf4..d6743fb 100644
--- a/include/godot_cpp/godot.hpp
+++ b/include/godot_cpp/godot.hpp
@@ -72,7 +72,7 @@ public:
InitObject(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization) :
gdn_interface(p_interface),
library(p_library),
- initialization(r_initialization){};
+ initialization(r_initialization) {}
void register_initializer(Callback p_init) const;
void register_terminator(Callback p_init) const;
diff --git a/include/godot_cpp/templates/cowdata.hpp b/include/godot_cpp/templates/cowdata.hpp
index 0970050..4b6daca 100644
--- a/include/godot_cpp/templates/cowdata.hpp
+++ b/include/godot_cpp/templates/cowdata.hpp
@@ -190,7 +190,7 @@ public:
_FORCE_INLINE_ CowData() {}
_FORCE_INLINE_ ~CowData();
- _FORCE_INLINE_ CowData(CowData<T> &p_from) { _ref(p_from); };
+ _FORCE_INLINE_ CowData(CowData<T> &p_from) { _ref(p_from); }
};
template <class T>
diff --git a/include/godot_cpp/templates/hashfuncs.hpp b/include/godot_cpp/templates/hashfuncs.hpp
index 984c728..4f32d4b 100644
--- a/include/godot_cpp/templates/hashfuncs.hpp
+++ b/include/godot_cpp/templates/hashfuncs.hpp
@@ -228,7 +228,7 @@ static _FORCE_INLINE_ uint32_t hash_murmur3_buffer(const void *key, int length,
k1 = hash_rotl32(k1, 15);
k1 *= c2;
h1 ^= k1;
- };
+ }
// Finalize with additional bit mixing.
h1 ^= length;
diff --git a/include/godot_cpp/templates/rb_set.hpp b/include/godot_cpp/templates/rb_set.hpp
index 9889a13..cc0ea69 100644
--- a/include/godot_cpp/templates/rb_set.hpp
+++ b/include/godot_cpp/templates/rb_set.hpp
@@ -77,7 +77,7 @@ public:
}
const T &get() const {
return value;
- };
+ }
Element() {}
};
diff --git a/include/godot_cpp/templates/rid_owner.hpp b/include/godot_cpp/templates/rid_owner.hpp
index 8ec855e..41994f5 100644
--- a/include/godot_cpp/templates/rid_owner.hpp
+++ b/include/godot_cpp/templates/rid_owner.hpp
@@ -37,7 +37,7 @@
#include <godot_cpp/templates/spin_lock.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
-#include <stdio.h>
+#include <cstdio>
#include <typeinfo>
namespace godot {
diff --git a/include/godot_cpp/variant/basis.hpp b/include/godot_cpp/variant/basis.hpp
index 00dbc50..81539d9 100644
--- a/include/godot_cpp/variant/basis.hpp
+++ b/include/godot_cpp/variant/basis.hpp
@@ -233,7 +233,7 @@ struct _NO_DISCARD_ Basis {
static Basis looking_at(const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0));
- Basis(const Quaternion &p_quaternion) { set_quaternion(p_quaternion); };
+ Basis(const Quaternion &p_quaternion) { set_quaternion(p_quaternion); }
Basis(const Quaternion &p_quaternion, const Vector3 &p_scale) { set_quaternion_scale(p_quaternion, p_scale); }
Basis(const Vector3 &p_axis, real_t p_angle) { set_axis_angle(p_axis, p_angle); }
diff --git a/include/godot_cpp/variant/plane.hpp b/include/godot_cpp/variant/plane.hpp
index 8d5f69f..94ca5ae 100644
--- a/include/godot_cpp/variant/plane.hpp
+++ b/include/godot_cpp/variant/plane.hpp
@@ -43,7 +43,7 @@ struct _NO_DISCARD_ Plane {
real_t d = 0;
void set_normal(const Vector3 &p_normal);
- _FORCE_INLINE_ Vector3 get_normal() const { return normal; };
+ _FORCE_INLINE_ Vector3 get_normal() const { return normal; }
void normalize();
Plane normalized() const;
diff --git a/include/godot_cpp/variant/quaternion.hpp b/include/godot_cpp/variant/quaternion.hpp
index dd60561..6632883 100644
--- a/include/godot_cpp/variant/quaternion.hpp
+++ b/include/godot_cpp/variant/quaternion.hpp
@@ -67,7 +67,7 @@ struct _NO_DISCARD_ Quaternion {
Vector3 get_euler_xyz() const;
Vector3 get_euler_yxz() const;
- Vector3 get_euler() const { return get_euler_yxz(); };
+ Vector3 get_euler() const { return get_euler_yxz(); }
Quaternion slerp(const Quaternion &p_to, const real_t &p_weight) const;
Quaternion slerpni(const Quaternion &p_to, const real_t &p_weight) const;