Fix more warnings, found by cross-compiling Qt

KeccakF-1600-opt32.c:497:5: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
harfbuzz-thai.c:264:49: error: comparison is always false due to limited range of data type [-Werror=type-limits]

These warnings are caused by "char" defaulting to unsigned on ARM. In
particular, the second warning was introduced by commit
785e95ef0a, which is not upstream...

qbenchmarkvalgrind.cpp:224:5: error: variable ‘_qzz_res’ set but not used [-Werror=unused-but-set-variable]

This one was fixed for x86-64 in 7b54571ec2 but not
for the other platforms.

KeccakF-1600-opt32.c:250:5: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

This one is wasn't caught before because it applies only to big-endian
code.

Change-Id: Ice33b639e55d95140cbf912bb81b6f508ed3744a
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Thiago Macieira 2013-04-22 16:12:33 -07:00 committed by The Qt Project
parent e68845ec78
commit 75fba93fc6
3 changed files with 11 additions and 5 deletions

View File

@ -261,7 +261,7 @@ static HB_Bool HB_ThaiConvertStringToGlyphIndices (HB_ShaperItem *item)
for (int lgi = 0; lgi < lgn; lgi++) {
if ( rglyphs[lgi] == 0xdd/*TH_BLANK_BASE_GLYPH*/ ) {
glyphString[slen++] = C_DOTTED_CIRCLE;
} else if (cstr[i] == (signed char)~0) {
} else if ((unsigned char)cstr[i] == (unsigned char)~0) {
// The only glyphs that should be passed to this function that cannot be mapped to
// tis620 are the ones of type Inherited class. Pass these glyphs untouched.
glyphString[slen++] = string[i];

View File

@ -114,8 +114,8 @@ static void setInterleavedWordsInto8bytes(UINT8* dest, UINT32 even, UINT32 odd)
const UINT32 * pI = (const UINT32 *)input; \
UINT32 * pS = state; \
UINT32 t, x0, x1; \
int i; \
for (i = (rateInLanes)-1; i >= 0; --i) \
int i; \
for (i = (int)(rateInLanes)-1; i >= 0; --i) \
{ \
x0 = *(pI++); \
t = (x0 ^ (x0 >> 1)) & 0x22222222UL; x0 = x0 ^ t ^ (t << 1); \
@ -170,7 +170,7 @@ static void xor8bytesIntoInterleavedWords(UINT32* evenAndOdd, const UINT8* sourc
#define xorLanesIntoState(laneCount, state, input) \
{ \
int i; \
unsigned i; \
for(i=0; i<(laneCount); i++) \
xor8bytesIntoInterleavedWords(state+i*2, input+i*8); \
}
@ -212,7 +212,7 @@ static void setInterleavedWordsInto8bytes(UINT8* dest, UINT32* evenAndOdd)
#define extractLanes(laneCount, state, data) \
{ \
int i; \
unsigned i; \
for(i=0; i<(laneCount); i++) \
setInterleavedWordsInto8bytes(data+i*8, (UINT32*)state+i*2); \
}

View File

@ -133,6 +133,7 @@
_zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
{ \
(_zzq_rlval) = (_zzq_default); \
(void)_zzq_rlval; \
}
#else /* ! NVALGRIND */
@ -205,6 +206,7 @@ typedef
: "cc", "memory" \
); \
_zzq_rlval = _zzq_result; \
(void)_zzq_rlval; \
}
#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
@ -319,6 +321,7 @@ typedef
: "b" (_zzq_default), "b" (_zzq_ptr) \
: "cc", "memory", "r3", "r4"); \
_zzq_rlval = _zzq_result; \
(void)_zzq_rlval; \
}
#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
@ -377,6 +380,7 @@ typedef
: "0" (_zzq_default), "r" (_zzq_ptr) \
: "cc", "memory"); \
_zzq_rlval = _zzq_result; \
(void)_zzq_rlval; \
}
#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
@ -447,6 +451,7 @@ typedef
: "b" (_zzq_ptr) \
: "r3", "r4", "cc", "memory"); \
_zzq_rlval = _zzq_result; \
(void)_zzq_rlval; \
}
#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
@ -519,6 +524,7 @@ typedef
: "b" (_zzq_ptr) \
: "r3", "r4", "cc", "memory"); \
_zzq_rlval = _zzq_result; \
(void)_zzq_rlval; \
}
#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \