icu4c/source/tools/gencfu/Release
icu4c/source/tools/gencfu/debug
icu4c/source/tools/gencfu/gencfu
+icu4c/source/tools/gencfu/gencfu.1
icu4c/source/tools/gencfu/gencfu.exe
icu4c/source/tools/gencfu/gencfu.vcproj.*.*.user
icu4c/source/tools/gencfu/release
}
MessagePattern::MessagePattern(const MessagePattern &other)
- : aposMode(other.aposMode), msg(other.msg),
+ : UObject(other), aposMode(other.aposMode), msg(other.msg),
partsList(NULL), parts(NULL), partsLength(0),
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
hasArgNames(other.hasArgNames), hasArgNumbers(other.hasArgNumbers),
/*
********************************************************************
* COPYRIGHT:
- * Copyright (c) 1996-2011, International Business Machines Corporation and
+ * Copyright (c) 1996-2012, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************
*
#endif
}
+#if U_CHARSET_IS_UTF8
+U_CAPI void U_EXPORT2 ucnv_setDefaultName(const char *) {}
+#else
/*
This function is not thread safe, and it can't be thread safe.
See internalSetName or the API reference for details.
*/
U_CAPI void U_EXPORT2
ucnv_setDefaultName(const char *converterName) {
-#if !U_CHARSET_IS_UTF8
if(converterName==NULL) {
/* reset to the default codepage */
gDefaultConverterName=NULL;
/* reset the converter cache */
u_flushDefaultConverter();
}
-#endif
}
+#endif
/* data swapping ------------------------------------------------------------ */
const UnicodeString& input,
int32_t pos,
UBool lenient) {
- UErrorCode status = U_ZERO_ERROR;
int32_t start = pos;
UChar32 affixChar = affix.char32At(0);
int32_t affixLength = affix.length();
return new DummyFormat();
}
-UnicodeString& MessageFormat::DummyFormat::format(const Formattable& obj,
+UnicodeString& MessageFormat::DummyFormat::format(const Formattable&,
UnicodeString& appendTo,
UErrorCode& status) const {
if (U_SUCCESS(status)) {
UnicodeString& MessageFormat::DummyFormat::format(const Formattable&,
UnicodeString& appendTo,
- FieldPositionIterator* posIter,
+ FieldPositionIterator*,
UErrorCode& status) const {
if (U_SUCCESS(status)) {
status = U_UNSUPPORTED_ERROR;
/*
******************************************************************************
*
-* Copyright (C) 1998-2011, International Business Machines
+* Copyright (C) 1998-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
* @draft ICU 49
*/
U_DRAFT UFILE * U_EXPORT2
-u_get_stdout();
+u_get_stdout(void);
/**
* Write formatted data to a UFILE.
/*
**********************************************************************
-* Copyright (C) 1998-2011, International Business Machines
+* Copyright (C) 1998-2012, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
if( format != NULL ) {
if(!strcmp(format,FORMAT_MILLIS)) {
- printf("%.0lf\n", when);
+ printf("%.0f\n", when);
return;
} else if(!strcmp(format, FORMAT_SECONDS)) {
- printf("%.3lf\n", when/1000.0);
+ printf("%.3f\n", when/1000.0);
return;
}
}
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2010, International Business Machines Corporation and
+ * Copyright (c) 1997-2012, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/*******************************************************************************
backAndForth(UCollationElements *iter)
{
/* Run through the iterator forwards and stick it into an array */
- int32_t index, o;
+ int32_t idx, o;
UErrorCode status = U_ZERO_ERROR;
int32_t orderLength = 0;
OrderAndOffset *orders = getOrders(iter, &orderLength);
/* Now go through it backwards and make sure we get the same values */
- index = orderLength;
+ idx = orderLength;
ucol_reset(iter);
/* synwee : changed */
#endif
ucol_getOffset(iter);
- index -= 1;
- if (o != orders[index].order) {
+ idx -= 1;
+ if (o != orders[idx].order) {
if (o == 0)
- index ++;
+ idx ++;
else {
- while (index > 0 && orders[-- index].order == 0) {
+ while (idx > 0 && orders[-- idx].order == 0) {
/* nothing... */
}
- if (o != orders[index].order) {
- log_err("Mismatched order at index %d: 0x%8.8X vs. 0x%8.8X\n", index,
- orders[index].order, o);
+ if (o != orders[idx].order) {
+ log_err("Mismatched order at index %d: 0x%8.8X vs. 0x%8.8X\n", idx,
+ orders[idx].order, o);
goto bail;
}
}
}
#if TEST_OFFSETS
- if (offset != orders[index].offset) {
- log_err("Mismatched offset at index %d: %d vs. %d\n", index,
- orders[index].offset, offset);
+ if (offset != orders[idx].offset) {
+ log_err("Mismatched offset at index %d: %d vs. %d\n", idx,
+ orders[idx].offset, offset);
goto bail;
}
#endif
}
- while (index != 0 && orders[index - 1].order == 0) {
- index -= 1;
+ while (idx != 0 && orders[idx - 1].order == 0) {
+ idx -= 1;
}
- if (index != 0) {
- log_err("Didn't get back to beginning - index is %d\n", index);
+ if (idx != 0) {
+ log_err("Didn't get back to beginning - index is %d\n", idx);
ucol_reset(iter);
log_err("\nnext: ");
UCollator * someClonedCollators [CLONETEST_COLLATOR_COUNT];
UCollator * col;
UErrorCode err = U_ZERO_ERROR;
- int8_t index = 6; /* Leave this here to test buffer alingment in memory*/
+ int8_t idx = 6; /* Leave this here to test buffer alingment in memory*/
uint8_t buffer [CLONETEST_COLLATOR_COUNT] [U_COL_SAFECLONE_BUFFERSIZE];
int32_t bufferSize = U_COL_SAFECLONE_BUFFERSIZE;
const char sampleRuleChars[] = "&Z < CH";
someCollators[2] = ucol_open("ja_JP", &err);
someCollators[3] = ucol_openRules(sampleRule, -1, UCOL_ON, UCOL_TERTIARY, NULL, &err);
if(U_FAILURE(err)) {
- for (index = 0; index < CLONETEST_COLLATOR_COUNT; index++) {
- ucol_close(someCollators[index]);
+ for (idx = 0; idx < CLONETEST_COLLATOR_COUNT; idx++) {
+ ucol_close(someCollators[idx]);
}
log_data_err("Couldn't open one or more collators\n");
return;
/* change orig & clone & make sure they are independent */
- for (index = 0; index < CLONETEST_COLLATOR_COUNT; index++)
+ for (idx = 0; idx < CLONETEST_COLLATOR_COUNT; idx++)
{
- ucol_setStrength(someCollators[index], UCOL_IDENTICAL);
+ ucol_setStrength(someCollators[idx], UCOL_IDENTICAL);
bufferSize = 1;
err = U_ZERO_ERROR;
- ucol_close(ucol_safeClone(someCollators[index], buffer[index], &bufferSize, &err));
+ ucol_close(ucol_safeClone(someCollators[idx], buffer[idx], &bufferSize, &err));
if (err != U_SAFECLONE_ALLOCATED_WARNING) {
- log_err("FAIL: collator number %d was not allocated.\n", index);
- log_err("FAIL: status of Collator[%d] is %d (hex: %x).\n", index, err, err);
+ log_err("FAIL: collator number %d was not allocated.\n", idx);
+ log_err("FAIL: status of Collator[%d] is %d (hex: %x).\n", idx, err, err);
}
bufferSize = U_COL_SAFECLONE_BUFFERSIZE;
err = U_ZERO_ERROR;
- someClonedCollators[index] = ucol_safeClone(someCollators[index], buffer[index], &bufferSize, &err);
- if (someClonedCollators[index] == NULL
- || someClonedCollators[index] < (UCollator *)buffer[index]
- || someClonedCollators[index] > (UCollator *)(buffer[index]+(U_COL_SAFECLONE_BUFFERSIZE-1)))
+ someClonedCollators[idx] = ucol_safeClone(someCollators[idx], buffer[idx], &bufferSize, &err);
+ if (someClonedCollators[idx] == NULL
+ || someClonedCollators[idx] < (UCollator *)buffer[idx]
+ || someClonedCollators[idx] > (UCollator *)(buffer[idx]+(U_COL_SAFECLONE_BUFFERSIZE-1)))
{
log_err("FAIL: Cloned collator didn't use provided buffer.\n");
return;
}
- if (!ucol_equals(someClonedCollators[index], someCollators[index])) {
- log_err("FAIL: Cloned collator is not equal to original at index = %d.\n", index);
+ if (!ucol_equals(someClonedCollators[idx], someCollators[idx])) {
+ log_err("FAIL: Cloned collator is not equal to original at index = %d.\n", idx);
}
/* Check the usability */
- ucol_setStrength(someCollators[index], UCOL_PRIMARY);
- ucol_setAttribute(someCollators[index], UCOL_CASE_LEVEL, UCOL_OFF, &err);
+ ucol_setStrength(someCollators[idx], UCOL_PRIMARY);
+ ucol_setAttribute(someCollators[idx], UCOL_CASE_LEVEL, UCOL_OFF, &err);
- doAssert( (ucol_equal(someCollators[index], test1, u_strlen(test1), test2, u_strlen(test2))), "Result should be \"abcda\" == \"abCda\"");
+ doAssert( (ucol_equal(someCollators[idx], test1, u_strlen(test1), test2, u_strlen(test2))), "Result should be \"abcda\" == \"abCda\"");
/* Close the original to make sure that the clone is usable. */
- ucol_close(someCollators[index]);
+ ucol_close(someCollators[idx]);
- ucol_setStrength(someClonedCollators[index], UCOL_TERTIARY);
- ucol_setAttribute(someClonedCollators[index], UCOL_CASE_LEVEL, UCOL_OFF, &err);
- doAssert( (ucol_greater(someClonedCollators[index], test1, u_strlen(test1), test2, u_strlen(test2))), "Result should be \"abCda\" >>> \"abcda\" ");
+ ucol_setStrength(someClonedCollators[idx], UCOL_TERTIARY);
+ ucol_setAttribute(someClonedCollators[idx], UCOL_CASE_LEVEL, UCOL_OFF, &err);
+ doAssert( (ucol_greater(someClonedCollators[idx], test1, u_strlen(test1), test2, u_strlen(test2))), "Result should be \"abCda\" >>> \"abcda\" ");
- ucol_close(someClonedCollators[index]);
+ ucol_close(someClonedCollators[idx]);
}
}
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2011, International Business Machines Corporation and
+ * Copyright (c) 1997-2012, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/* file name: cbiditst.cpp
int tc, mode, option, level;
uint32_t optionValue, optionBack;
UBiDiReorderingMode modeValue, modeBack;
- int32_t srcLen, destLen, index;
+ int32_t srcLen, destLen, idx;
const char *expectedChars;
UBool testOK = TRUE;
}
if (modes[mode].value == UBIDI_REORDER_INVERSE_NUMBERS_AS_L) {
- index = -1;
+ idx = -1;
expectedChars = inverseBasic(pBiDi2, srcChars, srcLen,
options[option].value, paraLevels[level], destChars);
}
else {
- index = outIndices[tc][mode][option][level];
- expectedChars = textOut[index];
+ idx = outIndices[tc][mode][option][level];
+ expectedChars = textOut[idx];
}
if (!assertStringsEqual(expectedChars, destChars, srcChars,
modes[mode].description,
testOK = FALSE;
}
if (options[option].value == UBIDI_OPTION_INSERT_MARKS &&
- !assertRoundTrip(pBiDi3, tc, index, srcChars,
+ !assertRoundTrip(pBiDi3, tc, idx, srcChars,
destChars, dest, destLen,
mode, option, paraLevels[level])) {
testOK = FALSE;
paraLevels[level])) {
testOK = FALSE;
}
- else if (index > -1 && !checkMaps(pBiDi, index, srcChars,
+ else if (idx > -1 && !checkMaps(pBiDi, idx, srcChars,
destChars, modes[mode].description,
options[option].description, paraLevels[level],
TRUE)) {
int32_t actualLogicalMap[MAX_MAP_LENGTH];
int32_t actualVisualMap[MAX_MAP_LENGTH];
int32_t getIndexMap[MAX_MAP_LENGTH];
- int32_t i, srcLen, resLen, index;
+ int32_t i, srcLen, resLen, idx;
const int32_t *expectedLogicalMap, *expectedVisualMap;
UErrorCode rc = U_ZERO_ERROR;
UBool testOK = TRUE;
testOK = FALSE;
}
for (i = 0; i < srcLen; i++) {
- index = ubidi_getVisualIndex(pBiDi, i, &rc);
+ idx = ubidi_getVisualIndex(pBiDi, i, &rc);
assertSuccessful("ubidi_getVisualIndex", &rc);
- getIndexMap[i] = index;
+ getIndexMap[i] = idx;
}
if (memcmp(actualLogicalMap, getIndexMap, srcLen * sizeof(int32_t))) {
char actChars[MAX_MAP_LENGTH];
testOK = FALSE;
}
for (i = 0; i < resLen; i++) {
- index = ubidi_getLogicalIndex(pBiDi, i, &rc);
+ idx = ubidi_getLogicalIndex(pBiDi, i, &rc);
assertSuccessful("ubidi_getLogicalIndex", &rc);
- getIndexMap[i] = index;
+ getIndexMap[i] = idx;
}
if (memcmp(actualVisualMap, getIndexMap, resLen * sizeof(int32_t))) {
char actChars[MAX_MAP_LENGTH];
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2011, International Business Machines Corporation and
+ * Copyright (c) 1997-2012, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/*****************************************************************************
UChar *pUCharTargetLimit = uniCharBuffer + sizeof(uniCharBuffer)/sizeof(*uniCharBuffer);
const UChar * pUniBuffer;
const UChar *uniBufferLimit = uniBuffer + sizeof(uniBuffer)/sizeof(*uniBuffer);
- int32_t index, j;
+ int32_t idx, j;
err = U_ZERO_ERROR;
cnv = ucnv_open(names[0], &err);
/* Do these cloned converters work at all - shuffle UChars to chars & back again..*/
for(j = 0; j < LENGTHOF(bufferSizes); ++j) {
- for (index = 0; index < LENGTHOF(names); index++)
+ for (idx = 0; idx < LENGTHOF(names); idx++)
{
err = U_ZERO_ERROR;
- cnv = ucnv_open(names[index], &err);
+ cnv = ucnv_open(names[idx], &err);
if(U_FAILURE(err)) {
- log_data_err("ucnv_open(\"%s\") failed - %s\n", names[index], u_errorName(err));
+ log_data_err("ucnv_open(\"%s\") failed - %s\n", names[idx], u_errorName(err));
continue;
}
if(j == 0) {
/* preflight to get maxBufferSize */
- actualSizes[index] = 0;
- ucnv_safeClone(cnv, NULL, &actualSizes[index], &err);
- if(actualSizes[index] > maxBufferSize) {
- maxBufferSize = actualSizes[index];
- maxName = names[index];
+ actualSizes[idx] = 0;
+ ucnv_safeClone(cnv, NULL, &actualSizes[idx], &err);
+ if(actualSizes[idx] > maxBufferSize) {
+ maxBufferSize = actualSizes[idx];
+ maxName = names[idx];
}
}
/* close the original immediately to make sure that the clone works by itself */
ucnv_close(cnv);
- if( actualSizes[index] <= (bufferSizes[j] - (int32_t)sizeof(UAlignedMemory)) &&
+ if( actualSizes[idx] <= (bufferSizes[j] - (int32_t)sizeof(UAlignedMemory)) &&
err == U_SAFECLONE_ALLOCATED_WARNING
) {
- log_err("ucnv_safeClone(%s) did a heap clone although the buffer was large enough\n", names[index]);
+ log_err("ucnv_safeClone(%s) did a heap clone although the buffer was large enough\n", names[idx]);
}
/* check if the clone function overwrote any bytes that it is not supposed to touch */
containsAnyOtherByte(buffer[1]+bufferSize, (int32_t)(sizeof(buffer)-(sizeof(buffer[0])+bufferSize)), 0xaa)
) {
log_err("cloning %s in a stack buffer overwrote bytes outside the bufferSize %d (requested %d)\n",
- names[index], bufferSize, bufferSizes[j]);
+ names[idx], bufferSize, bufferSizes[j]);
}
} else {
/* heap-allocated the clone */
if(containsAnyOtherByte(buffer[0], (int32_t)sizeof(buffer), 0xaa)) {
log_err("cloning %s used the heap (bufferSize %d, requested %d) but overwrote stack buffer bytes\n",
- names[index], bufferSize, bufferSizes[j]);
+ names[idx], bufferSize, bufferSizes[j]);
}
}
const char* strRules[] = {
"[reorder Hani] &b<a"
};
- const int32_t apiRules[] = {
+ /*const int32_t apiRules[] = {
USCRIPT_HAN
- };
+ };*/
const static OneTestCase privateUseCharacterStrings[] = {
{ {0x4e00}, {0x0041}, UCOL_LESS },
int32_t fortyThreeP_sortKey_reorder_Length;
UCollationResult collResult;
UCollationResult collResultReorder;
- int i;
log_verbose("Testing reordering with and without numeric collation\n");
int32_t count = 0;
int32_t row_count=0;
int32_t column_count=0;
- int32_t index = 0;
+ int32_t idx = 0;
int32_t tag_count= 0;
const char* testdatapath;
char verboseOutput[256];
for (j=0; j<10; ++j){
- index = count ? (randi(count * 3) - count) : (randi(200) - 100);
+ idx = count ? (randi(count * 3) - count) : (randi(200) - 100);
status = U_ZERO_ERROR;
string=kERROR;
array=ures_getByKey(theBundle, tag, array, &status);
if(!U_FAILURE(status)){
UChar *t=NULL;
- t=(UChar*)ures_getStringByIndex(array, index, &len, &status);
+ t=(UChar*)ures_getStringByIndex(array, idx, &len, &status);
if(!U_FAILURE(status)){
UChar element[3];
string=t;
u_strcpy(expected_string, base);
- u_uastrcpy(element, itoa1(index,buf));
+ u_uastrcpy(element, itoa1(idx,buf));
u_strcat(expected_string, element);
} else {
u_strcpy(expected_string, kERROR);
}
}
- expected_status = (index >= 0 && index < count) ? expected_resource_status : U_MISSING_RESOURCE_ERROR;
+ expected_status = (idx >= 0 && idx < count) ? expected_resource_status : U_MISSING_RESOURCE_ERROR;
CONFIRM_ErrorCode(status,expected_status);
CONFIRM_EQ(string,expected_string);
tag_count=ures_getSize(tags);
CONFIRM_INT_GE((int32_t)tag_count, (int32_t)0);
- for(index=0; index <tag_count; index++){
+ for(idx=0; idx <tag_count; idx++){
UResourceBundle *tagelement=NULL;
const char *key=NULL;
UChar* value=NULL;
- tagelement=ures_getByIndex(tags, index, tagelement, &status);
+ tagelement=ures_getByIndex(tags, idx, tagelement, &status);
key=ures_getKey(tagelement);
value=(UChar*)ures_getNextString(tagelement, &len, &key, &status);
log_verbose("tag = %s, value = %s\n", key, u_austrcpy(verboseOutput, value));
/*---------taggedArrayItem----------------------------------------------*/
count = 0;
- for (index=-20; index<20; ++index)
+ for (idx=-20; idx<20; ++idx)
{
status = U_ZERO_ERROR;
string = kERROR;
strcpy(item_tag, "tag");
- strcat(item_tag, itoa1(index,buf));
+ strcat(item_tag, itoa1(idx,buf));
tags=ures_getByKey(theBundle, tag, tags, &status);
if(U_SUCCESS(status)){
UResourceBundle *tagelement=NULL;
string=t;
}
}
- if (index < 0) {
+ if (idx < 0) {
CONFIRM_ErrorCode(status,U_MISSING_RESOURCE_ERROR);
}
else{
if (status != U_MISSING_RESOURCE_ERROR) {
UChar element[3];
u_strcpy(expected_string, base);
- u_uastrcpy(element, itoa1(index,buf));
+ u_uastrcpy(element, itoa1(idx,buf));
u_strcat(expected_string, element);
CONFIRM_EQ(string,expected_string);
count++;
*/
extern const UChar *
tres_getString(const UResourceBundle *resB,
- int32_t index, const char *key,
+ int32_t idx, const char *key,
int32_t *length,
UErrorCode *status) {
char buffer8[16];
if(length == NULL) {
length = &length16;
}
- if(index >= 0) {
- s16 = ures_getStringByIndex(resB, index, length, status);
+ if(idx >= 0) {
+ s16 = ures_getStringByIndex(resB, idx, length, status);
} else if(key != NULL) {
s16 = ures_getStringByKey(resB, key, length, status);
} else {
for(forceCopy = FALSE; forceCopy <= TRUE; ++forceCopy) {
p8 = buffer8;
length8 = (int32_t)sizeof(buffer8);
- if(index >= 0) {
- s8 = ures_getUTF8StringByIndex(resB, index, p8, &length8, forceCopy, status);
+ if(idx >= 0) {
+ s8 = ures_getUTF8StringByIndex(resB, idx, p8, &length8, forceCopy, status);
} else if(key != NULL) {
s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status);
} else {
if(p8 == NULL) {
return s16;
}
- if(index >= 0) {
- s8 = ures_getUTF8StringByIndex(resB, index, p8, &length8, forceCopy, status);
+ if(idx >= 0) {
+ s8 = ures_getUTF8StringByIndex(resB, idx, p8, &length8, forceCopy, status);
} else if(key != NULL) {
s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status);
} else {
if(forceCopy && s8 != p8) {
log_err("ures_getUTF8String(%p, %ld, '%s') did not write the string to dest\n",
- resB, (long)index, key);
+ resB, (long)idx, key);
}
/* verify NUL-termination */
if((p8 != buffer8 || length8 < sizeof(buffer8)) && s8[length8] != 0) {
log_err("ures_getUTF8String(%p, %ld, '%s') did not NUL-terminate\n",
- resB, (long)index, key);
+ resB, (long)idx, key);
}
/* verify correct string */
i16 = i8 = 0;
U8_NEXT(s8, i8, length8, c8);
if(c16 != c8) {
log_err("ures_getUTF8String(%p, %ld, '%s') got a bad string, c16=U+%04lx!=U+%04lx=c8 before i16=%ld\n",
- resB, (long)index, key, (long)c16, (long)c8, (long)i16);
+ resB, (long)idx, key, (long)c16, (long)c8, (long)i16);
}
}
/* verify correct length */
if(i16 < length16) {
log_err("ures_getUTF8String(%p, %ld, '%s') UTF-8 string too short, length8=%ld, length16=%ld\n",
- resB, (long)index, key, (long)length8, (long)length16);
+ resB, (long)idx, key, (long)length8, (long)length16);
}
if(i8 < length8) {
log_err("ures_getUTF8String(%p, %ld, '%s') UTF-8 string too long, length8=%ld, length16=%ld\n",
- resB, (long)index, key, (long)length8, (long)length16);
+ resB, (long)idx, key, (long)length8, (long)length16);
}
/* clean up */
/*
*******************************************************************************
*
- * Copyright (C) 2003-2011, International Business Machines
+ * Copyright (C) 2003-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
int32_t length=0;
UBool isIndex = FALSE;
UStringPrepType retType;
- int32_t value=0, index=0, delta=0;
+ int32_t value=0, idx=0, delta=0;
int32_t* indexes = data->indexes;
UTrie trie = data->sprepTrie;
const uint16_t* mappingData = data->mappingData;
}
if(isIndex){
- index = value;
- if(index >= indexes[_SPREP_ONE_UCHAR_MAPPING_INDEX_START] &&
- index < indexes[_SPREP_TWO_UCHARS_MAPPING_INDEX_START]){
+ idx = value;
+ if(idx >= indexes[_SPREP_ONE_UCHAR_MAPPING_INDEX_START] &&
+ idx < indexes[_SPREP_TWO_UCHARS_MAPPING_INDEX_START]){
length = 1;
- }else if(index >= indexes[_SPREP_TWO_UCHARS_MAPPING_INDEX_START] &&
- index < indexes[_SPREP_THREE_UCHARS_MAPPING_INDEX_START]){
+ }else if(idx >= indexes[_SPREP_TWO_UCHARS_MAPPING_INDEX_START] &&
+ idx < indexes[_SPREP_THREE_UCHARS_MAPPING_INDEX_START]){
length = 2;
- }else if(index >= indexes[_SPREP_THREE_UCHARS_MAPPING_INDEX_START] &&
- index < indexes[_SPREP_FOUR_UCHARS_MAPPING_INDEX_START]){
+ }else if(idx >= indexes[_SPREP_THREE_UCHARS_MAPPING_INDEX_START] &&
+ idx < indexes[_SPREP_FOUR_UCHARS_MAPPING_INDEX_START]){
length = 3;
}else{
- length = mappingData[index++];
+ length = mappingData[idx++];
}
}else{
delta = value;
if(isIndex){
for(i =0; i< mapLength; i++){
if(mapping[i] <= 0xFFFF){
- if(mappingData[index+i] != (uint16_t)mapping[i]){
- log_err("Did not get the expected result. Expected: 0x%04X Got: 0x%04X \n", mapping[i], mappingData[index+i]);
+ if(mappingData[idx+i] != (uint16_t)mapping[i]){
+ log_err("Did not get the expected result. Expected: 0x%04X Got: 0x%04X \n", mapping[i], mappingData[idx+i]);
}
}else{
UChar lead = U16_LEAD(mapping[i]);
UChar trail = U16_TRAIL(mapping[i]);
- if(mappingData[index+i] != lead ||
- mappingData[index+i+1] != trail){
- log_err( "Did not get the expected result. Expected: 0x%04X 0x%04X Got: 0x%04X 0x%04X\n", lead, trail, mappingData[index+i], mappingData[index+i+1]);
+ if(mappingData[idx+i] != lead ||
+ mappingData[idx+i+1] != trail){
+ log_err( "Did not get the expected result. Expected: 0x%04X 0x%04X Got: 0x%04X 0x%04X\n", lead, trail, mappingData[idx+i], mappingData[idx+i+1]);
}
}
}
*/
void TimeZoneTest::TestShortZoneIDs()
{
- UErrorCode status = U_ZERO_ERROR;
-
int32_t i;
// Create a small struct to hold the array
struct
#include "uparse.h"
#include "sprpimpl.h"
+#include "unicode/uclean.h"
#include "unicode/udata.h"
#include "unicode/utypes.h"
#include "unicode/putil.h"
void cmd_cleanup()
{
u_cleanup();
- fprintf(stderr,"ICU u_cleanup() called.\n");
+ fprintf(stdout, "ICU u_cleanup() called.\n");
}
/******************************************************************************
- * Copyright (C) 2009-2011, International Business Machines
+ * Copyright (C) 2009-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
char* buffer = uprv_malloc(sizeof(char) * currentBufferSize);
char* tmpFlagBuffer = uprv_malloc(sizeof(char) * flagBufferSize);
UBool allocateMoreSpace = FALSE;
- int32_t index, i;
+ int32_t idx, i;
int32_t result = 0;
FileStream *f = T_FileStream_open(fileName, "r");
T_FileStream_rewind(f);
break;
} else {
- index = extractFlag(buffer, currentBufferSize, tmpFlagBuffer, flagBufferSize, flagNames, numOfFlags, status);
+ idx = extractFlag(buffer, currentBufferSize, tmpFlagBuffer, flagBufferSize, flagNames, numOfFlags, status);
if (U_FAILURE(*status)) {
if (*status == U_BUFFER_OVERFLOW_ERROR) {
result = currentBufferSize;
break;
} else {
if (flagNames != NULL) {
- if (index >= 0) {
- uprv_strcpy(flagBuffer[index], tmpFlagBuffer);
+ if (idx >= 0) {
+ uprv_strcpy(flagBuffer[idx], tmpFlagBuffer);
} else {
/* No match found. Skip it. */
continue;
* Extract the setting after the '=' and store it in flag excluding the newline character.
*/
static int32_t extractFlag(char* buffer, int32_t bufferSize, char* flag, int32_t flagSize, const char **flagNames, int32_t numOfFlags, UErrorCode *status) {
- int32_t i, index = -1;
+ int32_t i, idx = -1;
char *pBuffer;
int32_t offset=0;
UBool bufferWritten = FALSE;
offset--; /* Move offset back 1 because of '='*/
for (i = 0; i < numOfFlags; i++) {
if (uprv_strncmp(buffer, flagNames[i], offset) == 0) {
- index = i;
+ idx = i;
break;
}
}
}
- return index;
+ return idx;
}
/*