From a065eb5c478584a77ab9bac258d73df6f25c7b64 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sat, 15 Feb 2020 00:03:45 +0100 Subject: Silence another -Werror=class-memaccess QDataBuffer when used with non trivally copiable types will try to realloc them, causing GCC to complain. Change-Id: I778d32d00774b0a53b85257be0064f19d9fb2bb9 Reviewed-by: Marc Mutz --- src/gui/painting/qdatabuffer_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h index 181d19da0b..676750b716 100644 --- a/src/gui/painting/qdatabuffer_p.h +++ b/src/gui/painting/qdatabuffer_p.h @@ -116,7 +116,7 @@ public: capacity = 1; while (capacity < size) capacity *= 2; - buffer = (Type*) realloc(buffer, capacity * sizeof(Type)); + buffer = (Type*) realloc(static_cast(buffer), capacity * sizeof(Type)); Q_CHECK_PTR(buffer); } } @@ -124,7 +124,7 @@ public: inline void shrink(int size) { capacity = size; if (size) { - buffer = (Type*) realloc(buffer, capacity * sizeof(Type)); + buffer = (Type*) realloc(static_cast(buffer), capacity * sizeof(Type)); Q_CHECK_PTR(buffer); } else { free(buffer); -- cgit v1.2.3