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
parent
735fd68dac
commit
a065eb5c47
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue