aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2019-03-21 16:36:48 +0100
committerHans Verkuil <hans.verkuil@cisco.com>2019-03-21 16:36:48 +0100
commitd624ed9231ce4e9eaa54557ca69d629883a64bde (patch)
treeba517430ee62ae0dfb3e9f4f72440dc0edeb3e1d
parent7bcf9c69b0fe38fbff8c8e5798b3fb31c34ee1c7 (diff)
cv4l-helpers.h: fix compiler warningHEADmaster
In file included from v4l2-compliance.h:42, from v4l2-test-input-output.cpp:32: ../common/cv4l-helpers.h: In member function ‘void cv4l_buffer::init(const cv4l_buffer&)’: ../common/cv4l-helpers.h:843:29: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class cv4l_buffer’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess] memcpy(this, &b, sizeof(b)); ^ ../common/cv4l-helpers.h:817:7: note: ‘class cv4l_buffer’ declared here class cv4l_buffer : public v4l_buffer { ^~~~~~~~~~~ Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/common/cv4l-helpers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/common/cv4l-helpers.h b/utils/common/cv4l-helpers.h
index e4d11f07..f9ee7677 100644
--- a/utils/common/cv4l-helpers.h
+++ b/utils/common/cv4l-helpers.h
@@ -840,7 +840,7 @@ public:
}
void init(const cv4l_buffer &b)
{
- memcpy(this, &b, sizeof(b));
+ *this = b;
if (v4l_type_is_planar(g_type()))
buf.m.planes = planes;
}

Privacy Policy