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>
bb10
Giuseppe D'Angelo 2020-02-15 00:03:45 +01:00
parent 735fd68dac
commit a065eb5c47
1 changed files with 2 additions and 2 deletions

View File

@ -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);