ICU-353 basic warnings cleanup (not touching object's memory layout). A

basic build now compiles w/o a single warning on Linux. One with --enable-strict
is a different matter...

X-SVN-Rev: 1124
This commit is contained in:
Yves Arrouye 2000-04-13 23:00:43 +00:00
parent c6794e2bba
commit c69c164be8
35 changed files with 161 additions and 196 deletions

View File

@ -61,10 +61,10 @@ UnicodeConverterCPP& UnicodeConverterCPP::operator=(const UnicodeConverterCPP&
*Increments the assigner converter's ref count *Increments the assigner converter's ref count
*/ */
Mutex updateReferenceCounters; Mutex updateReferenceCounters;
if (myUnicodeConverter->sharedData->referenceCounter != 0 && myUnicodeConverter->sharedData->referenceCounter != ~0) { if (myUnicodeConverter->sharedData->referenceCounter != 0 && myUnicodeConverter->sharedData->referenceCounter != (uint32_t) ~0) {
myUnicodeConverter->sharedData->referenceCounter--; myUnicodeConverter->sharedData->referenceCounter--;
} }
if (that.myUnicodeConverter->sharedData->referenceCounter != ~0) { if (that.myUnicodeConverter->sharedData->referenceCounter != (uint32_t) ~0) {
that.myUnicodeConverter->sharedData->referenceCounter++; that.myUnicodeConverter->sharedData->referenceCounter++;
} }
} }
@ -102,7 +102,7 @@ UnicodeConverterCPP::UnicodeConverterCPP(const UnicodeConverterCPP& that)
myUnicodeConverter = new UConverter; myUnicodeConverter = new UConverter;
{ {
Mutex updateReferenceCounter; Mutex updateReferenceCounter;
if (that.myUnicodeConverter->sharedData->referenceCounter != ~0) { if (that.myUnicodeConverter->sharedData->referenceCounter != (uint32_t) ~0) {
that.myUnicodeConverter->sharedData->referenceCounter++; that.myUnicodeConverter->sharedData->referenceCounter++;
} }
} }

View File

