39
39
}
40
40
else
41
41
{
42
- NSString *locName = [NSString stringWithCharacters: localeName length: lNameLength];
42
+ NSString *locName = [NSString stringWithCharacters: localeName length: ( NSUInteger ) lNameLength];
43
43
currentLocale = [NSLocale localeWithLocaleIdentifier: locName];
44
44
}
45
45
return currentLocale;
@@ -90,9 +90,9 @@ int32_t GlobalizationNative_CompareStringNative(const uint16_t* localeName, int3
90
90
if (!IsComparisonOptionSupported (comparisonOptions))
91
91
return ERROR_COMPARISON_OPTIONS_NOT_FOUND;
92
92
NSLocale *currentLocale = GetCurrentLocale (localeName, lNameLength);
93
- NSString *sourceString = [NSString stringWithCharacters: lpSource length: cwSourceLength];
93
+ NSString *sourceString = [NSString stringWithCharacters: lpSource length: ( NSUInteger ) cwSourceLength];
94
94
NSString *sourceStrPrecomposed = sourceString.precomposedStringWithCanonicalMapping ;
95
- NSString *targetString = [NSString stringWithCharacters: lpTarget length: cwTargetLength];
95
+ NSString *targetString = [NSString stringWithCharacters: lpTarget length: ( NSUInteger ) cwTargetLength];
96
96
NSString *targetStrPrecomposed = targetString.precomposedStringWithCanonicalMapping ;
97
97
98
98
if (comparisonOptions & IgnoreKanaType)
@@ -110,7 +110,7 @@ int32_t GlobalizationNative_CompareStringNative(const uint16_t* localeName, int3
110
110
111
111
NSStringCompareOptions options = ConvertFromCompareOptionsToNSStringCompareOptions (comparisonOptions, true );
112
112
NSRange comparisonRange = NSMakeRange (0 , sourceStrPrecomposed.length );
113
- return [sourceStrPrecomposed compare: targetStrPrecomposed
113
+ return ( int32_t ) [sourceStrPrecomposed compare: targetStrPrecomposed
114
114
options: options
115
115
range: comparisonRange
116
116
locale: currentLocale];
@@ -158,9 +158,9 @@ Range GlobalizationNative_IndexOfNative(const uint16_t* localeName, int32_t lNam
158
158
return result;
159
159
}
160
160
NSStringCompareOptions options = ConvertFromCompareOptionsToNSStringCompareOptions (comparisonOptions, true );
161
- NSString *searchString = [NSString stringWithCharacters: lpTarget length: cwTargetLength];
161
+ NSString *searchString = [NSString stringWithCharacters: lpTarget length: ( NSUInteger ) cwTargetLength];
162
162
NSString *searchStrCleaned = RemoveWeightlessCharacters (searchString);
163
- NSString *sourceString = [NSString stringWithCharacters: lpSource length: cwSourceLength];
163
+ NSString *sourceString = [NSString stringWithCharacters: lpSource length: ( NSUInteger ) cwSourceLength];
164
164
NSString *sourceStrCleaned = RemoveWeightlessCharacters (sourceString);
165
165
if (comparisonOptions & IgnoreKanaType)
166
166
{
@@ -170,7 +170,7 @@ Range GlobalizationNative_IndexOfNative(const uint16_t* localeName, int32_t lNam
170
170
171
171
if (sourceStrCleaned.length == 0 || searchStrCleaned.length == 0 )
172
172
{
173
- result.location = fromBeginning ? 0 : sourceString.length ;
173
+ result.location = fromBeginning ? 0 : ( int32_t ) sourceString.length ;
174
174
return result;
175
175
}
176
176
@@ -204,8 +204,8 @@ Range GlobalizationNative_IndexOfNative(const uint16_t* localeName, int32_t lNam
204
204
205
205
if (nsRange.location != NSNotFound )
206
206
{
207
- result.location = nsRange.location ;
208
- result.length = nsRange.length ;
207
+ result.location = ( int32_t ) nsRange.location ;
208
+ result.length = ( int32_t ) nsRange.length ;
209
209
// in case of CompareOptions.IgnoreCase if letters have different representations in source and search strings
210
210
// and case insensitive search appears more than one time in source string take last index for LastIndexOf and first index for IndexOf
211
211
// e.g. new CultureInfo().CompareInfo.LastIndexOf("Is \u0055\u0308 or \u0075\u0308 the same as \u00DC or \u00FC?", "U\u0308", 25,18, CompareOptions.IgnoreCase);
@@ -230,8 +230,8 @@ Range GlobalizationNative_IndexOfNative(const uint16_t* localeName, int32_t lNam
230
230
if ((comparisonOptions & IgnoreCase) && IsIndexFound (fromBeginning, (int32_t )result.location , (int32_t )precomposedRange.location ))
231
231
return result;
232
232
233
- result.location = precomposedRange.location ;
234
- result.length = precomposedRange.length ;
233
+ result.location = ( int32_t ) precomposedRange.location ;
234
+ result.length = ( int32_t ) precomposedRange.length ;
235
235
if (!(comparisonOptions & IgnoreCase))
236
236
return result;
237
237
}
@@ -249,8 +249,8 @@ Range GlobalizationNative_IndexOfNative(const uint16_t* localeName, int32_t lNam
249
249
if ((comparisonOptions & IgnoreCase) && IsIndexFound (fromBeginning, (int32_t )result.location , (int32_t )decomposedRange.location ))
250
250
return result;
251
251
252
- result.location = decomposedRange.location ;
253
- result.length = decomposedRange.length ;
252
+ result.location = ( int32_t ) decomposedRange.location ;
253
+ result.length = ( int32_t ) decomposedRange.length ;
254
254
return result;
255
255
}
256
256
@@ -270,9 +270,9 @@ int32_t GlobalizationNative_StartsWithNative(const uint16_t* localeName, int32_t
270
270
return ERROR_COMPARISON_OPTIONS_NOT_FOUND;
271
271
NSStringCompareOptions options = ConvertFromCompareOptionsToNSStringCompareOptions (comparisonOptions, true );
272
272
NSLocale *currentLocale = GetCurrentLocale (localeName, lNameLength);
273
- NSString *prefixString = [NSString stringWithCharacters: lpPrefix length: cwPrefixLength];
273
+ NSString *prefixString = [NSString stringWithCharacters: lpPrefix length: ( NSUInteger ) cwPrefixLength];
274
274
NSString *prefixStrComposed = RemoveWeightlessCharacters (prefixString.precomposedStringWithCanonicalMapping );
275
- NSString *sourceString = [NSString stringWithCharacters: lpSource length: cwSourceLength];
275
+ NSString *sourceString = [NSString stringWithCharacters: lpSource length: ( NSUInteger ) cwSourceLength];
276
276
NSString *sourceStrComposed = RemoveWeightlessCharacters (sourceString.precomposedStringWithCanonicalMapping );
277
277
if (comparisonOptions & IgnoreKanaType)
278
278
{
@@ -282,7 +282,7 @@ int32_t GlobalizationNative_StartsWithNative(const uint16_t* localeName, int32_t
282
282
283
283
NSRange sourceRange = NSMakeRange (0 , prefixStrComposed.length > sourceStrComposed.length ? sourceStrComposed.length : prefixStrComposed.length );
284
284
285
- int32_t result = [sourceStrComposed compare: prefixStrComposed
285
+ int32_t result = ( int32_t ) [sourceStrComposed compare: prefixStrComposed
286
286
options: options
287
287
range: sourceRange
288
288
locale: currentLocale];
@@ -302,19 +302,19 @@ int32_t GlobalizationNative_EndsWithNative(const uint16_t* localeName, int32_t l
302
302
return ERROR_COMPARISON_OPTIONS_NOT_FOUND;
303
303
NSStringCompareOptions options = ConvertFromCompareOptionsToNSStringCompareOptions (comparisonOptions, true );
304
304
NSLocale *currentLocale = GetCurrentLocale (localeName, lNameLength);
305
- NSString *suffixString = [NSString stringWithCharacters: lpSuffix length: cwSuffixLength];
305
+ NSString *suffixString = [NSString stringWithCharacters: lpSuffix length: ( NSUInteger ) cwSuffixLength];
306
306
NSString *suffixStrComposed = RemoveWeightlessCharacters (suffixString.precomposedStringWithCanonicalMapping );
307
- NSString *sourceString = [NSString stringWithCharacters: lpSource length: cwSourceLength];
307
+ NSString *sourceString = [NSString stringWithCharacters: lpSource length: ( NSUInteger ) cwSourceLength];
308
308
NSString *sourceStrComposed = RemoveWeightlessCharacters (sourceString.precomposedStringWithCanonicalMapping );
309
309
if (comparisonOptions & IgnoreKanaType)
310
310
{
311
311
suffixStrComposed = ConvertToKatakana (suffixStrComposed);
312
312
sourceStrComposed = ConvertToKatakana (sourceStrComposed);
313
313
}
314
- int32_t startIndex = suffixStrComposed.length > sourceStrComposed.length ? 0 : sourceStrComposed.length - suffixStrComposed.length ;
314
+ NSUInteger startIndex = suffixStrComposed.length > sourceStrComposed.length ? 0 : sourceStrComposed.length - suffixStrComposed.length ;
315
315
NSRange sourceRange = NSMakeRange (startIndex, sourceStrComposed.length - startIndex);
316
316
317
- int32_t result = [sourceStrComposed compare: suffixStrComposed
317
+ int32_t result = ( int32_t ) [sourceStrComposed compare: suffixStrComposed
318
318
options: options
319
319
range: sourceRange
320
320
locale: currentLocale];
@@ -334,7 +334,7 @@ int32_t GlobalizationNative_GetSortKeyNative(const uint16_t* localeName, int32_t
334
334
}
335
335
if (!IsComparisonOptionSupported (options))
336
336
return 0 ;
337
- NSString *sourceString = [NSString stringWithCharacters: lpStr length: cwStrLength];
337
+ NSString *sourceString = [NSString stringWithCharacters: lpStr length: ( NSUInteger ) cwStrLength];
338
338
if (options & IgnoreKanaType)
339
339
{
340
340
sourceString = ConvertToKatakana (sourceString);
@@ -363,6 +363,7 @@ int32_t GlobalizationNative_GetSortKeyNative(const uint16_t* localeName, int32_t
363
363
if (result)
364
364
return (int32_t )usedLength;
365
365
366
+ (void )cbSortKeyLength; // ignore unused parameter
366
367
return 0 ;
367
368
}
368
369
}
0 commit comments