Fix QString latin1 conversion and comparison for -optimize-size build
Change-Id: I5f0ae946151e9733cbe21cb24387636ba68bc177 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
96218681f2
commit
57b09b903e
@ -711,9 +711,15 @@ static void qt_to_latin1_internal(uchar *dst, const ushort *src, qsizetype lengt
|
|||||||
}
|
}
|
||||||
|
|
||||||
length = length % 4;
|
length = length % 4;
|
||||||
|
# else
|
||||||
|
length = length % 16;
|
||||||
|
# endif // optimize size
|
||||||
|
|
||||||
|
// advance dst, src for tail processing
|
||||||
dst += offset;
|
dst += offset;
|
||||||
src += offset;
|
src += offset;
|
||||||
|
|
||||||
|
# if !defined(__OPTIMIZE_SIZE__)
|
||||||
return UnrollTailLoop<3>::exec(length, [=](int i) {
|
return UnrollTailLoop<3>::exec(length, [=](int i) {
|
||||||
if (Checked)
|
if (Checked)
|
||||||
dst[i] = (src[i]>0xff) ? '?' : (uchar) src[i];
|
dst[i] = (src[i]>0xff) ? '?' : (uchar) src[i];
|
||||||
@ -1072,11 +1078,13 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l)
|
|||||||
// still matched
|
// still matched
|
||||||
offset += 4;
|
offset += 4;
|
||||||
}
|
}
|
||||||
|
# endif // optimize size
|
||||||
|
|
||||||
// reset uc and c
|
// reset uc and c
|
||||||
uc += offset;
|
uc += offset;
|
||||||
c += offset;
|
c += offset;
|
||||||
|
|
||||||
|
# if !defined(__OPTIMIZE_SIZE__)
|
||||||
const auto lambda = [=](size_t i) { return uc[i] - ushort(c[i]); };
|
const auto lambda = [=](size_t i) { return uc[i] - ushort(c[i]); };
|
||||||
return UnrollTailLoop<MaxTailLength>::exec(e - uc, 0, lambda, lambda);
|
return UnrollTailLoop<MaxTailLength>::exec(e - uc, 0, lambda, lambda);
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user