mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Change incorrect use of unsigned integers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39977 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fc436a1ea4
commit
d05eee4fda
2 changed files with 11 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
|||
2016-07-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSICUString.m (UTextNSStringAccess):
|
||||
Fix to use signed integer variables so all the comparisons with zero
|
||||
as a boundary actually work as intended etc (spotted by Wolfgang).
|
||||
|
||||
2016-07-12 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/GSICUString.m (UTextNSStringAccess): Fix unsigned
|
||||
|
|
|
@ -55,9 +55,9 @@ UBool
|
|||
UTextNSStringAccess(UText *ut, int64_t nativeIndex, UBool forward)
|
||||
{
|
||||
NSString *str = (NSString*)ut->p;
|
||||
NSUInteger length = (-1 == ut->c) ? [str length] : ut->c;
|
||||
NSUInteger nativeStart = ut->chunkNativeStart;
|
||||
NSUInteger nativeLimit = ut->chunkNativeLimit;
|
||||
NSInteger length = (-1 == ut->c) ? (NSInteger)[str length] : ut->c;
|
||||
NSInteger nativeStart = ut->chunkNativeStart;
|
||||
NSInteger nativeLimit = ut->chunkNativeLimit;
|
||||
NSRange r;
|
||||
|
||||
if (forward)
|
||||
|
@ -118,11 +118,8 @@ UTextNSStringAccess(UText *ut, int64_t nativeIndex, UBool forward)
|
|||
{
|
||||
nativeLimit = length;
|
||||
}
|
||||
if (nativeLimit >= chunkSize)
|
||||
{
|
||||
nativeStart = nativeLimit - chunkSize;
|
||||
}
|
||||
else
|
||||
nativeStart = nativeLimit - chunkSize;
|
||||
if (nativeStart < 0)
|
||||
{
|
||||
nativeStart = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue