summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-02-15 00:03:45 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-02-15 12:18:43 +0100
commita065eb5c478584a77ab9bac258d73df6f25c7b64 (patch)
tree083eec2d823d53a82ca93218c2f2d3e3e562bfa2
parent735fd68dacdf25e51691d2e804d5e9db643e7833 (diff)
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 <marc.mutz@kdab.com>
-rw-r--r--src/gui/painting/qdatabuffer_p.h4
1 files 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<void*>(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<void*>(buffer), capacity * sizeof(Type));
Q_CHECK_PTR(buffer);
} else {
free(buffer);