/**
*******************************************************************************
- * Copyright (C) 2006-2015, International Business Machines Corporation
+ * Copyright (C) 2006-2016, International Business Machines Corporation
* and others. All Rights Reserved.
*******************************************************************************
*/
rangeStart = current;
if (!isDict) {
utext_next32(text);
- rangeStart = utext_getNativeIndex(text);
+ rangeStart = (int32_t)utext_getNativeIndex(text);
}
}
// rangeEnd = start + 1;
utext_setNativeIndex(text, start);
utext_next32(text);
- rangeEnd = utext_getNativeIndex(text);
+ rangeEnd = (int32_t)utext_getNativeIndex(text);
}
else {
while((current = (int32_t)utext_getNativeIndex(text)) < endPos && fSet.contains(c)) {
UChar32 pc;
int32_t chars = 0;
for (;;) {
- int32_t pcIndex = utext_getNativeIndex(text);
+ int32_t pcIndex = (int32_t)utext_getNativeIndex(text);
pc = utext_next32(text);
- int32_t pcSize = utext_getNativeIndex(text) - pcIndex;
+ int32_t pcSize = (int32_t)utext_getNativeIndex(text) - pcIndex;
chars += pcSize;
remaining -= pcSize;
if (remaining <= 0) {
if (!fSuffixSet.contains(utext_previous32(text))) {
// Skip over previous end and PAIYANNOI
utext_next32(text);
- int32_t paiyannoiIndex = utext_getNativeIndex(text);
+ int32_t paiyannoiIndex = (int32_t)utext_getNativeIndex(text);
utext_next32(text);
- cuWordLength += utext_getNativeIndex(text) - paiyannoiIndex; // Add PAIYANNOI to word
+ cuWordLength += (int32_t)utext_getNativeIndex(text) - paiyannoiIndex; // Add PAIYANNOI to word
uc = utext_current32(text); // Fetch next character
}
else {
if (utext_previous32(text) != THAI_MAIYAMOK) {
// Skip over previous end and MAIYAMOK
utext_next32(text);
- int32_t maiyamokIndex = utext_getNativeIndex(text);
+ int32_t maiyamokIndex = (int32_t)utext_getNativeIndex(text);
utext_next32(text);
- cuWordLength += utext_getNativeIndex(text) - maiyamokIndex; // Add MAIYAMOK to word
+ cuWordLength += (int32_t)utext_getNativeIndex(text) - maiyamokIndex; // Add MAIYAMOK to word
}
else {
// Restore prior position
UChar32 uc;
int32_t chars = 0;
for (;;) {
- int32_t pcIndex = utext_getNativeIndex(text);
+ int32_t pcIndex = (int32_t)utext_getNativeIndex(text);
pc = utext_next32(text);
- int32_t pcSize = utext_getNativeIndex(text) - pcIndex;
+ int32_t pcSize = (int32_t)utext_getNativeIndex(text) - pcIndex;
chars += pcSize;
remaining -= pcSize;
if (remaining <= 0) {
UChar32 uc;
int32_t chars = 0;
for (;;) {
- int32_t pcIndex = utext_getNativeIndex(text);
+ int32_t pcIndex = (int32_t)utext_getNativeIndex(text);
pc = utext_next32(text);
- int32_t pcSize = utext_getNativeIndex(text) - pcIndex;
+ int32_t pcSize = (int32_t)utext_getNativeIndex(text) - pcIndex;
chars += pcSize;
remaining -= pcSize;
if (remaining <= 0) {
UChar32 uc;
int32_t chars = 0;
for (;;) {
- int32_t pcIndex = utext_getNativeIndex(text);
+ int32_t pcIndex = (int32_t)utext_getNativeIndex(text);
pc = utext_next32(text);
- int32_t pcSize = utext_getNativeIndex(text) - pcIndex;
+ int32_t pcSize = (int32_t)utext_getNativeIndex(text) - pcIndex;
chars += pcSize;
remaining -= pcSize;
if (remaining <= 0) {
int32_t limit = rangeEnd;
U_ASSERT(limit <= utext_nativeLength(inText));
if (limit > utext_nativeLength(inText)) {
- limit = utext_nativeLength(inText);
+ limit = (int32_t)utext_nativeLength(inText);
}
inputMap.adoptInsteadAndCheckErrorCode(new UVector32(status), status);
if (U_FAILURE(status)) {
return 0;
}
while (utext_getNativeIndex(inText) < limit) {
- int32_t nativePosition = utext_getNativeIndex(inText);
+ int32_t nativePosition = (int32_t)utext_getNativeIndex(inText);
UChar32 c = utext_next32(inText);
U_ASSERT(c != U_SENTINEL);
inString.append(c);
/*
*******************************************************************************
-* Copyright (C) 2014, International Business Machines
+* Copyright (C) 2014-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* dictionarydata.h
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) {
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) {
/*
***************************************************************************
-* Copyright (C) 1999-2014 International Business Machines Corporation
+* Copyright (C) 1999-2016 International Business Machines Corporation
* and others. All rights reserved.
***************************************************************************
*/
// Move requested offset to a code point start. It might be on a trail surrogate,
// or on a trail byte if the input is UTF-8.
utext_setNativeIndex(fText, offset);
- offset = utext_getNativeIndex(fText);
+ offset = (int32_t)utext_getNativeIndex(fText);
// if we have cached break positions and offset is in the range
// covered by them, use them
// Move requested offset to a code point start. It might be on a trail surrogate,
// or on a trail byte if the input is UTF-8.
utext_setNativeIndex(fText, offset);
- offset = utext_getNativeIndex(fText);
+ offset = (int32_t)utext_getNativeIndex(fText);
// if we have cached break positions and offset is in the range
// covered by them, use them