Skip to content

Commit d959640

Browse files
authored
Merge pull request #936 from mark1smi/CFCharacterSet_bitmath
2 parents a7a902a + 36e0dee commit d959640

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CoreFoundation/String.subproj/CFCharacterSet.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ static Boolean __CFCSetIsBitmapEqualToRange(const UInt32 *bits, UniChar firstCha
216216
UInt32 lastCharMask;
217217

218218
length = firstCharIndex % sizeof(UInt32);
219-
firstCharMask = (((((UInt32)0xFF) << (firstChar & (BITSPERBYTE - 1))) & 0xFF) << (((sizeof(UInt32) - 1) - length) * BITSPERBYTE)) | (((UInt32)0xFFFFFFFF) >> ((length + 1) * BITSPERBYTE));
219+
firstCharMask = (((((UInt32)0xFF) << (firstChar & (BITSPERBYTE - 1))) & 0xFF) << (((sizeof(UInt32) - 1) - length) * BITSPERBYTE)) | (UInt32)(((UInt64)0xFFFFFFFF) >> ((length + 1) * BITSPERBYTE));
220220

221221
length = lastCharIndex % sizeof(UInt32);
222-
lastCharMask = ((((UInt32)0xFF) >> ((BITSPERBYTE - 1) - (lastChar & (BITSPERBYTE - 1)))) << (((sizeof(UInt32) - 1) - length) * BITSPERBYTE)) | (((UInt32)0xFFFFFFFF) << ((sizeof(UInt32) - length) * BITSPERBYTE));
222+
lastCharMask = ((((UInt32)0xFF) >> ((BITSPERBYTE - 1) - (lastChar & (BITSPERBYTE - 1)))) << (((sizeof(UInt32) - 1) - length) * BITSPERBYTE)) | (UInt32)(((UInt64)0xFFFFFFFF) << ((sizeof(UInt32) - length) * BITSPERBYTE));
223223

224224
firstCharIndex = firstChar >> LOG_BPLW;
225225
lastCharIndex = lastChar >> LOG_BPLW;

0 commit comments

Comments
 (0)