summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2018-05-22 15:51:25 -0300
committerThiago Macieira <thiago.macieira@intel.com>2018-05-23 14:39:05 +0000
commit94c0dcb59641188291efe3b11fa0bcb59ace8184 (patch)
tree018f4e067a3e337a7ee70f97dc4c00d56c54d3c3 /src
parent73fba685d9f725fc0c9cf4f631371aa63a7b77a7 (diff)
Fix GCC 8 warning about memcpying non-trivial class
In this case, it's easier to just make it trivial. Note how it contains a pointer which isn't deleted in the destructor (which is why we can make it trivial). glcommandqueue.cpp:181:75: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class QtCanvas3D::GlCommand’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] Change-Id: I052407b777ec43f78378fffd15310c2121146ef2 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/qtcanvas3d/glcommandqueue_p.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/imports/qtcanvas3d/glcommandqueue_p.h b/src/imports/qtcanvas3d/glcommandqueue_p.h
index b40cb66..1c2d1fb 100644
--- a/src/imports/qtcanvas3d/glcommandqueue_p.h
+++ b/src/imports/qtcanvas3d/glcommandqueue_p.h
@@ -331,31 +331,30 @@ inline bool operator!=(CanvasGlCommandQueue::GlResource lhs, CanvasGlCommandQueu
class GlCommand
{
public:
- GlCommand()
+ Q_DECL_CONSTEXPR GlCommand()
: data(0),
id(CanvasGlCommandQueue::internalNoCommand),
i1(0), i2(0), i3(0), i4(0), i5(0), i6(0), i7(0), i8(0)
{}
- GlCommand(CanvasGlCommandQueue::GlCommandId command)
+ Q_DECL_CONSTEXPR GlCommand(CanvasGlCommandQueue::GlCommandId command)
: data(0),
id(command),
i1(0), i2(0), i3(0), i4(0), i5(0), i6(0), i7(0), i8(0)
{}
- GlCommand(CanvasGlCommandQueue::GlCommandId command,
+ Q_DECL_CONSTEXPR GlCommand(CanvasGlCommandQueue::GlCommandId command,
GLint p1, GLint p2 = 0, GLint p3 = 0, GLint p4 = 0, GLint p5 = 0, GLint p6 = 0,
GLint p7 = 0, GLint p8 = 0)
: data(0),
id(command),
i1(p1), i2(p2), i3(p3), i4(p4), i5(p5), i6(p6), i7(p7), i8(p8)
{}
- GlCommand(CanvasGlCommandQueue::GlCommandId command,
+ Q_DECL_CONSTEXPR GlCommand(CanvasGlCommandQueue::GlCommandId command,
GLfloat p1, GLfloat p2 = 0.0f, GLfloat p3 = 0.0f, GLfloat p4 = 0.0f)
: data(0),
id(command),
i1(0), i2(0), i3(0), i4(0),
f1(p1), f2(p2), f3(p3), f4(p4)
{}
- ~GlCommand() {}
void deleteData() {
delete data;