/*
******************************************************************************
*
-* Copyright (C) 2000-2004, International Business Machines
+* Copyright (C) 2000-2006, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
static void
_getUnicodeSetForBytes(const UConverterSharedData *sharedData,
const int32_t (*stateTable)[256], const uint16_t *unicodeCodeUnits,
- USetAdder *sa,
+ const USetAdder *sa,
UConverterUnicodeSet which,
uint8_t state, uint32_t offset, int32_t lowByte, int32_t highByte,
*/
U_CFUNC void
ucnv_MBCSGetUnicodeSetForBytes(const UConverterSharedData *sharedData,
- USetAdder *sa,
+ const USetAdder *sa,
UConverterUnicodeSet which,
uint8_t state, int32_t lowByte, int32_t highByte,
UErrorCode *pErrorCode) {
U_CFUNC void
ucnv_MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData,
- USetAdder *sa,
+ const USetAdder *sa,
UConverterUnicodeSet which,
UErrorCode *pErrorCode) {
const UConverterMBCSTable *mbcsTable;
static void
ucnv_MBCSGetUnicodeSet(const UConverter *cnv,
- USetAdder *sa,
+ const USetAdder *sa,
UConverterUnicodeSet which,
UErrorCode *pErrorCode) {
if(cnv->options&_MBCS_OPTION_GB18030) {
* Definition of LINEAR macros and gb18030Ranges see near the beginning of the file.
*
* In the future, conversion extensions may handle m:n mappings and delta tables,
- * see http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/conversion/conversion_extensions.html
+ * see http://dev.icu-project.org/cgi-bin/viewcvs.cgi/~checkout~/icuhtml/design/conversion/conversion_extensions.html
*
* If an input character cannot be mapped, then these functions set an error
* code. The framework will then call the callback function.
source=(const uint8_t *)pArgs->source;
sourceLimit=(const uint8_t *)pArgs->sourceLimit;
target=pArgs->target;
- targetCapacity=pArgs->targetLimit-pArgs->target;
+ targetCapacity=(int32_t)(pArgs->targetLimit-pArgs->target);
offsets=pArgs->offsets;
if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0) {
* since the conversion here is 1:1 UChar:uint8_t, we need only one counter
* for the minimum of the sourceLength and targetCapacity
*/
- length=sourceLimit-source;
+ length=(int32_t)(sourceLimit-source);
if(length<targetCapacity) {
targetCapacity=length;
}
}
/* recalculate the targetCapacity after an extension mapping */
- targetCapacity=pArgs->targetLimit-target;
- length=sourceLimit-source;
+ targetCapacity=(int32_t)(pArgs->targetLimit-target);
+ length=(int32_t)(sourceLimit-source);
if(length<targetCapacity) {
targetCapacity=length;
}
source=pArgs->source;
sourceLimit=pArgs->sourceLimit;
target=(uint8_t *)pArgs->target;
- targetCapacity=pArgs->targetLimit-pArgs->target;
+ targetCapacity=(int32_t)(pArgs->targetLimit-pArgs->target);
offsets=pArgs->offsets;
table=cnv->sharedData->mbcs.fromUnicodeTable;
/* a mapping was written to the target, continue */
/* recalculate the targetCapacity after an extension mapping */
- targetCapacity=pArgs->targetLimit-(char *)target;
+ targetCapacity=(int32_t)(pArgs->targetLimit-(char *)target);
/* normal end of conversion: prepare for a new character */
sourceIndex=nextSourceIndex;
source=pArgs->source;
sourceLimit=pArgs->sourceLimit;
target=(uint8_t *)pArgs->target;
- targetCapacity=pArgs->targetLimit-pArgs->target;
+ targetCapacity=(int32_t)(pArgs->targetLimit-pArgs->target);
offsets=pArgs->offsets;
table=cnv->sharedData->mbcs.fromUnicodeTable;
/* a mapping was written to the target, continue */
/* recalculate the targetCapacity after an extension mapping */
- targetCapacity=pArgs->targetLimit-(char *)target;
+ targetCapacity=(int32_t)(pArgs->targetLimit-(char *)target);
/* normal end of conversion: prepare for a new character */
sourceIndex=nextSourceIndex;
source=pArgs->source;
sourceLimit=pArgs->sourceLimit;
target=(uint8_t *)pArgs->target;
- targetCapacity=pArgs->targetLimit-pArgs->target;
+ targetCapacity=(int32_t)(pArgs->targetLimit-pArgs->target);
offsets=pArgs->offsets;
table=cnv->sharedData->mbcs.fromUnicodeTable;
* since the conversion here is 1:1 UChar:uint8_t, we need only one counter
* for the minimum of the sourceLength and targetCapacity
*/
- length=sourceLimit-source;
+ length=(int32_t)(sourceLimit-source);
if(length<targetCapacity) {
targetCapacity=length;
}
/* a mapping was written to the target, continue */
/* recalculate the targetCapacity after an extension mapping */
- targetCapacity=pArgs->targetLimit-(char *)target;
- length=sourceLimit-source;
+ targetCapacity=(int32_t)(pArgs->targetLimit-(char *)target);
+ length=(int32_t)(sourceLimit-source);
if(length<targetCapacity) {
targetCapacity=length;
}
source=pArgs->source;
sourceLimit=pArgs->sourceLimit;
target=(uint8_t *)pArgs->target;
- targetCapacity=pArgs->targetLimit-pArgs->target;
+ targetCapacity=(int32_t)(pArgs->targetLimit-pArgs->target);
offsets=pArgs->offsets;
table=cnv->sharedData->mbcs.fromUnicodeTable;
/* a mapping was written to the target, continue */
/* recalculate the targetCapacity after an extension mapping */
- targetCapacity=pArgs->targetLimit-(char *)target;
+ targetCapacity=(int32_t)(pArgs->targetLimit-(char *)target);
/* normal end of conversion: prepare for a new character */
if(offsets!=NULL) {
length=1;
} else {
/* select subChar in all other cases */
- subchar=(char *)cnv->subChar;
+ subchar=(char *)cnv->subChars;
length=cnv->subCharLen;
}