ICU-3685 Use different function and struct names between separate files for different types.
X-SVN-Rev: 14909
This commit is contained in:
parent
837d4bd693
commit
de1f8d59d0
@ -99,7 +99,7 @@ static UDataMemory* UDATA = NULL;
|
||||
*/
|
||||
U_CDECL_BEGIN
|
||||
static UBool U_CALLCONV
|
||||
isAcceptable(void* /*context*/,
|
||||
isPNameAcceptable(void* /*context*/,
|
||||
const char* /*type*/, const char* /*name*/,
|
||||
const UDataInfo* info) {
|
||||
return
|
||||
@ -133,7 +133,7 @@ static UBool _load() {
|
||||
UErrorCode ec = U_ZERO_ERROR;
|
||||
UDataMemory* data =
|
||||
udata_openChoice(0, PNAME_DATA_TYPE, PNAME_DATA_NAME,
|
||||
isAcceptable, 0, &ec);
|
||||
isPNameAcceptable, 0, &ec);
|
||||
if (U_SUCCESS(ec)) {
|
||||
umtx_lock(NULL);
|
||||
if (UDATA == NULL) {
|
||||
|
@ -1091,16 +1091,16 @@ typedef char * U_CALLCONV StripForCompareFn(char *dst, const char *name);
|
||||
* after sorting this array by strings, the actual arrays are permutated
|
||||
* according to the sorting indexes
|
||||
*/
|
||||
typedef struct Row {
|
||||
typedef struct TempRow {
|
||||
uint16_t strIndex, sortIndex;
|
||||
} Row;
|
||||
} TempRow;
|
||||
|
||||
typedef struct TempTable {
|
||||
typedef struct TempAliasTable {
|
||||
const char *chars;
|
||||
Row *rows;
|
||||
TempRow *rows;
|
||||
uint16_t *resort;
|
||||
StripForCompareFn *stripForCompare;
|
||||
} TempTable;
|
||||
} TempAliasTable;
|
||||
|
||||
enum {
|
||||
STACK_ROW_CAPACITY=500
|
||||
@ -1111,11 +1111,11 @@ io_compareRows(const void *context, const void *left, const void *right) {
|
||||
char strippedLeft[UCNV_MAX_CONVERTER_NAME_LENGTH],
|
||||
strippedRight[UCNV_MAX_CONVERTER_NAME_LENGTH];
|
||||
|
||||
TempTable *tempTable=(TempTable *)context;
|
||||
TempAliasTable *tempTable=(TempAliasTable *)context;
|
||||
const char *chars=tempTable->chars;
|
||||
|
||||
return (int32_t)uprv_strcmp(tempTable->stripForCompare(strippedLeft, chars+2*((const Row *)left)->strIndex),
|
||||
tempTable->stripForCompare(strippedRight, chars+2*((const Row *)right)->strIndex));
|
||||
return (int32_t)uprv_strcmp(tempTable->stripForCompare(strippedLeft, chars+2*((const TempRow *)left)->strIndex),
|
||||
tempTable->stripForCompare(strippedRight, chars+2*((const TempRow *)right)->strIndex));
|
||||
}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
@ -1130,9 +1130,9 @@ ucnv_swapAliases(const UDataSwapper *ds,
|
||||
uint32_t offsets[offsetsCount]; /* 16-bit-addressed offsets from inTable/outTable */
|
||||
uint32_t i, count, tocLength, topOffset;
|
||||
|
||||
Row rows[STACK_ROW_CAPACITY];
|
||||
TempRow rows[STACK_ROW_CAPACITY];
|
||||
uint16_t resort[STACK_ROW_CAPACITY];
|
||||
TempTable tempTable;
|
||||
TempAliasTable tempTable;
|
||||
|
||||
/* udata_swapDataHeader checks the arguments */
|
||||
headerSize=udata_swapDataHeader(ds, inData, length, outData, pErrorCode);
|
||||
@ -1232,7 +1232,7 @@ ucnv_swapAliases(const UDataSwapper *ds,
|
||||
tempTable.rows=rows;
|
||||
tempTable.resort=resort;
|
||||
} else {
|
||||
tempTable.rows=(Row *)uprv_malloc(count*sizeof(Row)+count*2);
|
||||
tempTable.rows=(TempRow *)uprv_malloc(count*sizeof(TempRow)+count*2);
|
||||
if(tempTable.rows==NULL) {
|
||||
udata_printError(ds, "ucnv_swapAliases(): unable to allocate memory for sorting tables (max length: %u)\n",
|
||||
count);
|
||||
@ -1268,7 +1268,7 @@ ucnv_swapAliases(const UDataSwapper *ds,
|
||||
tempTable.rows[i].sortIndex=(uint16_t)i;
|
||||
}
|
||||
|
||||
uprv_sortArray(tempTable.rows, (int32_t)count, sizeof(Row),
|
||||
uprv_sortArray(tempTable.rows, (int32_t)count, sizeof(TempRow),
|
||||
io_compareRows, &tempTable,
|
||||
FALSE, pErrorCode);
|
||||
|
||||
|
@ -466,7 +466,7 @@ _HZ_WriteSub(UConverterFromUnicodeArgs *args, int32_t offsetIndex, UErrorCode *e
|
||||
}
|
||||
|
||||
/* structure for SafeClone calculations */
|
||||
struct cloneStruct
|
||||
struct cloneHZStruct
|
||||
{
|
||||
UConverter cnv;
|
||||
UAlignedMemory deadSpace1;
|
||||
@ -482,8 +482,8 @@ _HZ_SafeClone(const UConverter *cnv,
|
||||
int32_t *pBufferSize,
|
||||
UErrorCode *status)
|
||||
{
|
||||
struct cloneStruct * localClone;
|
||||
int32_t size, bufferSizeNeeded = sizeof(struct cloneStruct);
|
||||
struct cloneHZStruct * localClone;
|
||||
int32_t size, bufferSizeNeeded = sizeof(struct cloneHZStruct);
|
||||
|
||||
if (U_FAILURE(*status)){
|
||||
return 0;
|
||||
@ -494,7 +494,7 @@ _HZ_SafeClone(const UConverter *cnv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
localClone = (struct cloneStruct *)stackBuffer;
|
||||
localClone = (struct cloneHZStruct *)stackBuffer;
|
||||
uprv_memcpy(&localClone->cnv, cnv, sizeof(UConverter));
|
||||
|
||||
uprv_memcpy(&localClone->mydata, cnv->extraInfo, sizeof(UConverterDataHZ));
|
||||
|
@ -1296,7 +1296,7 @@ CALLBACK:
|
||||
}
|
||||
|
||||
/* structure for SafeClone calculations */
|
||||
struct cloneStruct
|
||||
struct cloneISCIIStruct
|
||||
{
|
||||
UConverter cnv;
|
||||
UConverterDataISCII mydata;
|
||||
@ -1309,8 +1309,8 @@ _ISCII_SafeClone(const UConverter *cnv,
|
||||
int32_t *pBufferSize,
|
||||
UErrorCode *status)
|
||||
{
|
||||
struct cloneStruct * localClone;
|
||||
int32_t bufferSizeNeeded = sizeof(struct cloneStruct);
|
||||
struct cloneISCIIStruct * localClone;
|
||||
int32_t bufferSizeNeeded = sizeof(struct cloneISCIIStruct);
|
||||
|
||||
if (U_FAILURE(*status)){
|
||||
return 0;
|
||||
@ -1321,7 +1321,7 @@ _ISCII_SafeClone(const UConverter *cnv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
localClone = (struct cloneStruct *)stackBuffer;
|
||||
localClone = (struct cloneISCIIStruct *)stackBuffer;
|
||||
uprv_memcpy(&localClone->cnv, cnv, sizeof(UConverter));
|
||||
|
||||
uprv_memcpy(&localClone->mydata, cnv->extraInfo, sizeof(UConverterDataISCII));
|
||||
|
@ -1944,7 +1944,7 @@ _SCSUWriteSub(UConverterFromUnicodeArgs *pArgs,
|
||||
}
|
||||
|
||||
/* structure for SafeClone calculations */
|
||||
struct cloneStruct
|
||||
struct cloneSCSUStruct
|
||||
{
|
||||
UConverter cnv;
|
||||
SCSUData mydata;
|
||||
@ -1956,8 +1956,8 @@ _SCSUSafeClone(const UConverter *cnv,
|
||||
int32_t *pBufferSize,
|
||||
UErrorCode *status)
|
||||
{
|
||||
struct cloneStruct * localClone;
|
||||
int32_t bufferSizeNeeded = sizeof(struct cloneStruct);
|
||||
struct cloneSCSUStruct * localClone;
|
||||
int32_t bufferSizeNeeded = sizeof(struct cloneSCSUStruct);
|
||||
|
||||
if (U_FAILURE(*status)){
|
||||
return 0;
|
||||
@ -1968,7 +1968,7 @@ _SCSUSafeClone(const UConverter *cnv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
localClone = (struct cloneStruct *)stackBuffer;
|
||||
localClone = (struct cloneSCSUStruct *)stackBuffer;
|
||||
/* ucnv.c/ucnv_safeClone() copied the main UConverter already */
|
||||
|
||||
uprv_memcpy(&localClone->mydata, cnv->extraInfo, sizeof(SCSUData));
|
||||
|
@ -49,7 +49,7 @@ static uint8_t formatVersion[4]={ 0, 0, 0, 0 };
|
||||
static UVersionInfo dataVersion={ 0, 0, 0, 0 };
|
||||
|
||||
static UBool U_CALLCONV
|
||||
isAcceptable(void * /* context */,
|
||||
isSPrepAcceptable(void * /* context */,
|
||||
const char * /* type */,
|
||||
const char * /* name */,
|
||||
const UDataInfo *pInfo) {
|
||||
@ -74,7 +74,7 @@ isAcceptable(void * /* context */,
|
||||
}
|
||||
|
||||
static int32_t U_CALLCONV
|
||||
getFoldingOffset(uint32_t data) {
|
||||
getSPrepFoldingOffset(uint32_t data) {
|
||||
|
||||
return (int32_t)data;
|
||||
|
||||
@ -155,7 +155,7 @@ loadData(UStringPrepProfile* profile,
|
||||
|
||||
/* open the data outside the mutex block */
|
||||
//TODO: change the path
|
||||
dataMemory=udata_openChoice(path, type, name, isAcceptable, NULL, errorCode);
|
||||
dataMemory=udata_openChoice(path, type, name, isSPrepAcceptable, NULL, errorCode);
|
||||
if(U_FAILURE(*errorCode)) {
|
||||
return FALSE;
|
||||
}
|
||||
@ -163,7 +163,7 @@ loadData(UStringPrepProfile* profile,
|
||||
p=(const int32_t *)udata_getMemory(dataMemory);
|
||||
pb=(const uint8_t *)(p+_SPREP_INDEX_TOP);
|
||||
utrie_unserialize(&_sprepTrie, pb, p[_SPREP_INDEX_TRIE_SIZE], errorCode);
|
||||
_sprepTrie.getFoldingOffset=getFoldingOffset;
|
||||
_sprepTrie.getFoldingOffset=getSPrepFoldingOffset;
|
||||
|
||||
|
||||
if(U_FAILURE(*errorCode)) {
|
||||
|
Loading…
Reference in New Issue
Block a user