summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-06 18:21:18 +0200
committerGitHub <noreply@github.com>2019-04-06 18:21:18 +0200
commit3b697ce8d56ea7e73c202058f6c4d0e202142eae (patch)
tree919a15e1b040b629ed8f556fad76ea13cf1df77e
parentcc3e660d7e13665fd5242502fb677d3e5f30ec18 (diff)
parent6be77da7eb817fc1f8469bd0bdd8a0d08167e701 (diff)
Merge pull request #26486 from marxin/fix-Wdeprecated-copy
Fix new GCC 9 warnings: -Wdeprecated-copy.
-rw-r--r--core/math/audio_frame.h6
-rw-r--r--core/math/quat.h8
-rw-r--r--core/ustring.h8
-rw-r--r--scene/3d/soft_body.cpp8
-rw-r--r--scene/3d/soft_body.h1
-rw-r--r--servers/physics_2d_server.h6
-rw-r--r--servers/physics_server.h6
7 files changed, 43 insertions, 0 deletions
diff --git a/core/math/audio_frame.h b/core/math/audio_frame.h
index f970c510e0..ebe0356c93 100644
--- a/core/math/audio_frame.h
+++ b/core/math/audio_frame.h
@@ -122,6 +122,12 @@ struct AudioFrame {
r = p_frame.r;
}
+ _ALWAYS_INLINE_ AudioFrame operator=(const AudioFrame &p_frame) {
+ l = p_frame.l;
+ r = p_frame.r;
+ return *this;
+ }
+
_ALWAYS_INLINE_ AudioFrame() {}
};
diff --git a/core/math/quat.h b/core/math/quat.h
index 7d71ec03e8..8ed2fa7cc2 100644
--- a/core/math/quat.h
+++ b/core/math/quat.h
@@ -131,6 +131,14 @@ public:
w(q.w) {
}
+ Quat operator=(const Quat &q) {
+ x = q.x;
+ y = q.y;
+ z = q.z;
+ w = q.w;
+ return *this;
+ }
+
Quat(const Vector3 &v0, const Vector3 &v1) // shortest arc
{
Vector3 c = v0.cross(v1);
diff --git a/core/ustring.h b/core/ustring.h
index cb3d87378a..9288c1526e 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -97,6 +97,10 @@ public:
_FORCE_INLINE_ CharString() {}
_FORCE_INLINE_ CharString(const CharString &p_str) { _cowdata._ref(p_str._cowdata); }
+ _FORCE_INLINE_ CharString operator=(const CharString &p_str) {
+ _cowdata._ref(p_str._cowdata);
+ return *this;
+ }
bool operator<(const CharString &p_right) const;
CharString &operator+=(char p_char);
@@ -339,6 +343,10 @@ public:
_FORCE_INLINE_ String() {}
_FORCE_INLINE_ String(const String &p_str) { _cowdata._ref(p_str._cowdata); }
+ String operator=(const String &p_str) {
+ _cowdata._ref(p_str._cowdata);
+ return *this;
+ }
String(const char *p_str);
String(const CharType *p_str, int p_clip_to_len = -1);
diff --git a/scene/3d/soft_body.cpp b/scene/3d/soft_body.cpp
index ac20609c21..d6a0595519 100644
--- a/scene/3d/soft_body.cpp
+++ b/scene/3d/soft_body.cpp
@@ -104,6 +104,14 @@ SoftBody::PinnedPoint::PinnedPoint(const PinnedPoint &obj_tocopy) {
offset = obj_tocopy.offset;
}
+SoftBody::PinnedPoint SoftBody::PinnedPoint::operator=(const PinnedPoint &obj) {
+ point_index = obj.point_index;
+ spatial_attachment_path = obj.spatial_attachment_path;
+ spatial_attachment = obj.spatial_attachment;
+ offset = obj.offset;
+ return *this;
+}
+
void SoftBody::_update_pickable() {
if (!is_inside_tree())
return;
diff --git a/scene/3d/soft_body.h b/scene/3d/soft_body.h
index 2516d39552..ee455f8dab 100644
--- a/scene/3d/soft_body.h
+++ b/scene/3d/soft_body.h
@@ -75,6 +75,7 @@ public:
PinnedPoint();
PinnedPoint(const PinnedPoint &obj_tocopy);
+ PinnedPoint operator=(const PinnedPoint &obj);
};
private:
diff --git a/servers/physics_2d_server.h b/servers/physics_2d_server.h
index 1de9c7df93..0ba8a6605d 100644
--- a/servers/physics_2d_server.h
+++ b/servers/physics_2d_server.h
@@ -653,6 +653,12 @@ class Physics2DServerManager {
ClassInfo(const ClassInfo &p_ci) :
name(p_ci.name),
create_callback(p_ci.create_callback) {}
+
+ ClassInfo operator=(const ClassInfo &p_ci) {
+ name = p_ci.name;
+ create_callback = p_ci.create_callback;
+ return *this;
+ }
};
static Vector<ClassInfo> physics_2d_servers;
diff --git a/servers/physics_server.h b/servers/physics_server.h
index c71bb01943..9895ef2455 100644
--- a/servers/physics_server.h
+++ b/servers/physics_server.h
@@ -794,6 +794,12 @@ class PhysicsServerManager {
ClassInfo(const ClassInfo &p_ci) :
name(p_ci.name),
create_callback(p_ci.create_callback) {}
+
+ ClassInfo operator=(const ClassInfo &p_ci) {
+ name = p_ci.name;
+ create_callback = p_ci.create_callback;
+ return *this;
+ }
};
static Vector<ClassInfo> physics_servers;