ICU-2561 remove compiler warnings due to sign of LEUnicode32

X-SVN-Rev: 10784
This commit is contained in:
Eric Mader 2002-12-24 17:15:36 +00:00
parent 9122b439ab
commit 070840a211

View File

@ -11,6 +11,9 @@
#include "sfnt.h"
#include "cmaps.h"
#define SWAPU16(code) ((LEUnicode16) SWAPW(code))
#define SWAPU32(code) ((LEUnicode32) SWAPL(code))
//
// Finds the high bit by binary searching
// through the bits in value.
@ -122,23 +125,23 @@ LEGlyphID CMAPFormat4Mapper::unicodeToGlyph(LEUnicode32 unicode32) const
le_uint16 probe = 1 << fEntrySelector;
LEGlyphID result = 0;
if (SWAPW(fStartCodes[fRangeShift]) <= unicode) {
if (SWAPU16(fStartCodes[fRangeShift]) <= unicode) {
index = fRangeShift;
}
while (probe > (1 << 0)) {
probe >>= 1;
if (SWAPW(fStartCodes[index + probe]) <= unicode) {
if (SWAPU16(fStartCodes[index + probe]) <= unicode) {
index += probe;
}
}
if (unicode >= SWAPW(fStartCodes[index]) && unicode <= SWAPW(fEndCodes[index])) {
if (unicode >= SWAPU16(fStartCodes[index]) && unicode <= SWAPU16(fEndCodes[index])) {
if (fIdRangeOffset[index] == 0) {
result = (LEGlyphID) unicode;
} else {
le_uint16 offset = unicode - SWAPW(fStartCodes[index]);
le_uint16 offset = unicode - SWAPU16(fStartCodes[index]);
le_uint16 rangeOffset = SWAPW(fIdRangeOffset[index]);
le_uint16 *glyphIndexTable = (le_uint16 *) ((char *) &fIdRangeOffset[index] + rangeOffset);
@ -171,20 +174,20 @@ LEGlyphID CMAPGroupMapper::unicodeToGlyph(LEUnicode32 unicode32) const
le_int32 probe = fPower;
le_int32 range = 0;
if (SWAPL(fGroups[fRangeOffset].startCharCode) <= unicode32) {
if (SWAPU32(fGroups[fRangeOffset].startCharCode) <= unicode32) {
range = fRangeOffset;
}
while (probe > (1 << 0)) {
probe >>= 1;
if (SWAPL(fGroups[range + probe].startCharCode) <= unicode32) {
if (SWAPU32(fGroups[range + probe].startCharCode) <= unicode32) {
range += probe;
}
}
if (SWAPL(fGroups[range].startCharCode) <= unicode32 && SWAPL(fGroups[range].endCharCode) >= unicode32) {
return (LEGlyphID) (SWAPL(fGroups[range].startGlyphCode) + unicode32 - SWAPL(fGroups[range].startCharCode));
if (SWAPU32(fGroups[range].startCharCode) <= unicode32 && SWAPU32(fGroups[range].endCharCode) >= unicode32) {
return (LEGlyphID) (SWAPU32(fGroups[range].startGlyphCode) + unicode32 - SWAPU32(fGroups[range].startCharCode));
}
return 0;