ICU-5225 Based on the decision of the group, we will optimize for speed and provide no option for optimizing for size.

X-SVN-Rev: 19721
This commit is contained in:
George Rhoten 2006-06-14 23:09:52 +00:00
parent 4b466dd22a
commit 188173647b

View File

@ -138,7 +138,7 @@ static UBool verbose = FALSE;
static int lineNum = 1; static int lineNum = 1;
static UConverterAliasOptions tableOptions = { static UConverterAliasOptions tableOptions = {
UCNV_IO_UNNORMALIZED, UCNV_IO_STD_NORMALIZED,
1 /* containsCnvOptionInfo */ 1 /* containsCnvOptionInfo */
}; };
@ -197,8 +197,7 @@ enum
VERBOSE, VERBOSE,
COPYRIGHT, COPYRIGHT,
DESTDIR, DESTDIR,
SOURCEDIR, SOURCEDIR
OPTIMIZE
}; };
static UOption options[]={ static UOption options[]={
@ -207,8 +206,7 @@ static UOption options[]={
UOPTION_VERBOSE, UOPTION_VERBOSE,
UOPTION_COPYRIGHT, UOPTION_COPYRIGHT,
UOPTION_DESTDIR, UOPTION_DESTDIR,
UOPTION_SOURCEDIR, UOPTION_SOURCEDIR
UOPTION_DEF( "optimize", 'O', UOPT_REQUIRES_ARG),
}; };
extern int extern int
@ -250,19 +248,6 @@ main(int argc, char* argv[]) {
verbose = TRUE; verbose = TRUE;
} }
if(options[OPTIMIZE].doesOccur) {
if (strcmp(options[OPTIMIZE].value, "size") == 0) {
tableOptions.stringNormalizationType = UCNV_IO_UNNORMALIZED;
}
else if (strcmp(options[OPTIMIZE].value, "speed") == 0) {
tableOptions.stringNormalizationType = UCNV_IO_STD_NORMALIZED;
}
else {
fprintf(stderr, "Invalid value for optimization\n");
return -1;
}
}
if(argc>=2) { if(argc>=2) {
path=argv[1]; path=argv[1];
} else { } else {
@ -987,12 +972,7 @@ writeAliasTable(UNewDataMemory *out) {
udata_write32(out, uniqueAliasesSize); /* The preresolved form of mapping an untagged the alias to a converter */ udata_write32(out, uniqueAliasesSize); /* The preresolved form of mapping an untagged the alias to a converter */
udata_write32(out, tagCount * converterCount); udata_write32(out, tagCount * converterCount);
udata_write32(out, aliasListsSize + 1); udata_write32(out, aliasListsSize + 1);
if (tableOptions.stringNormalizationType == UCNV_IO_UNNORMALIZED) {
udata_write32(out, 0);
}
else {
udata_write32(out, sizeof(tableOptions) / sizeof(uint16_t)); udata_write32(out, sizeof(tableOptions) / sizeof(uint16_t));
}
udata_write32(out, (tagBlock.top + stringBlock.top) / sizeof(uint16_t)); udata_write32(out, (tagBlock.top + stringBlock.top) / sizeof(uint16_t));
if (tableOptions.stringNormalizationType != UCNV_IO_UNNORMALIZED) { if (tableOptions.stringNormalizationType != UCNV_IO_UNNORMALIZED) {
udata_write32(out, (tagBlock.top + stringBlock.top) / sizeof(uint16_t)); udata_write32(out, (tagBlock.top + stringBlock.top) / sizeof(uint16_t));
@ -1031,9 +1011,7 @@ writeAliasTable(UNewDataMemory *out) {
udata_writeBlock(out, (const void *)aliasLists, aliasListsSize * sizeof(uint16_t)); udata_writeBlock(out, (const void *)aliasLists, aliasListsSize * sizeof(uint16_t));
/* Write any options for the alias table. */ /* Write any options for the alias table. */
if (tableOptions.stringNormalizationType != UCNV_IO_UNNORMALIZED) {
udata_writeBlock(out, (const void *)&tableOptions, sizeof(tableOptions)); udata_writeBlock(out, (const void *)&tableOptions, sizeof(tableOptions));
}
/* write the tags strings */ /* write the tags strings */
udata_writeString(out, tagBlock.store, tagBlock.top); udata_writeString(out, tagBlock.store, tagBlock.top);