summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-03-05 22:25:45 -0800
committerThiago Macieira <thiago.macieira@intel.com>2015-07-20 15:54:19 +0000
commit28f5207ca08bed5c16474091a205bc8351574584 (patch)
tree28512396f684a5e57eaedf18614a0e08456f4b49 /src/corelib/tools/qbytearray.cpp
parent826a83937da18616ca5358f66598ad991b7c2cee (diff)
QtCore: Fix const correctness in old style casts
Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c8d4b2920a11fb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r--src/corelib/tools/qbytearray.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index da5d00311a..4138c8cb18 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -510,7 +510,7 @@ QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel)
int res;
do {
bazip.resize(len + 4);
- res = ::compress2((uchar*)bazip.data()+4, &len, (uchar*)data, nbytes, compressionLevel);
+ res = ::compress2((uchar*)bazip.data()+4, &len, data, nbytes, compressionLevel);
switch (res) {
case Z_OK:
@@ -601,7 +601,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
d->size = 0; // Shut up valgrind "uninitialized variable" warning
int res = ::uncompress((uchar*)d->data(), &len,
- (uchar*)data+4, nbytes-4);
+ data+4, nbytes-4);
switch (res) {
case Z_OK:
@@ -2148,9 +2148,9 @@ QByteArray &QByteArray::replace(const char *before, int bsize, const char *after
}
if (a != after)
- ::free((char *)a);
+ ::free(const_cast<char *>(a));
if (b != before)
- ::free((char *)b);
+ ::free(const_cast<char *>(b));
return *this;