Skip to content

Commit

Permalink
Cast unsigned longs to ints when using uregx functions to remove buil…
Browse files Browse the repository at this point in the history
…d warnings.
  • Loading branch information
Ryan Maxwell committed Jan 12, 2013
1 parent ef696c0 commit 8d7a905
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ICUMatcher.m
Expand Up @@ -106,7 +106,7 @@ -(NSString *)groupAtIndex:(unsigned)groupIndex {
while(YES) {
UErrorCode status = 0;
UChar *dest = (UChar *)NSZoneCalloc([self zone], groupSize, sizeof(UChar));
int32_t buffSize = uregex_group(re, groupIndex, dest, groupSize, &status);
int32_t buffSize = uregex_group(re, groupIndex, dest, (int32_t)groupSize, &status);

if(U_BUFFER_OVERFLOW_ERROR == status) {
groupSize *= 2;
Expand Down Expand Up @@ -167,9 +167,9 @@ -(NSString *)performReplacementWithString:(NSString *)aReplacementString replace

status = 0;
if(replacingAll)
resultLength = uregex_replaceAll(re, replacementText, -1, destString, destStringBufferSize, &status);
resultLength = uregex_replaceAll(re, replacementText, -1, destString, (int32_t)destStringBufferSize, &status);
else
resultLength = uregex_replaceFirst(re, replacementText, -1, destString, destStringBufferSize, &status);
resultLength = uregex_replaceFirst(re, replacementText, -1, destString, (int32_t)destStringBufferSize, &status);

// realloc some more space if possible
if(status == U_BUFFER_OVERFLOW_ERROR) {
Expand Down
2 changes: 1 addition & 1 deletion ICUPattern.m
Expand Up @@ -198,7 +198,7 @@ -(NSArray *)componentsSplitFromString:(NSString *)stringToSplit
UChar *destFields[destFieldsCapacity];
int numberOfComponents = uregex_split([self re],
destBuf,
destCapacity,
(int32_t)destCapacity,
&requiredCapacity,
destFields,
destFieldsCapacity,
Expand Down

0 comments on commit 8d7a905

Please sign in to comment.