mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-12 09:01:05 +00:00
fixups for ICU changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34858 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
16ff2d0e26
commit
fc0a0e782f
3 changed files with 39 additions and 16 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2012-03-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Headers/GNUstepBase/config.h.in: add missing ICU headers
|
||||||
|
* Source/NSString.m: fix minor coding standard violations.
|
||||||
|
|
||||||
2012-03-01 Jens Alfke <jens@mooseyard.com>
|
2012-03-01 Jens Alfke <jens@mooseyard.com>
|
||||||
|
|
||||||
* Source/NSString.m:
|
* Source/NSString.m:
|
||||||
|
|
|
@ -624,6 +624,9 @@
|
||||||
/* Define to 1 if you have the <unicode/ucal.h> header file. */
|
/* Define to 1 if you have the <unicode/ucal.h> header file. */
|
||||||
#undef HAVE_UNICODE_UCAL_H
|
#undef HAVE_UNICODE_UCAL_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unicode/ucol.h> header file. */
|
||||||
|
#undef HAVE_UNICODE_UCOL_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <unicode/ucurr.h> header file. */
|
/* Define to 1 if you have the <unicode/ucurr.h> header file. */
|
||||||
#undef HAVE_UNICODE_UCURR_H
|
#undef HAVE_UNICODE_UCURR_H
|
||||||
|
|
||||||
|
@ -645,6 +648,12 @@
|
||||||
/* Define to 1 if you have the <unicode/uregex.h> header file. */
|
/* Define to 1 if you have the <unicode/uregex.h> header file. */
|
||||||
#undef HAVE_UNICODE_UREGEX_H
|
#undef HAVE_UNICODE_UREGEX_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unicode/usearch.h> header file. */
|
||||||
|
#undef HAVE_UNICODE_USEARCH_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unicode/ustring.h> header file. */
|
||||||
|
#undef HAVE_UNICODE_USTRING_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#undef HAVE_UNISTD_H
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
|
|
@ -2100,8 +2100,8 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GS_USE_ICU == 1
|
#if GS_USE_ICU == 1
|
||||||
if (locale != nil &&
|
if (locale != nil
|
||||||
((mask & NSLiteralSearch) != NSLiteralSearch))
|
&& ((mask & NSLiteralSearch) != NSLiteralSearch))
|
||||||
{
|
{
|
||||||
NSRange result = NSMakeRange(NSNotFound, 0);
|
NSRange result = NSMakeRange(NSNotFound, 0);
|
||||||
|
|
||||||
|
@ -2115,10 +2115,14 @@ handle_printf_atsign (FILE *stream,
|
||||||
{
|
{
|
||||||
NSUInteger countSelf = aRange.length;
|
NSUInteger countSelf = aRange.length;
|
||||||
NSUInteger countOther = [aString length];
|
NSUInteger countOther = [aString length];
|
||||||
unichar *charsSelf = NSZoneMalloc(NSDefaultMallocZone(), countSelf * sizeof(unichar));
|
unichar *charsSelf;
|
||||||
unichar *charsOther = NSZoneMalloc(NSDefaultMallocZone(), countOther * sizeof(unichar));
|
unichar *charsOther;
|
||||||
UStringSearch *search = NULL;
|
UStringSearch *search = NULL;
|
||||||
|
|
||||||
|
charsSelf = NSZoneMalloc(NSDefaultMallocZone(),
|
||||||
|
countSelf * sizeof(unichar));
|
||||||
|
charsOther = NSZoneMalloc(NSDefaultMallocZone(),
|
||||||
|
countOther * sizeof(unichar));
|
||||||
if ((mask & NSCaseInsensitiveSearch) == NSCaseInsensitiveSearch)
|
if ((mask & NSCaseInsensitiveSearch) == NSCaseInsensitiveSearch)
|
||||||
{
|
{
|
||||||
ucol_setStrength(coll, UCOL_PRIMARY);
|
ucol_setStrength(coll, UCOL_PRIMARY);
|
||||||
|
@ -4940,8 +4944,8 @@ static NSFileManager *fm = nil;
|
||||||
[NSException raise: NSInvalidArgumentException format: @"compare with nil"];
|
[NSException raise: NSInvalidArgumentException format: @"compare with nil"];
|
||||||
|
|
||||||
#if GS_USE_ICU == 1
|
#if GS_USE_ICU == 1
|
||||||
if ((mask & NSLiteralSearch) != NSLiteralSearch &&
|
if ((mask & NSLiteralSearch) != NSLiteralSearch
|
||||||
nil != dict)
|
&& nil != dict)
|
||||||
{
|
{
|
||||||
NSString *localeId = [dict objectForKey: NSLocaleIdentifier];
|
NSString *localeId = [dict objectForKey: NSLocaleIdentifier];
|
||||||
const char *localeCString = [localeId UTF8String];
|
const char *localeCString = [localeId UTF8String];
|
||||||
|
@ -4952,10 +4956,14 @@ static NSFileManager *fm = nil;
|
||||||
{
|
{
|
||||||
NSUInteger countSelf = compareRange.length;
|
NSUInteger countSelf = compareRange.length;
|
||||||
NSUInteger countOther = [string length];
|
NSUInteger countOther = [string length];
|
||||||
unichar *charsSelf = NSZoneMalloc(NSDefaultMallocZone(), countSelf * sizeof(unichar));
|
unichar *charsSelf;
|
||||||
unichar *charsOther = NSZoneMalloc(NSDefaultMallocZone(), countOther * sizeof(unichar));
|
unichar *charsOther;
|
||||||
UCollationResult result;
|
UCollationResult result;
|
||||||
|
|
||||||
|
charsSelf = NSZoneMalloc(NSDefaultMallocZone(),
|
||||||
|
countSelf * sizeof(unichar));
|
||||||
|
charsOther = NSZoneMalloc(NSDefaultMallocZone(),
|
||||||
|
countOther * sizeof(unichar));
|
||||||
// Copy to buffer
|
// Copy to buffer
|
||||||
|
|
||||||
[self getCharacters: charsSelf range: compareRange];
|
[self getCharacters: charsSelf range: compareRange];
|
||||||
|
@ -4973,7 +4981,8 @@ static NSFileManager *fm = nil;
|
||||||
ucol_setAttribute(coll, UCOL_NUMERIC_COLLATION, UCOL_ON, &status);
|
ucol_setAttribute(coll, UCOL_NUMERIC_COLLATION, UCOL_ON, &status);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ucol_strcoll(coll, charsSelf, countSelf, charsOther, countOther);
|
result = ucol_strcoll(coll,
|
||||||
|
charsSelf, countSelf, charsOther, countOther);
|
||||||
|
|
||||||
NSZoneFree(NSDefaultMallocZone(), charsSelf);
|
NSZoneFree(NSDefaultMallocZone(), charsSelf);
|
||||||
NSZoneFree(NSDefaultMallocZone(), charsOther);
|
NSZoneFree(NSDefaultMallocZone(), charsOther);
|
||||||
|
|
Loading…
Reference in a new issue