fix some compiler warnings

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-05-11 15:59:10 +00:00
parent ec8499c7e2
commit db88a21f69
3 changed files with 5 additions and 4 deletions

View file

@ -213,7 +213,7 @@ PassRefPtr<UString::Rep> Identifier::addSlowCase(JSGlobalData* globalData, UStri
Q_ASSERT(!r->isIdentifier());
if (r->size() == 1) {
UChar c = r->data()[0];
if (c <= 0xFF)
if (c <= 0xFF) {
r = globalData->smallStrings.singleCharacterStringRep(c);
if (r->isIdentifier()) {
#ifndef NDEBUG
@ -221,6 +221,7 @@ PassRefPtr<UString::Rep> Identifier::addSlowCase(JSGlobalData* globalData, UStri
#endif
return r;
}
}
}
if (!r->size()) {
UString::Rep::empty().hash();

View file

@ -885,13 +885,13 @@ static ALWAYS_INLINE void d2b(BigInt& b, U* d, int* e, int* bits)
if ((k = lo0bits(&y))) {
x[0] = y | (z << (32 - k));
z >>= k;
} else
} else {
x[0] = y;
if (z) {
b.resize(2);
x[1] = z;
}
}
#ifndef Sudden_Underflow
i = b.size();
#endif

View file

@ -277,7 +277,7 @@ QString QHostInfo::localDomainName()
// using thread-safe version
res_state state = static_cast<res_state>(malloc(sizeof(res_state)));
Q_CHECK_PTR(state);
memset(state, 0, sizeof(res_state));
memset(state, 0, sizeof(*state));
res_ninit(state);
QString domainName = QUrl::fromAce(state->defdname);
if (domainName.isEmpty())