From 6cbc9c6d35b527da4aa0fd2edab7430790a66cf0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Jun 2016 15:21:34 -0700 Subject: 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 --- src/corelib/tools/qarraydataops.h | 8 +++++--- 1 file 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(begin + displace), static_cast(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(begin), static_cast(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(destination), static_cast(source), n * sizeof(T)); size -= (source - destination); } -- cgit v1.2.3