X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/4388f060552cc537e71e957d32f35e9d75a61233..1a147d096ae81f4c8262f7bfc56bd19fc2dee932:/icuSources/test/cintltst/sprpdata.c?ds=sidebyside diff --git a/icuSources/test/cintltst/sprpdata.c b/icuSources/test/cintltst/sprpdata.c index 4865d67e..b3ac72d7 100644 --- a/icuSources/test/cintltst/sprpdata.c +++ b/icuSources/test/cintltst/sprpdata.c @@ -1,12 +1,14 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * - * Copyright (C) 2003-2011, International Business Machines + * Copyright (C) 2003-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: spreptst.c - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -150,7 +152,7 @@ compareMapping(UStringPrepProfile* data, uint32_t codepoint, uint32_t* mapping,i 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; @@ -169,18 +171,18 @@ compareMapping(UStringPrepProfile* data, uint32_t codepoint, uint32_t* mapping,i } 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; @@ -203,15 +205,15 @@ compareMapping(UStringPrepProfile* data, uint32_t codepoint, uint32_t* mapping,i 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]); } } }