summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-06-15 15:21:34 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-06-16 04:34:05 +0000
commit6cbc9c6d35b527da4aa0fd2edab7430790a66cf0 (patch)
tree352ea14f1ff5fedc396458a3a316f36f0364c32b
parent7b23ebefb2360feb139ff6e10d2253396e58721e (diff)
QArrayDataOps: silence Clang warning about memmove
Same as 9224255f13952e5b4092208c8cae1a31ab5c6a19: some Qt types are polymorphic and are marked as movable, so Clang complains. qarraydataops.h:608:27: error: destination for this 'memmove' call is a pointer to class containing a dynamic class 'QPixmap'; vtable pointer will be overwritten [-Werror,-Wdynamic-class-memaccess] qarraydataops.h:608:61: error: source of this 'memmove' call is a pointer to class containing a dynamic class 'QPixmap'; vtable pointer will be moved [-Werror,-Wdynamic-class-memaccess] Change-Id: Ib57b52598e2f452985e9fffd145861e025b81550 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/corelib/tools/qarraydataops.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index 47df15ddaa..6bb8280ca8 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -319,7 +319,8 @@ struct QMovableArrayOps
, end(finish)
, displace(diff)
{
- ::memmove(begin + displace, begin, (end - begin) * sizeof(T));
+ ::memmove(static_cast<void *>(begin + displace), static_cast<void *>(begin),
+ (end - begin) * sizeof(T));
}
void commit() { displace = 0; }
@@ -327,7 +328,8 @@ struct QMovableArrayOps
~ReversibleDisplace()
{
if (displace)
- ::memmove(begin, begin + displace, (end - begin) * sizeof(T));
+ ::memmove(static_cast<void *>(begin), static_cast<void *>(begin + displace),
+ (end - begin) * sizeof(T));
}
T *const begin;
@@ -384,7 +386,7 @@ struct QMovableArrayOps
~Mover()
{
- ::memmove(destination, source, n * sizeof(T));
+ ::memmove(static_cast<void *>(destination), static_cast<const void *>(source), n * sizeof(T));
size -= (source - destination);
}