@ -413,7 +413,6 @@ DigitList::round(int32_t maximumDigits)
* incremented * incremented
*/ */
bool_t DigitList::shouldRoundUp(int32_t maximumDigits) { bool_t DigitList::shouldRoundUp(int32_t maximumDigits) {
bool_t increment = FALSE;
// Implement IEEE half-even rounding // Implement IEEE half-even rounding
if (fDigits[maximumDigits] > '5') { if (fDigits[maximumDigits] > '5') {
return TRUE; return TRUE;

View File

@ -167,7 +167,7 @@ Normalizer::normalize(const UnicodeString& source,
void void
Normalizer::compose(const UnicodeString& source, Normalizer::compose(const UnicodeString& source,
bool_t compat, bool_t compat,
int32_t options, int32_t,
UnicodeString& result, UnicodeString& result,
UErrorCode &status) UErrorCode &status)
{ {
@ -1162,7 +1162,7 @@ void Normalizer::jamoToHangul(UnicodeString& buffer, UTextOffset start) {
UTextOffset limit = buffer.length() - 1; UTextOffset limit = buffer.length() - 1;
UTextOffset in; UTextOffset in;
int16_t l, v, t; int16_t l, v = 0, t;
for (in = start; in < limit; in++) { for (in = start; in < limit; in++) {
UChar ch = buffer[in]; UChar ch = buffer[in];

View File

@ -90,8 +90,6 @@
#define SIGN 0x80000000L #define SIGN 0x80000000L
static char tempString[10] = "";
/* statics */ /* statics */
static bool_t fgNaNInitialized = FALSE; static bool_t fgNaNInitialized = FALSE;
static double fgNan; static double fgNan;
@ -572,18 +570,18 @@ uprv_log10(double d)
/* log and dividing by log10 yields a result which may be off*/ /* log and dividing by log10 yields a result which may be off*/
/* by 1 due to rounding errors. For example, the naive log10*/ /* by 1 due to rounding errors. For example, the naive log10*/
/* of 1.0e300 taken this way is 299, rather than 300.*/ /* of 1.0e300 taken this way is 299, rather than 300.*/
double log10 = log(d) / log(10.0); double alog10 = log(d) / log(10.0);
int16_t ilog10 = (int16_t)floor(log10); int16_t ailog10 = (int16_t) floor(alog10);
/* Positive logs could be too small, e.g. 0.99 instead of 1.0*/ /* Positive logs could be too small, e.g. 0.99 instead of 1.0*/
if (log10 > 0 && d >= pow(10.0, ilog10 + 1)) if (alog10 > 0 && d >= pow(10.0, ailog10 + 1))
++ilog10; ++ailog10;
/* Negative logs could be too big, e.g. -0.99 instead of -1.0*/ /* Negative logs could be too big, e.g. -0.99 instead of -1.0*/
else if (log10 < 0 && d < pow(10.0, ilog10)) else if (alog10 < 0 && d < pow(10.0, ailog10))
--ilog10; --ailog10;
return ilog10; return ailog10;
} }
int32_t int32_t
@ -689,10 +687,10 @@ uprv_timezone()
} }
char* char*
uprv_tzname(int index) uprv_tzname(int idx)
{ {
#ifdef POSIX #ifdef POSIX
return tzname[index]; return tzname[idx];
#endif #endif
#if defined(OS400) || defined(XP_MAC) #if defined(OS400) || defined(XP_MAC)
@ -744,6 +742,8 @@ u_setDataDirectory(const char *directory) {
} }
} }
#ifndef ICU_DATA_DIR
/* /*
* get the system drive or volume path * get the system drive or volume path
* (Windows: e.g. "C:" or "D:") * (Windows: e.g. "C:" or "D:")
@ -788,6 +788,8 @@ getSystemPath(char *path, int size) {
return 0; return 0;
} }
#endif
/* /*
* get the path to the ICU dynamic library * get the path to the ICU dynamic library
* do not terminate with a U_FILE_SEP_CHAR separator * do not terminate with a U_FILE_SEP_CHAR separator
@ -1032,7 +1034,7 @@ u_getDataDirectory(void) {
if(!gHaveDataDirectory) { if(!gHaveDataDirectory) {
/* we need to look for it */ /* we need to look for it */
char pathBuffer[1024]; char pathBuffer[1024];
char *path; const char *path;
int length; int length;
# if !defined(XP_MAC) # if !defined(XP_MAC)
@ -1226,7 +1228,7 @@ const char*
uprv_getDefaultLocaleID() uprv_getDefaultLocaleID()
{ {
#ifdef POSIX #ifdef POSIX
char* posixID = getenv("LC_ALL"); const char* posixID = getenv("LC_ALL");
if (posixID == 0) posixID = getenv("LANG"); if (posixID == 0) posixID = getenv("LANG");
if (posixID == 0) posixID = setlocale(LC_ALL, NULL); if (posixID == 0) posixID = setlocale(LC_ALL, NULL);
if (uprv_strcmp("C", posixID) == 0) posixID = "en_US"; if (uprv_strcmp("C", posixID) == 0) posixID = "en_US";
@ -1315,11 +1317,11 @@ uprv_nextDouble(double d, bool_t next)
/* zero's are also a special case */ /* zero's are also a special case */
if (d == 0.0) { if (d == 0.0) {
double smallestPositiveDouble = 0.0; double smallestPositiveDouble = 0.0;
uint32_t *lowBits = uint32_t *plowBits =
(uint32_t *)u_bottomNBytesOfDouble(&smallestPositiveDouble, (uint32_t *)u_bottomNBytesOfDouble(&smallestPositiveDouble,
sizeof(uint32_t)); sizeof(uint32_t));
*lowBits = 1; *plowBits = 1;
if (next) { if (next) {
return smallestPositiveDouble; return smallestPositiveDouble;
@ -1410,6 +1412,7 @@ const char* uprv_getDefaultCodepage()
#elif defined(XP_MAC) #elif defined(XP_MAC)
/* TBD */ /* TBD */
#elif defined(WIN32) #elif defined(WIN32)
static char tempString[10] = "";
static char codepage[12]={ "cp" }; static char codepage[12]={ "cp" };
uprv_strcpy(codepage+2, _itoa(GetACP(), tempString, 10)); uprv_strcpy(codepage+2, _itoa(GetACP(), tempString, 10));
return codepage; return codepage;

View File

@ -285,12 +285,12 @@ ResourceBundle::ResourceBundle( const UnicodeString& path,
ResourceBundle::ResourceBundle( const UnicodeString& path, ResourceBundle::ResourceBundle( const UnicodeString& path,
const UnicodeString& localeName, const UnicodeString& localeName,
UErrorCode& status) UErrorCode& status)
: fPath(path, UnicodeString(kDefaultSuffix,"")), : fgCache(fgUserCache),
fRealLocale(localeName), fgVisitedFiles(fgUserVisitedFiles),
fPath(path, UnicodeString(kDefaultSuffix,"")),
fIsDataOwned(TRUE), fIsDataOwned(TRUE),
fVersionID(0), fRealLocale(localeName),
fgCache(fgUserCache), fVersionID(0)
fgVisitedFiles(fgUserVisitedFiles)
{ {
status = U_ZERO_ERROR; status = U_ZERO_ERROR;
@ -318,10 +318,10 @@ ResourceBundle::ResourceBundle( const UnicodeString& path,
} }
void void
ResourceBundle::saveCollationHashtable(const UnicodeString& localeName, ResourceBundle::saveCollationHashtable(const UnicodeString&,
UHashtable* hashtable, UHashtable* hashtable,
void* context, void* context,
ResourceBundleCache* fgCache) ResourceBundleCache*)
{ {
ResourceBundle* bundle = (ResourceBundle*)context; ResourceBundle* bundle = (ResourceBundle*)context;
for(int32_t i = 0; i < kDataCount; ++i) { for(int32_t i = 0; i < kDataCount; ++i) {
@ -1114,7 +1114,6 @@ ResourceBundle::addToCache(const UnicodeString& localeName,
{ {
PathInfo *c = (PathInfo*)context; PathInfo *c = (PathInfo*)context;
UnicodeString keyName(c->makeHashkey(localeName)); UnicodeString keyName(c->makeHashkey(localeName));
UErrorCode err = U_ZERO_ERROR;
Mutex lock; Mutex lock;
if (fgCache->get(keyName) == 0) { if (fgCache->get(keyName) == 0) {
fgCache->put(keyName, hashtable); fgCache->put(keyName, hashtable);

View File

@ -800,7 +800,7 @@ resolveImplicitLevels(UBiDi *pBiDi,
UBiDiLevel *levels=pBiDi->levels; UBiDiLevel *levels=pBiDi->levels;
UTextOffset i, next, neutralStart=-1; UTextOffset i, next, neutralStart=-1;
DirProp prevDirProp, dirProp, nextDirProp, lastStrong, beforeNeutral; DirProp prevDirProp, dirProp, nextDirProp, lastStrong, beforeNeutral = L;
uint8_t historyOfEN; uint8_t historyOfEN;
/* initialize: current at sor, next at start (it is start<limit) */ /* initialize: current at sor, next at start (it is start<limit) */

View File

@ -147,7 +147,6 @@ ubidi_setLine(const UBiDi *pParaBiDi,
const UBiDiLevel *levels=pLineBiDi->levels; const UBiDiLevel *levels=pLineBiDi->levels;
UTextOffset i, trailingWSStart; UTextOffset i, trailingWSStart;
UBiDiLevel level; UBiDiLevel level;
Flags flags=0;
setTrailingWSStart(pLineBiDi); setTrailingWSStart(pLineBiDi);
trailingWSStart=pLineBiDi->trailingWSStart; trailingWSStart=pLineBiDi->trailingWSStart;
@ -566,7 +565,7 @@ reorderLine(UBiDi *pBiDi, UBiDiLevel minLevel, UBiDiLevel maxLevel) {
Run *runs; Run *runs;
UBiDiLevel *levels; UBiDiLevel *levels;
UTextOffset firstRun, endRun, limitRun, runCount, UTextOffset firstRun, endRun, limitRun, runCount,
temp, trailingWSStart=pBiDi->trailingWSStart; temp;
/* nothing to do? */ /* nothing to do? */
if(maxLevel<=(minLevel|1)) { if(maxLevel<=(minLevel|1)) {
@ -894,13 +893,13 @@ ubidi_getLogicalIndex(UBiDi *pBiDi, UTextOffset visualIndex, UErrorCode *pErrorC
for(i=0; visualIndex>=runs[i].visualLimit; ++i) {} for(i=0; visualIndex>=runs[i].visualLimit; ++i) {}
} else { } else {
/* binary search for the run */ /* binary search for the run */
UTextOffset start=0, limit=runCount; UTextOffset begin=0, limit=runCount;
/* the middle if() will guaranteed find the run, we don't need a loop limit */ /* the middle if() will guaranteed find the run, we don't need a loop limit */
for(;;) { for(;;) {
i=(start+limit)/2; i=(begin+limit)/2;
if(visualIndex>=runs[i].visualLimit) { if(visualIndex>=runs[i].visualLimit) {
start=i+1; begin=i+1;
} else if(i==0 || visualIndex>=runs[i-1].visualLimit) { } else if(i==0 || visualIndex>=runs[i-1].visualLimit) {
break; break;
} else { } else {

View File

@ -4922,7 +4922,7 @@ u_charDirection(UChar32 ch )
UCharScript UCharScript
u_charScript(UChar32 ch) u_charScript(UChar32 ch)
{ {
int32_t index, j; int32_t idx, j;
UCharScript returnValue = U_NO_SCRIPT; UCharScript returnValue = U_NO_SCRIPT;
/* surrogate support is still incomplete */ /* surrogate support is still incomplete */
@ -4930,18 +4930,18 @@ u_charScript(UChar32 ch)
return U_NO_SCRIPT; return U_NO_SCRIPT;
} }
index = -1; idx = -1;
for( j = 0; index == -1 && fScriptIndex[j].fFirstCode != 0xFFFF; ++j ) for( j = 0; idx == -1 && fScriptIndex[j].fFirstCode != 0xFFFF; ++j )
if( fScriptIndex[j].fFirstCode <= ch && ch <= fScriptIndex[j].fLastCode ) { if( fScriptIndex[j].fFirstCode <= ch && ch <= fScriptIndex[j].fLastCode ) {
index = j; idx = j;
if(j == U_CHAR_SCRIPT_COUNT) /* "U_SPECIALS 2" */ if(j == U_CHAR_SCRIPT_COUNT) /* "U_SPECIALS 2" */
index = U_SPECIALS; idx = U_SPECIALS;
} }
if(index >= U_CHAR_SCRIPT_COUNT) { if(idx >= U_CHAR_SCRIPT_COUNT) {
returnValue = U_NO_SCRIPT; returnValue = U_NO_SCRIPT;
} }
else if( index != -1 ) { else if( idx != -1 ) {
returnValue = (UCharScript)index; returnValue = (UCharScript)idx;
} }
return returnValue; return returnValue;

View File

@ -66,7 +66,7 @@
* @see CompactIntArray * @see CompactIntArray
* @see CompactCharArray * @see CompactCharArray
* @see CompactStringArray * @see CompactStringArray
* @version $Revision: 1.6 $ 8/25/98 * @version $Revision: 1.7 $ 8/25/98
* @author Helena Shih * @author Helena Shih
*/ */
@ -150,7 +150,7 @@ U_CAPI bool_t U_EXPORT2 ucmp16_isBogus(const CompactShortArray* array);
* @param value the new mapped value * @param value the new mapped value
*/ */
U_CAPI void U_EXPORT2 ucmp16_set(CompactShortArray *array, U_CAPI void U_EXPORT2 ucmp16_set(CompactShortArray *array,
UChar index, UChar idx,
int16_t value); int16_t value);

View File

@ -27,9 +27,9 @@
/* INTERNAL CONSTANTS */ /* INTERNAL CONSTANTS */
#define UCMP32_kBlockShift 7 #define UCMP32_kBlockShift 7
#define UCMP32_kBlockCount (1<<UCMP32_kBlockShift) #define UCMP32_kBlockCount (1<<UCMP32_kBlockShift)
#define UCMP32_kIndexShift 16-UCMP32_kBlockShift #define UCMP32_kIndexShift (16-UCMP32_kBlockShift)
#define UCMP32_kIndexCount (1<<UCMP32_kIndexShift) #define UCMP32_kIndexCount (1<<UCMP32_kIndexShift)
#define UCMP32_kBlockMask UCMP32_kBlockCount-1 #define UCMP32_kBlockMask (UCMP32_kBlockCount-1)
#define UCMP32_kUnicodeCount 65536 #define UCMP32_kUnicodeCount 65536
/** /**
@ -75,7 +75,7 @@
* @see CompactIntArray * @see CompactIntArray
* @see CompactCharArray * @see CompactCharArray
* @see CompactStringArray * @see CompactStringArray
* @version $Revision: 1.6 $ 8/25/98 * @version $Revision: 1.7 $ 8/25/98
* @author Helena Shih * @author Helena Shih
*/ */
/*====================================*/ /*====================================*/
@ -145,7 +145,7 @@ U_CAPI bool_t U_EXPORT2 ucmp32_isBogus(const CompactIntArray* array);
* @param value the new mapped value * @param value the new mapped value
*/ */
U_CAPI void U_EXPORT2 ucmp32_set(CompactIntArray *array, U_CAPI void U_EXPORT2 ucmp32_set(CompactIntArray *array,
UChar index, UChar idx,
int32_t value); int32_t value);
/** /**

View File

@ -59,7 +59,7 @@ U_CAPI bool_t U_EXPORT2 isBogus(const CompactByteArray* array);
U_CAPI void U_EXPORT2 ucmp8_set(CompactByteArray* array, U_CAPI void U_EXPORT2 ucmp8_set(CompactByteArray* array,
UChar index, UChar idx,
int8_t value); int8_t value);
U_CAPI void U_EXPORT2 ucmp8_setRange(CompactByteArray* array, U_CAPI void U_EXPORT2 ucmp8_setRange(CompactByteArray* array,

View File

@ -155,7 +155,6 @@ int32_t ucnv_flushCache ()
/*deletes only if reference counter == 0 */ /*deletes only if reference counter == 0 */
if (mySharedData->referenceCounter == 0) if (mySharedData->referenceCounter == 0)
{ {
UErrorCode err = U_ZERO_ERROR;
tableDeletedNum++; tableDeletedNum++;
uhash_removeElement(SHARED_DATA_HASHTABLE, e); uhash_removeElement(SHARED_DATA_HASHTABLE, e);
@ -169,11 +168,11 @@ int32_t ucnv_flushCache ()
/*returns a single Name from the list, will return NULL if out of bounds /*returns a single Name from the list, will return NULL if out of bounds
*/ */
const char* ucnv_getAvailableName (int32_t index) const char* ucnv_getAvailableName (int32_t idx)
{ {
if (0 <= index && index <= 0xffff) { if (0 <= idx && idx <= 0xffff) {
UErrorCode err = U_ZERO_ERROR; UErrorCode err = U_ZERO_ERROR;
const char *name = ucnv_io_getAvailableConverter((uint16_t)index, &err); const char *name = ucnv_io_getAvailableConverter((uint16_t)idx, &err);
if (U_SUCCESS(err)) { if (U_SUCCESS(err)) {
return name; return name;
} }
@ -195,8 +194,8 @@ ucnv_countAliases(const char *alias, UErrorCode *pErrorCode) {
U_CAPI const char * U_CAPI const char *
ucnv_getAlias(const char *alias, uint16_t index, UErrorCode *pErrorCode) { ucnv_getAlias(const char *alias, uint16_t idx, UErrorCode *pErrorCode) {
return ucnv_io_getAlias(alias, index, pErrorCode); return ucnv_io_getAlias(alias, idx, pErrorCode);
} }
U_CAPI void U_CAPI void
@ -236,8 +235,6 @@ void ucnv_setSubstChars (UConverter * converter,
int8_t len, int8_t len,
UErrorCode * err) UErrorCode * err)
{ {
uint8_t x = 0;
if (U_FAILURE (*err)) if (U_FAILURE (*err))
return; return;
@ -949,7 +946,6 @@ int32_t ucnv_convert(const char *toConverterName,
{ {
const char *mySource = source; const char *mySource = source;
const char *mySource_limit = source + sourceSize; const char *mySource_limit = source + sourceSize;
int32_t mySourceLength = 0;
UConverter *inConverter; UConverter *inConverter;
UConverter *outConverter; UConverter *outConverter;
char *myTarget = target; char *myTarget = target;
@ -1096,18 +1092,18 @@ void ucnv_fixFileSeparator(const UConverter *cnv,
int32_t sourceLength) int32_t sourceLength)
{ {
int32_t i = 0; int32_t i = 0;
int32_t index = 0; int32_t idx = 0;
if ((source == NULL) || (cnv == NULL)) if ((source == NULL) || (cnv == NULL))
{ {
return; return;
} }
if ((index = ucnv_getAmbiguousCCSID(cnv)) != -1) if ((idx = ucnv_getAmbiguousCCSID(cnv)) != -1)
{ {
for (i = 0; i < sourceLength; i++) for (i = 0; i < sourceLength; i++)
{ {
if (source[i] == UCNV_AMBIGUOUSCONVERTERS[index].mismapped) if (source[i] == UCNV_AMBIGUOUSCONVERTERS[idx].mismapped)
{ {
source[i] = UCNV_AMBIGUOUSCONVERTERS[index].replacement; source[i] = UCNV_AMBIGUOUSCONVERTERS[idx].replacement;
} }
} }
} }

View File

@ -159,7 +159,7 @@ _ISO2022Reset(UConverter *converter) {
} }
} }
void T_UConverter_fromUnicode_ISO_2022(UConverter* _this, static void T_UConverter_fromUnicode_ISO_2022(UConverter* _this,
char** target, char** target,
const char* targetLimit, const char* targetLimit,
const UChar** source, const UChar** source,
@ -180,7 +180,7 @@ void T_UConverter_fromUnicode_ISO_2022(UConverter* _this,
} }
void T_UConverter_fromUnicode_ISO_2022_OFFSETS_LOGIC(UConverter* _this, static void T_UConverter_fromUnicode_ISO_2022_OFFSETS_LOGIC(UConverter* _this,
char** target, char** target,
const char* targetLimit, const char* targetLimit,
const UChar** source, const UChar** source,
@ -471,7 +471,7 @@ const char* getEndOfBuffer_2022(const char* source,
void T_UConverter_toUnicode_ISO_2022(UConverter* _this, static void T_UConverter_toUnicode_ISO_2022(UConverter* _this,
UChar** target, UChar** target,
const UChar* targetLimit, const UChar* targetLimit,
const char** source, const char** source,
@ -544,7 +544,7 @@ void T_UConverter_toUnicode_ISO_2022(UConverter* _this,
return; return;
} }
void T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverter* _this, static void T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverter* _this,
UChar** target, UChar** target,
const UChar* targetLimit, const UChar* targetLimit,
const char** source, const char** source,
@ -625,7 +625,7 @@ void T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverter* _this,
return; return;
} }
UChar32 T_UConverter_getNextUChar_ISO_2022(UConverter* converter, static UChar32 T_UConverter_getNextUChar_ISO_2022(UConverter* converter,
const char** source, const char** source,
const char* sourceLimit, const char* sourceLimit,
UErrorCode* err) UErrorCode* err)
@ -687,11 +687,11 @@ static const UConverterImpl _ISO2022Impl={
NULL NULL
}; };
extern const UConverterSharedData _ISO2022Data={ const UConverterSharedData _ISO2022Data={
sizeof(UConverterSharedData), ~((uint32_t) 0), sizeof(UConverterSharedData), ~((uint32_t) 0),
NULL, NULL, &_ISO2022Impl, "ISO_2022", NULL, NULL, &_ISO2022Impl, "ISO_2022",
2022, UCNV_IBM, UCNV_ISO_2022, 1, 4, 2022, UCNV_IBM, UCNV_ISO_2022, 1, 4,
{ 0, 1, 0x1a, 0, 0, 0 } { 0, 1, { 0x1a, 0, 0, 0 } }
}; };
/* EBCDICStateful ----------------------------------------------------------- */ /* EBCDICStateful ----------------------------------------------------------- */
@ -1293,7 +1293,7 @@ static const UConverterImpl _EBCDICStatefulImpl={
NULL NULL
}; };
extern const UConverterSharedData _EBCDICStatefulData={ const UConverterSharedData _EBCDICStatefulData={
sizeof(UConverterSharedData), 1, sizeof(UConverterSharedData), 1,
NULL, NULL, &_EBCDICStatefulImpl, "EBCDICStateful", NULL, NULL, &_EBCDICStatefulImpl, "EBCDICStateful",
0, UCNV_IBM, UCNV_EBCDIC_STATEFUL, 1, 1, 0, UCNV_IBM, UCNV_EBCDIC_STATEFUL, 1, 1,

View File

@ -206,7 +206,6 @@ void UCNV_FROM_U_CALLBACK_ESCAPE (UConverter * _this,
UChar valueString[VALUE_STRING_LENGTH]; UChar valueString[VALUE_STRING_LENGTH];
int32_t valueStringLength = 0; int32_t valueStringLength = 0;
const UChar *mySource = *source;
UChar codepoint[CODEPOINT_STRING_LENGTH]; UChar codepoint[CODEPOINT_STRING_LENGTH];
int32_t i = 0; int32_t i = 0;
/*Makes a bitwise copy of the converter passwd in */ /*Makes a bitwise copy of the converter passwd in */
@ -282,8 +281,8 @@ void UCNV_FROM_U_CALLBACK_ESCAPE (UConverter * _this,
if (offsets) if (offsets)
{ {
int i=0; int j=0;
for (i=0;i<valueStringLength;i++) offsets[i]=0; for (j=0;j<valueStringLength;j++) offsets[j]=0;
offsets += valueStringLength; offsets += valueStringLength;
} }
} }
@ -297,8 +296,8 @@ void UCNV_FROM_U_CALLBACK_ESCAPE (UConverter * _this,
if (offsets) if (offsets)
{ {
int i=0; int j=0;
for (i=0;i<(targetLimit - *target);i++) offsets[i]=0; for (j=0;j<(targetLimit - *target);j++) offsets[j]=0;
offsets += (targetLimit - *target); offsets += (targetLimit - *target);
} }
uprv_memcpy (*target, myTarget, (targetLimit - *target)); uprv_memcpy (*target, myTarget, (targetLimit - *target));
@ -372,10 +371,8 @@ void UCNV_TO_U_CALLBACK_ESCAPE (UConverter * _this,
{ {
UChar uniValueString[VALUE_STRING_LENGTH]; UChar uniValueString[VALUE_STRING_LENGTH];
int32_t valueStringLength = 0; int32_t valueStringLength = 0;
const unsigned char *mySource = (const unsigned char *) *source;
UChar codepoint[CODEPOINT_STRING_LENGTH]; UChar codepoint[CODEPOINT_STRING_LENGTH];
int32_t j = 0, i = 0; int32_t i = 0;
const int32_t* offsets_end = offsets +( targetLimit - *target);
if (CONVERSION_U_SUCCESS (*err)) return; if (CONVERSION_U_SUCCESS (*err)) return;

View File

@ -237,17 +237,17 @@ ucnv_io_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCo
} }
U_CFUNC const char * U_CFUNC const char *
ucnv_io_getAlias(const char *alias, uint16_t index, UErrorCode *pErrorCode) { ucnv_io_getAlias(const char *alias, uint16_t idx, UErrorCode *pErrorCode) {
if(haveAliasData(pErrorCode) && isAlias(alias, pErrorCode)) { if(haveAliasData(pErrorCode) && isAlias(alias, pErrorCode)) {
const uint16_t *p=findAlias(alias); const uint16_t *p=findAlias(alias);
if(p!=NULL) { if(p!=NULL) {
uint16_t count=*(p+1); uint16_t count=*(p+1);
if(index<count) { if(idx<count) {
const char *aliases=(const char *)aliasTable+*p; const char *aliases=(const char *)aliasTable+*p;
while(index>0) { while(idx>0) {
/* skip a name, first the canonical converter name */ /* skip a name, first the canonical converter name */
aliases+=uprv_strlen(aliases)+1; aliases+=uprv_strlen(aliases)+1;
--index; --idx;
} }
return aliases; return aliases;
} }
@ -265,11 +265,11 @@ ucnv_io_countAvailableConverters(UErrorCode *pErrorCode) {
} }
U_CFUNC const char * U_CFUNC const char *
ucnv_io_getAvailableConverter(uint16_t index, UErrorCode *pErrorCode) { ucnv_io_getAvailableConverter(uint16_t idx, UErrorCode *pErrorCode) {
if(haveAliasData(pErrorCode)) { if(haveAliasData(pErrorCode)) {
const uint16_t *p=aliasTable+1+2*(*aliasTable); const uint16_t *p=aliasTable+1+2*(*aliasTable);
if(index<*p) { if(idx<*p) {
return (const char *)aliasTable+p[1+2*index]; return (const char *)aliasTable+p[1+2*idx];
} }
} }
return NULL; return NULL;
@ -297,9 +297,9 @@ ucnv_io_countAvailableAliases(UErrorCode *pErrorCode) {
} }
U_CFUNC const char * U_CFUNC const char *
ucnv_io_getAvailableAlias(uint16_t index, UErrorCode *pErrorCode) { ucnv_io_getAvailableAlias(uint16_t idx, UErrorCode *pErrorCode) {
if(haveAliasData(pErrorCode) && index<*aliasTable) { if(haveAliasData(pErrorCode) && idx<*aliasTable) {
return (const char *)aliasTable+*(aliasTable+1+index); return (const char *)aliasTable+*(aliasTable+1+idx);
} }
return NULL; return NULL;
} }

View File

@ -42,7 +42,7 @@ ucnv_io_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCo
* Returns NULL if the alias is not found. * Returns NULL if the alias is not found.
*/ */
U_CFUNC const char * U_CFUNC const char *
ucnv_io_getAlias(const char *alias, uint16_t index, UErrorCode *pErrorCode); ucnv_io_getAlias(const char *alias, uint16_t idx, UErrorCode *pErrorCode);
/** /**
* Return the number of all converter names. * Return the number of all converter names.
@ -56,7 +56,7 @@ ucnv_io_countAvailableConverters(UErrorCode *pErrorCode);
* 0<=index<ucnv_io_countAvailableConverters(). * 0<=index<ucnv_io_countAvailableConverters().
*/ */
U_CFUNC const char * U_CFUNC const char *
ucnv_io_getAvailableConverter(uint16_t index, UErrorCode *pErrorCode); ucnv_io_getAvailableConverter(uint16_t idx, UErrorCode *pErrorCode);
/** /**
* Fill an array const char *aliases[ucnv_io_countAvailableConverters()] * Fill an array const char *aliases[ucnv_io_countAvailableConverters()]
@ -77,7 +77,7 @@ ucnv_io_countAvailableAliases(UErrorCode *pErrorCode);
* 0<=index<ucnv_io_countAvailableAliases(). * 0<=index<ucnv_io_countAvailableAliases().
*/ */
U_CFUNC const char * U_CFUNC const char *
ucnv_io_getAvailableAlias(uint16_t index, UErrorCode *pErrorCode); ucnv_io_getAvailableAlias(uint16_t idx, UErrorCode *pErrorCode);
/** /**
* Fill an array const char *aliases[ucnv_io_countAvailableAliases()] * Fill an array const char *aliases[ucnv_io_countAvailableAliases()]

View File

@ -139,16 +139,16 @@ struct _UniLMBCSGrpMap
} UniLMBCSGrpMap[] } UniLMBCSGrpMap[]
= =
{ {
0x0001, 0x001F, ULMBCS_GRP_CTRL, { 0x0001, 0x001F, ULMBCS_GRP_CTRL },
0x0080, 0x009F, ULMBCS_GRP_CTRL, { 0x0080, 0x009F, ULMBCS_GRP_CTRL },
0x00A0, 0x0113, ULMBCS_AMBIGUOUS_SBCS, { 0x00A0, 0x0113, ULMBCS_AMBIGUOUS_SBCS },
0x0115, 0x0120, ULMBCS_AMBIGUOUS_SBCS, { 0x0115, 0x0120, ULMBCS_AMBIGUOUS_SBCS },
0x0120, 0x012B, ULMBCS_GRP_EXCEPT, { 0x0120, 0x012B, ULMBCS_GRP_EXCEPT },
0x012C, 0x01CD, ULMBCS_AMBIGUOUS_SBCS, { 0x012C, 0x01CD, ULMBCS_AMBIGUOUS_SBCS },
0x01CE, 0x01CE, ULMBCS_AMBIGUOUS_MBCS, { 0x01CE, 0x01CE, ULMBCS_AMBIGUOUS_MBCS },
0x01CF, 0x1FFF, ULMBCS_AMBIGUOUS_SBCS, { 0x01CF, 0x1FFF, ULMBCS_AMBIGUOUS_SBCS },
0x2000, 0xFFFD, ULMBCS_AMBIGUOUS_MBCS, { 0x2000, 0xFFFD, ULMBCS_AMBIGUOUS_MBCS },
0xFFFF, 0xFFFF, { 0xFFFF, 0xFFFF }
}; };
ulmbcs_grp_t FindLMBCSUniRange(UChar uniChar, UErrorCode* err) ulmbcs_grp_t FindLMBCSUniRange(UChar uniChar, UErrorCode* err)
@ -224,7 +224,7 @@ int LMBCSConversionWorker (
MyAssert(xcnv); MyAssert(xcnv);
MyAssert(group<ULMBCS_GRP_UNICODE); MyAssert(group<ULMBCS_GRP_UNICODE);
ucnv_fromUnicode(xcnv, (char **)&pmbChar,(char *)mbChar+sizeof(mbChar),&pUniChar,pUniChar+1,NULL,TRUE,&localErr); ucnv_fromUnicode(xcnv, (char **)&pmbChar,(char *)mbChar+sizeof(mbChar),(const UChar **)&pUniChar,pUniChar+1,NULL,TRUE,&localErr);
bytesConverted = pmbChar - mbChar; bytesConverted = pmbChar - mbChar;
pmbChar = mbChar; pmbChar = mbChar;
@ -933,11 +933,11 @@ DEFINE_LMBCS_OPEN(19)
_LMBCSGetNextUChar,\ _LMBCSGetNextUChar,\
NULL\ NULL\
};\ };\
extern const UConverterSharedData _LMBCSData##n={\ const UConverterSharedData _LMBCSData##n={\
sizeof(UConverterSharedData), ~0,\ sizeof(UConverterSharedData), ~0,\
NULL, NULL, &_LMBCSImpl##n, "LMBCS_" ## #n,\ NULL, NULL, &_LMBCSImpl##n, "LMBCS_" ## #n,\
0, UCNV_IBM, UCNV_LMBCS_1, 1, 1,\ 0, UCNV_IBM, UCNV_LMBCS_1, 1, 1,\
{ 0, 1, 0x3f, 0, 0, 0 }\ { 0, 1, { 0x3f, 0, 0, 0 } }\
}; };
DECLARE_LMBCS_DATA(1) DECLARE_LMBCS_DATA(1)

View File

@ -216,10 +216,7 @@ void T_UConverter_toUnicode_UTF8_OFFSETS_LOGIC (UConverter * _this,
int32_t sourceLength = sourceLimit - (char *) mySource; int32_t sourceLength = sourceLimit - (char *) mySource;
uint32_t ch = 0, ch2 = 0, i = 0; uint32_t ch = 0, ch2 = 0, i = 0;
uint32_t inBytes = 0; uint32_t inBytes = 0;
int32_t* originalOffsets = offsets;
if (_this->toUnicodeStatus) if (_this->toUnicodeStatus)
{ {
i = _this->invalidCharLength; i = _this->invalidCharLength;
@ -357,8 +354,6 @@ void T_UConverter_fromUnicode_UTF8 (UConverter * _this,
int32_t myTargetIndex = 0; int32_t myTargetIndex = 0;
int32_t targetLength = targetLimit - (char *) myTarget; int32_t targetLength = targetLimit - (char *) myTarget;
int32_t sourceLength = sourceLimit - mySource; int32_t sourceLength = sourceLimit - mySource;
int8_t targetCharByteNum = 0;
UChar mySourceChar = 0x0000;
uint32_t ch; uint32_t ch;
int16_t i, bytesToWrite = 0; int16_t i, bytesToWrite = 0;
uint32_t ch2; uint32_t ch2;
@ -469,8 +464,6 @@ void T_UConverter_fromUnicode_UTF8_OFFSETS_LOGIC (UConverter * _this,
int32_t myTargetIndex = 0; int32_t myTargetIndex = 0;
int32_t targetLength = targetLimit - (char *) myTarget; int32_t targetLength = targetLimit - (char *) myTarget;
int32_t sourceLength = sourceLimit - mySource; int32_t sourceLength = sourceLimit - mySource;
int8_t targetCharByteNum = 0;
UChar mySourceChar = 0x0000;
uint32_t ch; uint32_t ch;
int16_t i, bytesToWrite = 0; int16_t i, bytesToWrite = 0;
uint32_t ch2; uint32_t ch2;
@ -697,11 +690,11 @@ static const UConverterImpl _UTF8Impl={
NULL NULL
}; };
extern const UConverterSharedData _UTF8Data={ const UConverterSharedData _UTF8Data={
sizeof(UConverterSharedData), ~((uint32_t) 0), sizeof(UConverterSharedData), ~((uint32_t) 0),
NULL, NULL, &_UTF8Impl, "UTF8", NULL, NULL, &_UTF8Impl, "UTF8",
1208, UCNV_IBM, UCNV_UTF8, 1, 4, 1208, UCNV_IBM, UCNV_UTF8, 1, 4,
{ 0, 3, 0xef, 0xbf, 0xbd, 0 } { 0, 3, { 0xef, 0xbf, 0xbd, 0 } }
}; };
/* UTF-16BE ----------------------------------------------------------------- */ /* UTF-16BE ----------------------------------------------------------------- */
@ -891,11 +884,11 @@ static const UConverterImpl _UTF16BEImpl={
NULL NULL
}; };
extern const UConverterSharedData _UTF16BEData={ const UConverterSharedData _UTF16BEData={
sizeof(UConverterSharedData), ~((uint32_t) 0), sizeof(UConverterSharedData), ~((uint32_t) 0),
NULL, NULL, &_UTF16BEImpl, "UTF16_BigEndian", NULL, NULL, &_UTF16BEImpl, "UTF16_BigEndian",
1200, UCNV_IBM, UCNV_UTF16_BigEndian, 2, 2, 1200, UCNV_IBM, UCNV_UTF16_BigEndian, 2, 2,
{ 0, 2, 0xff, 0xfd, 0, 0 } { 0, 2, { 0xff, 0xfd, 0, 0 } }
}; };
/* UTF-16LE ----------------------------------------------------------------- */ /* UTF-16LE ----------------------------------------------------------------- */
@ -915,8 +908,6 @@ void T_UConverter_toUnicode_UTF16_LE (UConverter * _this,
int32_t myTargetIndex = 0; int32_t myTargetIndex = 0;
int32_t targetLength = targetLimit - myTarget; int32_t targetLength = targetLimit - myTarget;
int32_t sourceLength = sourceLimit - (char *) mySource; int32_t sourceLength = sourceLimit - (char *) mySource;
CompactShortArray *myToUnicode = NULL;
UChar targetUniChar = 0x0000;
UChar mySourceChar = 0x0000; UChar mySourceChar = 0x0000;
while (mySourceIndex < sourceLength) while (mySourceIndex < sourceLength)
@ -1089,9 +1080,9 @@ static const UConverterImpl _UTF16LEImpl={
NULL NULL
}; };
extern const UConverterSharedData _UTF16LEData={ const UConverterSharedData _UTF16LEData={
sizeof(UConverterSharedData), ~((uint32_t) 0), sizeof(UConverterSharedData), ~((uint32_t) 0),
NULL, NULL, &_UTF16LEImpl, "UTF16_LittleEndian", NULL, NULL, &_UTF16LEImpl, "UTF16_LittleEndian",
1200, UCNV_IBM, UCNV_UTF16_LittleEndian, 2, 2, 1200, UCNV_IBM, UCNV_UTF16_LittleEndian, 2, 2,
{ 0, 2, 0xfd, 0xff, 0, 0 } { 0, 2, { 0xfd, 0xff, 0, 0 } }
}; };

View File

@ -21,7 +21,7 @@
/* ISO 8859-1 --------------------------------------------------------------- */ /* ISO 8859-1 --------------------------------------------------------------- */
void T_UConverter_toUnicode_LATIN_1 (UConverter * _this, static void T_UConverter_toUnicode_LATIN_1 (UConverter * _this,
UChar ** target, UChar ** target,
const UChar * targetLimit, const UChar * targetLimit,
const char **source, const char **source,
@ -59,7 +59,7 @@ void T_UConverter_toUnicode_LATIN_1 (UConverter * _this,
return; return;
} }
void T_UConverter_fromUnicode_LATIN_1 (UConverter * _this, static void T_UConverter_fromUnicode_LATIN_1 (UConverter * _this,
char **target, char **target,
const char *targetLimit, const char *targetLimit,
const UChar ** source, const UChar ** source,
@ -121,7 +121,7 @@ void T_UConverter_fromUnicode_LATIN_1 (UConverter * _this,
return; return;
} }
UChar32 T_UConverter_getNextUChar_LATIN_1(UConverter* converter, static UChar32 T_UConverter_getNextUChar_LATIN_1(UConverter* converter,
const char** source, const char** source,
const char* sourceLimit, const char* sourceLimit,
UErrorCode* err) UErrorCode* err)
@ -160,9 +160,9 @@ static const UConverterImpl _Latin1Impl={
NULL NULL
}; };
extern const UConverterSharedData _Latin1Data={ const UConverterSharedData _Latin1Data={
sizeof(UConverterSharedData), ~((uint32_t) 0), sizeof(UConverterSharedData), ~((uint32_t) 0),
NULL, NULL, &_Latin1Impl, "LATIN_1", NULL, NULL, &_Latin1Impl, "LATIN_1",
819, UCNV_IBM, UCNV_LATIN_1, 1, 1, 819, UCNV_IBM, UCNV_LATIN_1, 1, 1,
{ 0, 1, 0x1a, 0, 0, 0 } { 0, 1, { 0x1a, 0, 0, 0 } }
}; };

View File

@ -43,7 +43,7 @@ _MBCSUnload(UConverterSharedData *sharedData) {
uprv_free (sharedData->table); uprv_free (sharedData->table);
} }
void T_UConverter_toUnicode_MBCS (UConverter * _this, static void T_UConverter_toUnicode_MBCS (UConverter * _this,
UChar ** target, UChar ** target,
const UChar * targetLimit, const UChar * targetLimit,
const char **source, const char **source,
@ -163,7 +163,7 @@ void T_UConverter_toUnicode_MBCS (UConverter * _this,
return; return;
} }
void T_UConverter_toUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this, static void T_UConverter_toUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
UChar ** target, UChar ** target,
const UChar * targetLimit, const UChar * targetLimit,
const char **source, const char **source,
@ -181,11 +181,8 @@ void T_UConverter_toUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
CompactShortArray *myToUnicode = NULL; CompactShortArray *myToUnicode = NULL;
UChar targetUniChar = 0x0000; UChar targetUniChar = 0x0000;
UChar mySourceChar = 0x0000; UChar mySourceChar = 0x0000;
UChar oldMySourceChar; UChar oldMySourceChar = 0x0000;
bool_t *myStarters = NULL; bool_t *myStarters = NULL;
int32_t* originalOffsets = offsets;
myToUnicode = _this->sharedData->table->mbcs.toUnicode; myToUnicode = _this->sharedData->table->mbcs.toUnicode;
myStarters = _this->sharedData->table->mbcs.starters; myStarters = _this->sharedData->table->mbcs.starters;
@ -299,7 +296,7 @@ void T_UConverter_toUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
return; return;
} }
void T_UConverter_fromUnicode_MBCS (UConverter * _this, static void T_UConverter_fromUnicode_MBCS (UConverter * _this,
char **target, char **target,
const char *targetLimit, const char *targetLimit,
const UChar ** source, const UChar ** source,
@ -317,7 +314,6 @@ void T_UConverter_fromUnicode_MBCS (UConverter * _this,
int32_t sourceLength = sourceLimit - mySource; int32_t sourceLength = sourceLimit - mySource;
CompactShortArray *myFromUnicode = NULL; CompactShortArray *myFromUnicode = NULL;
UChar targetUniChar = 0x0000; UChar targetUniChar = 0x0000;
int8_t targetUniCharByteNum = 0;
UChar mySourceChar = 0x0000; UChar mySourceChar = 0x0000;
myFromUnicode = _this->sharedData->table->mbcs.fromUnicode; myFromUnicode = _this->sharedData->table->mbcs.fromUnicode;
@ -389,7 +385,7 @@ void T_UConverter_fromUnicode_MBCS (UConverter * _this,
return; return;
} }
void T_UConverter_fromUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this, static void T_UConverter_fromUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
char **target, char **target,
const char *targetLimit, const char *targetLimit,
const UChar ** source, const UChar ** source,
@ -407,14 +403,10 @@ void T_UConverter_fromUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
int32_t sourceLength = sourceLimit - mySource; int32_t sourceLength = sourceLimit - mySource;
CompactShortArray *myFromUnicode = NULL; CompactShortArray *myFromUnicode = NULL;
UChar targetUniChar = 0x0000; UChar targetUniChar = 0x0000;
int8_t targetUniCharByteNum = 0;
UChar mySourceChar = 0x0000; UChar mySourceChar = 0x0000;
int32_t* originalOffsets = offsets;
myFromUnicode = _this->sharedData->table->mbcs.fromUnicode; myFromUnicode = _this->sharedData->table->mbcs.fromUnicode;
/*writing the char to the output stream */ /*writing the char to the output stream */
while (mySourceIndex < sourceLength) while (mySourceIndex < sourceLength)
{ {
@ -451,7 +443,6 @@ void T_UConverter_fromUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
else else
{ {
int32_t currentOffset = mySourceIndex -1; int32_t currentOffset = mySourceIndex -1;
int32_t* offsetsAnchor = offsets;
*err = U_INVALID_CHAR_FOUND; *err = U_INVALID_CHAR_FOUND;
_this->invalidUCharBuffer[0] = (UChar) mySourceChar; _this->invalidUCharBuffer[0] = (UChar) mySourceChar;
@ -488,7 +479,7 @@ void T_UConverter_fromUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
return; return;
} }
UChar32 T_UConverter_getNextUChar_MBCS(UConverter* converter, static UChar32 T_UConverter_getNextUChar_MBCS(UConverter* converter,
const char** source, const char** source,
const char* sourceLimit, const char* sourceLimit,
UErrorCode* err) UErrorCode* err)
@ -556,7 +547,7 @@ UChar32 T_UConverter_getNextUChar_MBCS(UConverter* converter,
} }
} }
void static void
_MBCSGetStarters(const UConverter* converter, bool_t starters[256], UErrorCode *pErrorCode) { _MBCSGetStarters(const UConverter* converter, bool_t starters[256], UErrorCode *pErrorCode) {
/* fills in the starters boolean array */ /* fills in the starters boolean array */
uprv_memcpy(starters, converter->sharedData->table->mbcs.starters, 256*sizeof(bool_t)); uprv_memcpy(starters, converter->sharedData->table->mbcs.starters, 256*sizeof(bool_t));
@ -581,9 +572,9 @@ static const UConverterImpl _MBCSImpl={
_MBCSGetStarters _MBCSGetStarters
}; };
extern const UConverterSharedData _MBCSData={ const UConverterSharedData _MBCSData={
sizeof(UConverterSharedData), 1, sizeof(UConverterSharedData), 1,
NULL, NULL, &_MBCSImpl, "MBCS", NULL, NULL, &_MBCSImpl, "MBCS",
0, UCNV_IBM, UCNV_MBCS, 1, 1, 0, UCNV_IBM, UCNV_MBCS, 1, 1,
{ 0, 1, 0, 0, 0, 0 } { 0, 1, { 0, 0, 0, 0 } }
}; };

View File

@ -241,11 +241,11 @@ static const UConverterImpl _SBCSImpl={
NULL NULL
}; };
extern const UConverterSharedData _SBCSData={ const UConverterSharedData _SBCSData={
sizeof(UConverterSharedData), 1, sizeof(UConverterSharedData), 1,
NULL, NULL, &_SBCSImpl, "SBCS", NULL, NULL, &_SBCSImpl, "SBCS",
0, UCNV_IBM, UCNV_SBCS, 1, 1, 0, UCNV_IBM, UCNV_SBCS, 1, 1,
{ 0, 1, 0, 0, 0, 0 } { 0, 1, { 0, 0, 0, 0 } }
}; };
/* DBCS --------------------------------------------------------------------- */ /* DBCS --------------------------------------------------------------------- */
@ -527,9 +527,9 @@ static const UConverterImpl _DBCSImpl={
NULL NULL
}; };
extern const UConverterSharedData _DBCSData={ const UConverterSharedData _DBCSData={
sizeof(UConverterSharedData), 1, sizeof(UConverterSharedData), 1,
NULL, NULL, &_DBCSImpl, "DBCS", NULL, NULL, &_DBCSImpl, "DBCS",
0, UCNV_IBM, UCNV_DBCS, 2, 2, 0, UCNV_IBM, UCNV_DBCS, 2, 2,
{ 0, 1, 0, 0, 0, 0 } { 0, 1, { 0, 0, 0, 0 } }
}; };

View File

@ -82,11 +82,6 @@ udata_openChoice(const char *path, const char *type, const char *name,
*/ */
#define UDATA_INDIRECT #define UDATA_INDIRECT
static bool_t
isCommonDataAcceptable(void *context,
const char *type, const char *name,
UDataInfo *pInfo);
#if defined(WIN32) /* Win32 implementations --------------------------------- */ #if defined(WIN32) /* Win32 implementations --------------------------------- */
#include <windows.h> #include <windows.h>
@ -758,7 +753,7 @@ doOpenChoice(const char *path, const char *type, const char *name,
const char *entryName; const char *entryName;
bool_t isICUData, hasPath, hasBasename; bool_t isICUData, hasPath, hasBasename;
Library lib; Library lib = 0;
MappedData *p; MappedData *p;
UErrorCode errorCode=U_ZERO_ERROR; UErrorCode errorCode=U_ZERO_ERROR;

View File

@ -669,18 +669,18 @@ _uhash_find(const UHashtable *hash, const void* key,
int32_t hashcode) { int32_t hashcode) {
int32_t firstDeleted = -1; /* assume invalid index */ int32_t firstDeleted = -1; /* assume invalid index */
int32_t index, startIndex; int32_t idx, startIndex;
int32_t jump = 0; /* lazy evaluate */ int32_t jump = 0; /* lazy evaluate */
int32_t tableHash; int32_t tableHash;
hashcode &= 0x7FFFFFFF; /* must be positive */ hashcode &= 0x7FFFFFFF; /* must be positive */
startIndex = index = (hashcode ^ 0x4000000) % hash->length; startIndex = idx = (hashcode ^ 0x4000000) % hash->length;
do { do {
tableHash = hash->elements[index].hashcode; tableHash = hash->elements[idx].hashcode;
if (tableHash == hashcode) { /* quick check */ if (tableHash == hashcode) { /* quick check */
if ((*hash->keyComparator)(key, hash->elements[index].key)) { if ((*hash->keyComparator)(key, hash->elements[idx].key)) {
return &(hash->elements[index]); return &(hash->elements[idx]);
} }
} else if (!IS_EMPTY_OR_DELETED(tableHash)) { } else if (!IS_EMPTY_OR_DELETED(tableHash)) {
/* We have hit a slot which contains a key-value pair, /* We have hit a slot which contains a key-value pair,
@ -690,7 +690,7 @@ _uhash_find(const UHashtable *hash, const void* key,
} else if (tableHash == HASH_EMPTY) { /* empty, end o' the line */ } else if (tableHash == HASH_EMPTY) { /* empty, end o' the line */
break; break;
} else if (firstDeleted < 0) { /* remember first deleted */ } else if (firstDeleted < 0) { /* remember first deleted */
firstDeleted = index; firstDeleted = idx;
} }
if (jump == 0) { /* lazy compute jump */ if (jump == 0) { /* lazy compute jump */
/* The jump value must be relatively prime to the table /* The jump value must be relatively prime to the table
@ -699,11 +699,11 @@ _uhash_find(const UHashtable *hash, const void* key,
*/ */
jump = (hashcode % (hash->length - 1)) + 1; jump = (hashcode % (hash->length - 1)) + 1;
} }
index = (index + jump) % hash->length; idx = (idx + jump) % hash->length;
} while (index != startIndex); } while (idx != startIndex);
if (firstDeleted >= 0) { if (firstDeleted >= 0) {
index = firstDeleted; /* reset if had deleted slot */ idx = firstDeleted; /* reset if had deleted slot */
} else if (tableHash != HASH_EMPTY) { } else if (tableHash != HASH_EMPTY) {
/* We get to this point if the hashtable is full (no empty or /* We get to this point if the hashtable is full (no empty or
* deleted slots), and we've failed to find a match. THIS * deleted slots), and we've failed to find a match. THIS
@ -713,7 +713,7 @@ _uhash_find(const UHashtable *hash, const void* key,
assert(FALSE); assert(FALSE);
return NULL; /* Never happens if uhash_put() behaves */ return NULL; /* Never happens if uhash_put() behaves */
} }
return &(hash->elements[index]); return &(hash->elements[idx]);
} }
static void* static void*

View File

@ -187,7 +187,6 @@ int16_t _findIndex(const char* list, int32_t listLength, const char* key)
const char* anchor = list; const char* anchor = list;
const char* listEnd = anchor + listLength; const char* listEnd = anchor + listLength;
bool_t found = FALSE; bool_t found = FALSE;
int index = 0;
int tokenSize = uprv_strlen(list)+1; /*gets the size of the tokens*/ int tokenSize = uprv_strlen(list)+1; /*gets the size of the tokens*/
while (!found && list<listEnd) while (!found && list<listEnd)
@ -466,31 +465,31 @@ int32_t uloc_getName(const char* localeID,
const char* uloc_getISO3Language(const char* localeID) const char* uloc_getISO3Language(const char* localeID)
{ {
int16_t index; int16_t idx;
char lang[TEMPBUFSIZE]; char lang[TEMPBUFSIZE];
UErrorCode err = U_ZERO_ERROR; UErrorCode err = U_ZERO_ERROR;
if (localeID == NULL) localeID = uloc_getDefault(); if (localeID == NULL) localeID = uloc_getDefault();
uloc_getLanguage(localeID, lang, TEMPBUFSIZE, &err); uloc_getLanguage(localeID, lang, TEMPBUFSIZE, &err);
if (U_FAILURE(err)) return ""; if (U_FAILURE(err)) return "";
index = _findIndex(_languages, sizeof(_languages),lang); idx = _findIndex(_languages, sizeof(_languages),lang);
if (index < 0) return ""; if (idx < 0) return "";
return &(_languages3[index * 4]); return &(_languages3[idx * 4]);
} }
const char* uloc_getISO3Country(const char* localeID) const char* uloc_getISO3Country(const char* localeID)
{ {
int16_t index; int16_t idx;
char cntry[TEMPBUFSIZE]; char cntry[TEMPBUFSIZE];
UErrorCode err = U_ZERO_ERROR; UErrorCode err = U_ZERO_ERROR;
if (localeID == NULL) localeID = uloc_getDefault(); if (localeID == NULL) localeID = uloc_getDefault();
uloc_getCountry(localeID, cntry, TEMPBUFSIZE, &err); uloc_getCountry(localeID, cntry, TEMPBUFSIZE, &err);
if (U_FAILURE(err)) return ""; if (U_FAILURE(err)) return "";
index = _findIndex(_countries, sizeof(_countries), cntry); idx = _findIndex(_countries, sizeof(_countries), cntry);
if (index < 0) return ""; if (idx < 0) return "";
return &(_countries3[index * 4]); return &(_countries3[idx * 4]);
} }
uint32_t uloc_getLCID(const char* localeID) uint32_t uloc_getLCID(const char* localeID)
@ -525,7 +524,6 @@ int32_t uloc_getDisplayLanguage(const char* locale,
const UChar* result = NULL; const UChar* result = NULL;
int32_t i = 0; int32_t i = 0;
int langBufSize; int langBufSize;
bool_t doneDefaultLocale = FALSE;
char inLanguageBuffer[TEMPBUFSIZE]; char inLanguageBuffer[TEMPBUFSIZE];
char inLocaleBuffer[TEMPBUFSIZE]; char inLocaleBuffer[TEMPBUFSIZE];
UErrorCode err = U_ZERO_ERROR; UErrorCode err = U_ZERO_ERROR;
@ -585,7 +583,7 @@ int32_t uloc_getDisplayLanguage(const char* locale,
if (U_SUCCESS(err)) if (U_SUCCESS(err))
{ {
UErrorCode err = U_ZERO_ERROR; err = U_ZERO_ERROR;
temp = ures_getTaggedArrayItem(bundle, temp = ures_getTaggedArrayItem(bundle,
_kLanguages, _kLanguages,
inLanguageBuffer, inLanguageBuffer,
@ -651,7 +649,6 @@ int32_t uloc_getDisplayCountry(const char* locale,
const UChar* result = NULL; const UChar* result = NULL;
int32_t i = 0; int32_t i = 0;
int cntryBufSize; int cntryBufSize;
bool_t doneDefaultLocale = FALSE;
char inCountryBuffer[TEMPBUFSIZE]; char inCountryBuffer[TEMPBUFSIZE];
UErrorCode err = U_ZERO_ERROR; UErrorCode err = U_ZERO_ERROR;
UResourceBundle* bundle = NULL; UResourceBundle* bundle = NULL;
@ -772,7 +769,6 @@ int32_t uloc_getDisplayVariant(const char* locale,
const UChar* result = NULL; const UChar* result = NULL;
int32_t i = 0; int32_t i = 0;
int varBufSize; int varBufSize;
bool_t doneDefaultLocale = FALSE;
char inVariantBuffer[TEMPBUFSIZE]; char inVariantBuffer[TEMPBUFSIZE];
char* inVariant = inVariantBuffer; char* inVariant = inVariantBuffer;
UErrorCode err = U_ZERO_ERROR; UErrorCode err = U_ZERO_ERROR;
@ -1020,13 +1016,13 @@ int32_t uloc_getDisplayName(const char* locale,
U_CAPI UnicodeString** T_ResourceBundle_listInstalledLocales(const char* path, int32_t* numInstalledLocales); U_CAPI UnicodeString** T_ResourceBundle_listInstalledLocales(const char* path, int32_t* numInstalledLocales);
const char* const char*
uloc_getAvailable(int32_t index) uloc_getAvailable(int32_t idx)
{ {
if (_installedLocales == NULL) _lazyEvaluate_installedLocales(); if (_installedLocales == NULL) _lazyEvaluate_installedLocales();
if (index > _installedLocalesCount) return NULL; if (idx > _installedLocalesCount) return NULL;
else return _installedLocales[index]; else return _installedLocales[idx];
} }

View File

@ -201,7 +201,7 @@ expandGroupName(UCharNames *names, Group *group,
(group->offsetHigh<<16|group->offsetLow); (group->offsetHigh<<16|group->offsetLow);
/* read the length of this string and get the group strings offset */ /* read the length of this string and get the group strings offset */
uint16_t i=0, offset=0, length=0, nameOffset, nameLength; uint16_t i=0, offset=0, length=0, nameOffset=0, nameLength=0;
uint8_t lengthByte; uint8_t lengthByte;
/* all 32 lengths must be read to get the offset of the first group string */ /* all 32 lengths must be read to get the offset of the first group string */

View File

@ -42,9 +42,9 @@
* instantiation and subclassing. Therefore, empty. * instantiation and subclassing. Therefore, empty.
*/ */
Unicode::Unicode() {} Unicode::Unicode() {}
Unicode::Unicode(const Unicode &other) {} Unicode::Unicode(const Unicode &) {}
Unicode::~Unicode() {} Unicode::~Unicode() {}
const Unicode & const Unicode &
Unicode::operator=(const Unicode &other) { Unicode::operator=(const Unicode &) {
return *this; return *this;
} }

View File

@ -131,7 +131,7 @@ U_CAPI int32_t U_EXPORT2 uprv_digitsAfterDecimal(double x);
*/ */
U_CAPI void U_EXPORT2 uprv_tzset(void); U_CAPI void U_EXPORT2 uprv_tzset(void);
U_CAPI int32_t U_EXPORT2 uprv_timezone(void); U_CAPI int32_t U_EXPORT2 uprv_timezone(void);
U_CAPI char* U_EXPORT2 uprv_tzname(int index); U_CAPI char* U_EXPORT2 uprv_tzname(int idx);
/** /**
* Get UTC (GMT) time measured in seconds since 0:00 on 1/1/70. * Get UTC (GMT) time measured in seconds since 0:00 on 1/1/70.

View File

@ -658,7 +658,7 @@ private:
bool_t fLoaded[kDataCount]; bool_t fLoaded[kDataCount];
UErrorCode fDataStatus[kDataCount]; // Returns the appropriate error code for each data table. UErrorCode fDataStatus[kDataCount]; // Returns the appropriate error code for each data table.
bool_t fIsDataOwned; bool_t fIsDataOwned;
Locale fRealLocale; Locale fRealLocale;
LocaleFallbackIterator* fLocaleIterator; LocaleFallbackIterator* fLocaleIterator;
char* fVersionID; char* fVersionID;
}; };

View File

@ -605,7 +605,7 @@ U_CAPI int32_t U_EXPORT2 ucnv_flushCache (void);
* @stable * @stable
*/ */
U_CAPI U_CAPI
const char * U_EXPORT2 ucnv_getAvailableName (int32_t index); const char * U_EXPORT2 ucnv_getAvailableName (int32_t idx);
/** /**
* returns the number of available converters. * returns the number of available converters.
@ -636,7 +636,7 @@ ucnv_countAliases(const char *alias, UErrorCode *pErrorCode);
* @stable * @stable
*/ */
U_CAPI const char * U_CAPI const char *
ucnv_getAlias(const char *alias, uint16_t index, UErrorCode *pErrorCode); ucnv_getAlias(const char *alias, uint16_t idx, UErrorCode *pErrorCode);
/** /**
* Fill-up the list of alias names for the given alias * Fill-up the list of alias names for the given alias

View File

@ -424,7 +424,7 @@ uloc_getDisplayName(const char* localeID,
* @stable * @stable
*/ */
U_CAPI const char* U_EXPORT2 U_CAPI const char* U_EXPORT2
uloc_getAvailable(int32_t index); uloc_getAvailable(int32_t idx);
/** /**
* Gets the size of the all available locale list. * Gets the size of the all available locale list.

View File

@ -2713,7 +2713,7 @@ UnicodeString::operator new(size_t size)
{ return ::operator new(size); } { return ::operator new(size); }
inline void* inline void*
UnicodeString::operator new(size_t size, UnicodeString::operator new(size_t,
void *location) void *location)
{ return location; } { return location; }

View File

@ -37,7 +37,7 @@
// //
// accent // accent
// ---- // ----
// accent +----+/ \ // accent +----+/ \
// -------> |SI+2| | // -------> |SI+2| |
// / +----+<----/ // / +----+<----/
// +----+ | base +-------+ // +----+ | base +-------+
@ -45,7 +45,7 @@
// +----+\-------> +----+--------------> +-------+ // +----+\-------> +----+--------------> +-------+
// base |SI+2| base // base |SI+2| base
// +----+ // +----+
// ^ \ // ^ \
// | | // | |
// \----/ // \----/
// accent // accent

View File

@ -413,7 +413,6 @@ DigitList::round(int32_t maximumDigits)
* incremented * incremented
*/ */
bool_t DigitList::shouldRoundUp(int32_t maximumDigits) { bool_t DigitList::shouldRoundUp(int32_t maximumDigits) {
bool_t increment = FALSE;
// Implement IEEE half-even rounding // Implement IEEE half-even rounding
if (fDigits[maximumDigits] > '5') { if (fDigits[maximumDigits] > '5') {
return TRUE; return TRUE;

View File

@ -17,13 +17,13 @@
#include "unicode/ubidi.h" #include "unicode/ubidi.h"
#include "cbiditst.h" #include "cbiditst.h"
extern const char * const char *
dirPropNames[dirPropCount]={ dirPropNames[dirPropCount]={
"L", "R", "EN", "ES", "ET", "AN", "CS", "B", "S", "WS", "ON", "L", "R", "EN", "ES", "ET", "AN", "CS", "B", "S", "WS", "ON",
"LRE", "LRO", "AL", "RLE", "RLO", "PDF", "NSM", "BN" "LRE", "LRO", "AL", "RLE", "RLO", "PDF", "NSM", "BN"
}; };
extern const UChar const UChar
charFromDirProp[dirPropCount]={ charFromDirProp[dirPropCount]={
/* L R EN ES ET AN CS B S WS ON */ /* L R EN ES ET AN CS B S WS ON */
0x61, 0x5d0, 0x30, 0x2f, 0x25, 0x660, 0x2c, 0xa, 0x9, 0x20, 0x26, 0x61, 0x5d0, 0x30, 0x2f, 0x25, 0x660, 0x2c, 0xa, 0x9, 0x20, 0x26,
@ -313,7 +313,7 @@ testLevels20[]={
2 2
}; };
extern BiDiTestData BiDiTestData
tests[]={ tests[]={
testText1, ARRAY_LENGTH(testText1), UBIDI_DEFAULT_LTR, -1, -1, testText1, ARRAY_LENGTH(testText1), UBIDI_DEFAULT_LTR, -1, -1,
UBIDI_LTR, 0, UBIDI_LTR, 0,
@ -377,5 +377,5 @@ tests[]={
testLevels20, testVisualMap19 testLevels20, testVisualMap19
}; };
extern int int
bidiTestCount=ARRAY_LENGTH(tests); bidiTestCount=ARRAY_LENGTH(tests);

View File

@ -823,7 +823,7 @@ void TestJitterbug255()
{ {
const char testBytes[] = { (char)0x95, (char)0xcf, (char)0x8a, const char testBytes[] = { (char)0x95, (char)0xcf, (char)0x8a,
(char)0xb7, (char)0x0d, (char)0x0a, 0x0000 }; (char)0xb7, (char)0x0d, (char)0x0a, 0x0000 };
char *testBuffer = (char*)testBytes, *testEnd = (char*)testBytes+strlen(testBytes)+1; const char *testBuffer = testBytes, *testEnd = testBytes+strlen(testBytes)+1;
UErrorCode status = U_ZERO_ERROR; UErrorCode status = U_ZERO_ERROR;
UChar32 result; UChar32 result;
UConverter *cnv = 0; UConverter *cnv = 0;