summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-09-08 12:14:45 -0300
committerThiago Macieira <thiago.macieira@intel.com>2015-09-22 22:46:27 +0000
commitaf6467c5328492e34f7f346d6a5a32badd963431 (patch)
treecd84b38ab01a56b5053195084cd8e12a2eaf7485
parent3d7586b760550b7d89594c8d7462fc30b868ecc6 (diff)
Fix some -Wcast-qual warnings
This is happening in code I don't usually test (32-bit, non-ICU, etc.) KeccakF-1600-opt32.c:481:22: error: cast from type 'const unsigned char*' to type 'UINT32* {aka unsigned int*}' casts away qualifiers [-Werror=cast-qual] KeccakF-1600-opt32.c:217:62: note: in definition of macro 'extractLanes' Change-Id: I42e7ef1a481840699a8dffff140209823301a07a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
-rw-r--r--src/3rdparty/sha3/KeccakF-1600-opt32.c6
-rw-r--r--src/corelib/codecs/qbig5codec.cpp4
-rw-r--r--src/corelib/codecs/qeucjpcodec.cpp4
-rw-r--r--src/corelib/codecs/qeuckrcodec.cpp4
-rw-r--r--src/corelib/codecs/qgb18030codec.cpp6
-rw-r--r--src/corelib/codecs/qjiscodec.cpp2
-rw-r--r--src/corelib/codecs/qsjiscodec.cpp2
-rw-r--r--src/corelib/io/qurlidna.cpp2
8 files changed, 15 insertions, 15 deletions
diff --git a/src/3rdparty/sha3/KeccakF-1600-opt32.c b/src/3rdparty/sha3/KeccakF-1600-opt32.c
index 4e32dca9cb..7d8ae6e19c 100644
--- a/src/3rdparty/sha3/KeccakF-1600-opt32.c
+++ b/src/3rdparty/sha3/KeccakF-1600-opt32.c
@@ -191,10 +191,10 @@ static UINT64 fromInterleaving(UINT64 x)
return x;
}
-static void setInterleavedWordsInto8bytes(UINT8* dest, UINT32* evenAndOdd)
+static void setInterleavedWordsInto8bytes(UINT8* dest, const UINT32* evenAndOdd)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
- ((UINT64*)dest)[0] = fromInterleaving(*(UINT64*)evenAndOdd);
+ ((UINT64*)dest)[0] = fromInterleaving(*(const UINT64*)evenAndOdd);
#else // (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN)
// This can be optimized
UINT64 evenAndOddWord = (UINT64)evenAndOdd[0] ^ ((UINT64)evenAndOdd[1] << 32);
@@ -214,7 +214,7 @@ static void setInterleavedWordsInto8bytes(UINT8* dest, UINT32* evenAndOdd)
{ \
unsigned i; \
for(i=0; i<(laneCount); i++) \
- setInterleavedWordsInto8bytes(data+i*8, (UINT32*)state+i*2); \
+ setInterleavedWordsInto8bytes(data+i*8, (const UINT32*)state+i*2); \
}
#endif // With or without interleaving tables
diff --git a/src/corelib/codecs/qbig5codec.cpp b/src/corelib/codecs/qbig5codec.cpp
index 6fd87bdfc9..6e6e3143bb 100644
--- a/src/corelib/codecs/qbig5codec.cpp
+++ b/src/corelib/codecs/qbig5codec.cpp
@@ -1794,7 +1794,7 @@ QByteArray QBig5Codec::convertFromUnicode(const QChar *uc, int len, ConverterSta
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
@@ -1916,7 +1916,7 @@ QByteArray QBig5hkscsCodec::convertFromUnicode(const QChar *uc, int len, Convert
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
diff --git a/src/corelib/codecs/qeucjpcodec.cpp b/src/corelib/codecs/qeucjpcodec.cpp
index af218c1ab0..7b9665f1a0 100644
--- a/src/corelib/codecs/qeucjpcodec.cpp
+++ b/src/corelib/codecs/qeucjpcodec.cpp
@@ -92,7 +92,7 @@ QEucJpCodec::QEucJpCodec() : conv(QJpUnicodeConv::newConverter(QJpUnicodeConv::D
*/
QEucJpCodec::~QEucJpCodec()
{
- delete (QJpUnicodeConv*)conv;
+ delete (const QJpUnicodeConv*)conv;
conv = 0;
}
@@ -139,7 +139,7 @@ QByteArray QEucJpCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
diff --git a/src/corelib/codecs/qeuckrcodec.cpp b/src/corelib/codecs/qeuckrcodec.cpp
index 52776efa4d..9ef9e13ebb 100644
--- a/src/corelib/codecs/qeuckrcodec.cpp
+++ b/src/corelib/codecs/qeuckrcodec.cpp
@@ -108,7 +108,7 @@ QByteArray QEucKrCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
@@ -3421,7 +3421,7 @@ QByteArray QCP949Codec::convertFromUnicode(const QChar *uc, int len, ConverterSt
}
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
diff --git a/src/corelib/codecs/qgb18030codec.cpp b/src/corelib/codecs/qgb18030codec.cpp
index feb485807f..f498072948 100644
--- a/src/corelib/codecs/qgb18030codec.cpp
+++ b/src/corelib/codecs/qgb18030codec.cpp
@@ -138,7 +138,7 @@ QByteArray QGb18030Codec::convertFromUnicode(const QChar *uc, int len, Converter
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
@@ -415,7 +415,7 @@ QByteArray QGbkCodec::convertFromUnicode(const QChar *uc, int len, ConverterStat
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
@@ -566,7 +566,7 @@ QByteArray QGb2312Codec::convertFromUnicode(const QChar *uc, int len, ConverterS
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
diff --git a/src/corelib/codecs/qjiscodec.cpp b/src/corelib/codecs/qjiscodec.cpp
index 25d8cf0cff..ac1b47a944 100644
--- a/src/corelib/codecs/qjiscodec.cpp
+++ b/src/corelib/codecs/qjiscodec.cpp
@@ -97,7 +97,7 @@ QJisCodec::QJisCodec() : conv(QJpUnicodeConv::newConverter(QJpUnicodeConv::Defau
*/
QJisCodec::~QJisCodec()
{
- delete (QJpUnicodeConv*)conv;
+ delete (const QJpUnicodeConv*)conv;
conv = 0;
}
diff --git a/src/corelib/codecs/qsjiscodec.cpp b/src/corelib/codecs/qsjiscodec.cpp
index 58b91b9d9d..5164d9e4ce 100644
--- a/src/corelib/codecs/qsjiscodec.cpp
+++ b/src/corelib/codecs/qsjiscodec.cpp
@@ -73,7 +73,7 @@ QSjisCodec::QSjisCodec() : conv(QJpUnicodeConv::newConverter(QJpUnicodeConv::Def
*/
QSjisCodec::~QSjisCodec()
{
- delete (QJpUnicodeConv*)conv;
+ delete (const QJpUnicodeConv*)conv;
conv = 0;
}
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp
index f9a0acf41a..46553d38a5 100644
--- a/src/corelib/io/qurlidna.cpp
+++ b/src/corelib/io/qurlidna.cpp
@@ -1503,7 +1503,7 @@ static bool isMappedToNothing(uint uc)
static bool containsProhibitedOuptut(const QString *str, int from)
{
const ushort *in = reinterpret_cast<const ushort *>(str->begin() + from);
- const ushort *end = (ushort *)str->data() + str->size();
+ const ushort *end = (const ushort *)str->data() + str->size();
for ( ; in < end; ++in) {
uint uc = *in;
if (QChar(uc).isHighSurrogate() && in < end - 1) {