X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b331163bffd790ced0e88b73f44f86d49ccc48a5..ef6cf650f4a75c3f97de06b51fa104f2069b9ea2:/icuSources/common/dictionarydata.cpp?ds=inline diff --git a/icuSources/common/dictionarydata.cpp b/icuSources/common/dictionarydata.cpp index cb594c6b..c0e6662d 100644 --- a/icuSources/common/dictionarydata.cpp +++ b/icuSources/common/dictionarydata.cpp @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 2014, International Business Machines +* Copyright (C) 2014-2016, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* * dictionarydata.h @@ -45,13 +45,13 @@ int32_t UCharsDictionaryMatcher::matches(UText *text, int32_t maxLength, int32_t int32_t *prefix) const { UCharsTrie uct(characters); - int32_t startingTextIndex = utext_getNativeIndex(text); + int32_t startingTextIndex = (int32_t)utext_getNativeIndex(text); int32_t wordCount = 0; int32_t codePointsMatched = 0; for (UChar32 c = utext_next32(text); c >= 0; c=utext_next32(text)) { UStringTrieResult result = (codePointsMatched == 0) ? uct.first(c) : uct.next(c); - int32_t lengthMatched = utext_getNativeIndex(text) - startingTextIndex; + int32_t lengthMatched = (int32_t)utext_getNativeIndex(text) - startingTextIndex; codePointsMatched += 1; if (USTRINGTRIE_HAS_VALUE(result)) { if (wordCount < limit) { @@ -112,13 +112,13 @@ int32_t BytesDictionaryMatcher::matches(UText *text, int32_t maxLength, int32_t int32_t *lengths, int32_t *cpLengths, int32_t *values, int32_t *prefix) const { BytesTrie bt(characters); - int32_t startingTextIndex = utext_getNativeIndex(text); + int32_t startingTextIndex = (int32_t)utext_getNativeIndex(text); int32_t wordCount = 0; int32_t codePointsMatched = 0; for (UChar32 c = utext_next32(text); c >= 0; c=utext_next32(text)) { UStringTrieResult result = (codePointsMatched == 0) ? bt.first(transform(c)) : bt.next(transform(c)); - int32_t lengthMatched = utext_getNativeIndex(text) - startingTextIndex; + int32_t lengthMatched = (int32_t)utext_getNativeIndex(text) - startingTextIndex; codePointsMatched += 1; if (USTRINGTRIE_HAS_VALUE(result)) { if (wordCount < limit) {