diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index d0f83d2b6a..7e1b43f9b1 100644 --- a/src/corelib/tools/qarraydataops.h +++ b/src/corelib/tools/qarraydataops.h @@ -65,7 +65,7 @@ struct QPodArrayOps Q_ASSERT(newSize > uint(this->size)); Q_ASSERT(newSize <= this->alloc); - ::memset(this->end(), 0, (newSize - this->size) * sizeof(T)); + ::memset(static_cast(this->end()), 0, (newSize - this->size) * sizeof(T)); this->size = int(newSize); } @@ -121,8 +121,9 @@ struct QPodArrayOps Q_ASSERT(e <= where || b > this->end()); // No overlap Q_ASSERT(size_t(e - b) <= this->alloc - uint(this->size)); - ::memmove(where + (e - b), where, (static_cast(this->end()) - where) * sizeof(T)); - ::memcpy(where, b, (e - b) * sizeof(T)); + ::memmove(static_cast(where + (e - b)), static_cast(where), + (static_cast(this->end()) - where) * sizeof(T)); + ::memcpy(static_cast(where), static_cast(b), (e - b) * sizeof(T)); this->size += (e - b); } @@ -133,7 +134,8 @@ struct QPodArrayOps Q_ASSERT(b >= this->begin() && b < this->end()); Q_ASSERT(e > this->begin() && e < this->end()); - ::memmove(b, e, (static_cast(this->end()) - e) * sizeof(T)); + ::memmove(static_cast(b), static_cast(e), + (static_cast(this->end()) - e) * sizeof(T)); this->size -= (e - b); } };