mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-900 Fixed some compiler warnings.
X-SVN-Rev: 9320
This commit is contained in:
parent
35cd0efa13
commit
91c9ca5ddb
3 changed files with 168 additions and 170 deletions
|
@ -63,12 +63,11 @@ static UOption options[]={
|
|||
/* 3 */ { "to-stdout", NULL, NULL, NULL, 'c', UOPT_NO_ARG, 0 } ,
|
||||
/* 4 */ { "truncate", NULL, NULL, NULL, 't', UOPT_OPTIONAL_ARG, 0 },
|
||||
/* 5 */ UOPTION_VERBOSE,
|
||||
/* 6 */ { "locale", NULL, NULL, NULL, 'l', UOPT_REQUIRES_ARG, 0 },
|
||||
/* 7 */ UOPTION_DESTDIR,
|
||||
/* 8 */ UOPTION_SOURCEDIR,
|
||||
/* 9 */ { "bom", NULL, NULL, NULL, 0, UOPT_NO_ARG, 0 },
|
||||
/* 10 */ UOPTION_ICUDATADIR,
|
||||
/* 11 */ UOPTION_VERSION
|
||||
/* 6 */ UOPTION_DESTDIR,
|
||||
/* 7 */ UOPTION_SOURCEDIR,
|
||||
/* 8 */ { "bom", NULL, NULL, NULL, 0, UOPT_NO_ARG, 0 },
|
||||
/* 9 */ UOPTION_ICUDATADIR,
|
||||
/* 10 */ UOPTION_VERSION
|
||||
};
|
||||
|
||||
static UBool verbose = FALSE;
|
||||
|
@ -88,7 +87,6 @@ main(int argc, char* argv[]) {
|
|||
int32_t i = 0;
|
||||
|
||||
UConverter *converter;
|
||||
const char *locale = 0;
|
||||
|
||||
const char* arg;
|
||||
|
||||
|
@ -118,7 +116,7 @@ main(int argc, char* argv[]) {
|
|||
fprintf(argc < 0 ? stderr : stdout,
|
||||
"%csage: %s [ -h, -?, --help ] [ -V, --version ]"
|
||||
" [ -v, --verbose ] [ -e, --encoding encoding ] [ --bom ]"
|
||||
" [ -l, --locale locale ] [ -t, --truncate [ size ] ]"
|
||||
" [ -t, --truncate [ size ] ]"
|
||||
" [ -s, --sourcedir source ] [ -d, --destdir destination ]"
|
||||
" [ -i, --icudatadir directory ] [ -c, --to-stdout ]"
|
||||
" bundle ...\n", argc < 0 ? 'u' : 'U',
|
||||
|
@ -126,7 +124,7 @@ main(int argc, char* argv[]) {
|
|||
return argc<0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
|
||||
}
|
||||
|
||||
if(options[11].doesOccur) {
|
||||
if(options[10].doesOccur) {
|
||||
fprintf(stderr,
|
||||
"%s version %s (ICU version %s).\n"
|
||||
"%s\n",
|
||||
|
@ -137,30 +135,10 @@ main(int argc, char* argv[]) {
|
|||
encoding = options[2].value;
|
||||
}
|
||||
|
||||
if (options[7].doesOccur) {
|
||||
outputDir = options[7].value;
|
||||
}
|
||||
|
||||
if (options[6].doesOccur) {
|
||||
locale = options[6].value;
|
||||
}
|
||||
|
||||
if (options[3].doesOccur) {
|
||||
tostdout = 1;
|
||||
}
|
||||
|
||||
if (options[10].doesOccur) {
|
||||
u_setDataDirectory(options[10].value);
|
||||
}
|
||||
|
||||
if(options[8].doesOccur) {
|
||||
inputDir = options[8].value; /* we'll use users resources */
|
||||
}
|
||||
|
||||
if (options[9].doesOccur) {
|
||||
prbom = 1;
|
||||
}
|
||||
|
||||
if(options[4].doesOccur) {
|
||||
trunc = TRUE;
|
||||
if(options[4].value != NULL) {
|
||||
|
@ -173,7 +151,23 @@ main(int argc, char* argv[]) {
|
|||
}
|
||||
|
||||
if(options[5].doesOccur) {
|
||||
verbose = TRUE;
|
||||
verbose = TRUE;
|
||||
}
|
||||
|
||||
if (options[6].doesOccur) {
|
||||
outputDir = options[6].value;
|
||||
}
|
||||
|
||||
if(options[7].doesOccur) {
|
||||
inputDir = options[7].value; /* we'll use users resources */
|
||||
}
|
||||
|
||||
if (options[8].doesOccur) {
|
||||
prbom = 1;
|
||||
}
|
||||
|
||||
if (options[9].doesOccur) {
|
||||
u_setDataDirectory(options[9].value);
|
||||
}
|
||||
|
||||
converter = ucnv_open(encoding, &status);
|
||||
|
@ -638,7 +632,8 @@ static void printOutBundle(FILE *out, UConverter *converter, UResourceBundle *re
|
|||
if(trunc && len > truncsize) {
|
||||
char msg[128];
|
||||
printIndent(out, converter, indent);
|
||||
sprintf(msg, "// WARNING: this resource, size %li is truncated to %li\n", len, truncsize/2);
|
||||
sprintf(msg, "// WARNING: this resource, size %li is truncated to %li\n",
|
||||
(long)len, (long)truncsize/2);
|
||||
printCString(out, converter, msg, -1);
|
||||
len = truncsize;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
/* Protos */
|
||||
static void processFile(const char *filename, const char* cp, const char *inputDir, const char *outputDir, const char *packageName, UErrorCode *status);
|
||||
static char *make_res_filename(const char *filename, const char *outputDir,
|
||||
const char *packageName, UErrorCode *status);
|
||||
const char *packageName, UErrorCode *status);
|
||||
|
||||
/* File suffixes */
|
||||
#define RES_SUFFIX ".res"
|
||||
|
@ -48,7 +48,7 @@ enum
|
|||
COPYRIGHT,
|
||||
PACKAGE_NAME,
|
||||
BUNDLE_NAME,
|
||||
TOUCHFILE
|
||||
TOUCHFILE
|
||||
};
|
||||
|
||||
UOption options[]={
|
||||
|
@ -70,9 +70,9 @@ UOption options[]={
|
|||
|
||||
static UBool verbose = FALSE;
|
||||
static UBool write_java = FALSE;
|
||||
static UBool touchfile = FALSE;
|
||||
static UBool touchfile = FALSE;
|
||||
static const char* outputEnc ="";
|
||||
static const char* packageName=NULL;
|
||||
static const char* gPackageName=NULL;
|
||||
static const char* bundleName=NULL;
|
||||
|
||||
int
|
||||
|
@ -117,27 +117,28 @@ main(int argc,
|
|||
argv[0]);
|
||||
fprintf(stderr,
|
||||
"Options:\n"
|
||||
"\t-h or -? or --help this usage text\n"
|
||||
"\t-q or --quiet do not display warnings\n"
|
||||
"\t-v or --verbose prints out extra information about processing the files\n"
|
||||
"\t-V or --version prints out version number and exits\n"
|
||||
"\t-c or --copyright include copyright notice\n");
|
||||
"\t-h or -? or --help this usage text\n"
|
||||
"\t-q or --quiet do not display warnings\n"
|
||||
"\t-v or --verbose print extra information when processing files\n"
|
||||
"\t-V or --version prints out version number and exits\n"
|
||||
"\t-c or --copyright include copyright notice\n");
|
||||
fprintf(stderr,
|
||||
"\t-e or --encoding encoding of source files, leave empty for system default encoding\n"
|
||||
"\t NOTE: ICU must be completely built to use this option\n"
|
||||
"\t-d of --destdir destination directory, followed by the path, defaults to %s\n"
|
||||
"\t-s or --sourcedir source directory for files followed by path, defaults to %s\n"
|
||||
"\t-i or --icudatadir directory for locating any needed intermediate data files,\n"
|
||||
"\t followed by path, defaults to %s\n",
|
||||
"\t-e or --encoding encoding of source files\n"
|
||||
"\t-d of --destdir destination directory, followed by the path, defaults to %s\n"
|
||||
"\t-s or --sourcedir source directory for files followed by path, defaults to %s\n"
|
||||
"\t-i or --icudatadir directory for locating any needed intermediate data files,\n"
|
||||
"\t followed by path, defaults to %s\n",
|
||||
u_getDataDirectory(), u_getDataDirectory(), u_getDataDirectory());
|
||||
fprintf(stderr,
|
||||
"\t-j or --write-java write a Java ListResourceBundle for ICU4J, followed by optional encoding\n"
|
||||
"\t defaults to ASCII and \\uXXXX format.\n"
|
||||
"\t-p or --package-name For ICU4J: package name for writing the ListResourceBundle for ICU4J, defaults to\n"
|
||||
"\t com.ibm.icu.impl.data\n"
|
||||
"\t For ICU4C: Package name on output. Using 'ICUDATA' defaults to the current ICU4C data name.\n"
|
||||
"\t-b or --bundle-name bundle name for writing the ListResourceBundle for ICU4J, defaults to\n"
|
||||
"\t LocaleElements");
|
||||
"\t-j or --write-java write a Java ListResourceBundle for ICU4J, followed by optional encoding\n"
|
||||
"\t defaults to ASCII and \\uXXXX format.\n"
|
||||
"\t-p or --package-name For ICU4J: package name for writing the ListResourceBundle for ICU4J,\n"
|
||||
"\t defaults to com.ibm.icu.impl.data\n"
|
||||
"\t For ICU4C: Package name on output. Specfiying\n"
|
||||
"\t 'ICUDATA' defaults to the current ICU4C data name.\n");
|
||||
fprintf(stderr,
|
||||
"\t-b or --bundle-name bundle name for writing the ListResourceBundle for ICU4J,\n"
|
||||
"\t defaults to LocaleElements");
|
||||
|
||||
return argc < 0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
|
||||
}
|
||||
|
@ -162,25 +163,25 @@ main(int argc,
|
|||
outputDir = options[DESTDIR].value;
|
||||
}
|
||||
if(options[PACKAGE_NAME].doesOccur) {
|
||||
packageName = options[PACKAGE_NAME].value;
|
||||
if(!strcmp(packageName, "ICUDATA"))
|
||||
gPackageName = options[PACKAGE_NAME].value;
|
||||
if(!strcmp(gPackageName, "ICUDATA"))
|
||||
{
|
||||
packageName = U_ICUDATA_NAME;
|
||||
gPackageName = U_ICUDATA_NAME;
|
||||
}
|
||||
if(packageName[0] == 0)
|
||||
if(gPackageName[0] == 0)
|
||||
{
|
||||
packageName = NULL;
|
||||
gPackageName = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if(options[TOUCHFILE].doesOccur) {
|
||||
if(packageName == NULL) {
|
||||
fprintf(stderr, "%s: Don't use touchfile (-t) option with no package.\n",
|
||||
argv[0]);
|
||||
return -1;
|
||||
}
|
||||
touchfile = TRUE;
|
||||
}
|
||||
if(options[TOUCHFILE].doesOccur) {
|
||||
if(gPackageName == NULL) {
|
||||
fprintf(stderr, "%s: Don't use touchfile (-t) option with no package.\n",
|
||||
argv[0]);
|
||||
return -1;
|
||||
}
|
||||
touchfile = TRUE;
|
||||
}
|
||||
|
||||
if(options[ENCODING].doesOccur) {
|
||||
encoding = options[ENCODING].value;
|
||||
|
@ -217,7 +218,7 @@ main(int argc,
|
|||
if (verbose) {
|
||||
printf("processing file \"%s\"\n", theCurrentFileName);
|
||||
}
|
||||
processFile(arg, encoding, inputDir, outputDir, packageName, &status);
|
||||
processFile(arg, encoding, inputDir, outputDir, gPackageName, &status);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
@ -263,7 +264,7 @@ processFile(const char *filename, const char *cp, const char *inputDir, const ch
|
|||
goto finish;
|
||||
}
|
||||
|
||||
inputDirBuf[filenameSize - 1] = 0;
|
||||
inputDirBuf[filenameSize - 1] = 0;
|
||||
inputDir = inputDirBuf;
|
||||
}
|
||||
in = T_FileStream_open(filename, "rb");
|
||||
|
@ -273,11 +274,11 @@ processFile(const char *filename, const char *cp, const char *inputDir, const ch
|
|||
if(inputDir[dirlen-1] != U_FILE_SEP_CHAR) {
|
||||
openFileName = (char *) uprv_malloc(dirlen + filelen + 2);
|
||||
|
||||
/* test for NULL */
|
||||
if(openFileName == NULL) {
|
||||
/* test for NULL */
|
||||
if(openFileName == NULL) {
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
goto finish;
|
||||
}
|
||||
}
|
||||
|
||||
openFileName[0] = '\0';
|
||||
/*
|
||||
|
@ -338,37 +339,37 @@ processFile(const char *filename, const char *cp, const char *inputDir, const ch
|
|||
|
||||
/* Determine the target rb filename */
|
||||
rbname = make_res_filename(filename, outputDir, packageName, status);
|
||||
if(touchfile == TRUE) {
|
||||
FileStream *q;
|
||||
char msg[1024];
|
||||
char *tfname = NULL;
|
||||
if(touchfile == TRUE) {
|
||||
FileStream *q;
|
||||
char msg[1024];
|
||||
char *tfname = NULL;
|
||||
|
||||
tfname = make_res_filename(filename, outputDir, NULL, status);
|
||||
|
||||
if(U_FAILURE(*status))
|
||||
{
|
||||
fprintf(stderr, "Error writing touchfile for \"%s\"\n", filename);
|
||||
*status = U_FILE_ACCESS_ERROR;
|
||||
} else {
|
||||
uprv_strcat(tfname, ".res");
|
||||
sprintf(msg, "This empty file tells nmake that %s in package %s has been updated.\n",
|
||||
filename, packageName);
|
||||
|
||||
q = T_FileStream_open(tfname, "w");
|
||||
if(q == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error writing touchfile \"%s\"\n", tfname);
|
||||
*status = U_FILE_ACCESS_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
T_FileStream_write(q, msg, uprv_strlen(msg));
|
||||
T_FileStream_close(q);
|
||||
}
|
||||
uprv_free(tfname);
|
||||
}
|
||||
|
||||
}
|
||||
tfname = make_res_filename(filename, outputDir, NULL, status);
|
||||
|
||||
if(U_FAILURE(*status))
|
||||
{
|
||||
fprintf(stderr, "Error writing touchfile for \"%s\"\n", filename);
|
||||
*status = U_FILE_ACCESS_ERROR;
|
||||
} else {
|
||||
uprv_strcat(tfname, ".res");
|
||||
sprintf(msg, "This empty file tells nmake that %s in package %s has been updated.\n",
|
||||
filename, packageName);
|
||||
|
||||
q = T_FileStream_open(tfname, "w");
|
||||
if(q == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error writing touchfile \"%s\"\n", tfname);
|
||||
*status = U_FILE_ACCESS_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
T_FileStream_write(q, msg, uprv_strlen(msg));
|
||||
T_FileStream_close(q);
|
||||
}
|
||||
uprv_free(tfname);
|
||||
}
|
||||
|
||||
}
|
||||
if(U_FAILURE(*status)) {
|
||||
goto finish;
|
||||
}
|
||||
|
|
|
@ -295,10 +295,12 @@ int main(int argc, char* argv[])
|
|||
"\t-c or --copyright include a copyright notice\n"
|
||||
"\t-d or --destdir destination directory, followed by the path\n"
|
||||
"\t-v or --verbose Turn on verbose output\n",
|
||||
"\t-p or --pkgname sets the 'package' name for output files. If ICUDATA, then the default\n"
|
||||
"\t icu package name will be used.\n"
|
||||
"\t-t or --touchfile Generate additional small file without packagename, for nmake\n",
|
||||
argv[0]);
|
||||
fprintf(stderr,
|
||||
"\t-p or --pkgname sets the 'package' name for output files.\n"
|
||||
"\t If name is ICUDATA, then the default icu package\n"
|
||||
"\t name will be used.\n"
|
||||
"\t-t or --touchfile Generate additional small file without packagename, for nmake\n");
|
||||
return argc<0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
|
||||
}
|
||||
|
||||
|
@ -314,7 +316,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
if(!options[6].doesOccur)
|
||||
{
|
||||
fprintf(stderr, "%s : option -p (package name) is required.\n",
|
||||
fprintf(stderr, "%s : option -p (package name) is required.\n",
|
||||
argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
@ -329,12 +331,12 @@ int main(int argc, char* argv[])
|
|||
{
|
||||
pkgName = NULL;
|
||||
|
||||
if(TOUCHFILE)
|
||||
{
|
||||
fprintf(stderr, "%s: Don't use touchfile option with an empty packagename.\n",
|
||||
argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
if(TOUCHFILE)
|
||||
{
|
||||
fprintf(stderr, "%s: Don't use touchfile option with an empty packagename.\n",
|
||||
argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -404,10 +406,10 @@ int main(int argc, char* argv[])
|
|||
uprv_strcpy(cnvName, outBasename);
|
||||
|
||||
if(TOUCHFILE)
|
||||
{
|
||||
uprv_strcpy(touchFileName, outBasename);
|
||||
uprv_strcat(touchFileName, ".cnv");
|
||||
}
|
||||
{
|
||||
uprv_strcpy(touchFileName, outBasename);
|
||||
uprv_strcat(touchFileName, ".cnv");
|
||||
}
|
||||
|
||||
if(pkgName != NULL)
|
||||
{
|
||||
|
@ -416,7 +418,7 @@ int main(int argc, char* argv[])
|
|||
uprv_strcat(outBasename, "_");
|
||||
uprv_strcat(outBasename, cnvName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*Adds the target extension*/
|
||||
uprv_strcat(outBasename, CONVERTER_FILE_EXTENSION);
|
||||
|
@ -460,27 +462,27 @@ int main(int argc, char* argv[])
|
|||
|
||||
writeConverterData(mySharedData, cnvNameWithPkg, destdir, &err);
|
||||
((NewConverter *)mySharedData->table)->close((NewConverter *)mySharedData->table);
|
||||
if(TOUCHFILE)
|
||||
{
|
||||
FileStream *q;
|
||||
char msg[1024];
|
||||
|
||||
sprintf(msg, "This empty file tells nmake that %s in package %s has been updated.\n",
|
||||
cnvName, pkgName);
|
||||
if(TOUCHFILE)
|
||||
{
|
||||
FileStream *q;
|
||||
char msg[1024];
|
||||
|
||||
q = T_FileStream_open(touchFileName, "w");
|
||||
if(q == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error writing touchfile \"%s\"\n", touchFileName);
|
||||
err = U_FILE_ACCESS_ERROR;
|
||||
}
|
||||
sprintf(msg, "This empty file tells nmake that %s in package %s has been updated.\n",
|
||||
cnvName, pkgName);
|
||||
|
||||
else
|
||||
{
|
||||
T_FileStream_write(q, msg, uprv_strlen(msg));
|
||||
T_FileStream_close(q);
|
||||
}
|
||||
}
|
||||
q = T_FileStream_open(touchFileName, "w");
|
||||
if(q == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error writing touchfile \"%s\"\n", touchFileName);
|
||||
err = U_FILE_ACCESS_ERROR;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
T_FileStream_write(q, msg, uprv_strlen(msg));
|
||||
T_FileStream_close(q);
|
||||
}
|
||||
}
|
||||
|
||||
/* write the information data */
|
||||
uprv_free((UConverterStaticData *)mySharedData->staticData);
|
||||
|
@ -878,52 +880,52 @@ void loadTableFromFile(FileStream* convFile, UConverterSharedData* sharedData, U
|
|||
/*creates a UConverterStaticData, fills in necessary links to it the appropriate function pointers*/
|
||||
UConverterSharedData* createConverterFromTableFile(const char* converterName, UErrorCode* err)
|
||||
{
|
||||
FileStream* convFile = NULL;
|
||||
UConverterSharedData* mySharedData = NULL;
|
||||
UConverterStaticData* myStaticData = NULL;
|
||||
FileStream* convFile = NULL;
|
||||
UConverterSharedData* mySharedData = NULL;
|
||||
UConverterStaticData* myStaticData = NULL;
|
||||
|
||||
if (U_FAILURE(*err)) return NULL;
|
||||
if (U_FAILURE(*err)) return NULL;
|
||||
|
||||
convFile = T_FileStream_open(converterName, "r");
|
||||
if (convFile == NULL)
|
||||
convFile = T_FileStream_open(converterName, "r");
|
||||
if (convFile == NULL)
|
||||
{
|
||||
*err = U_FILE_ACCESS_ERROR;
|
||||
return NULL;
|
||||
*err = U_FILE_ACCESS_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
mySharedData = (UConverterSharedData*) uprv_malloc(sizeof(UConverterSharedData));
|
||||
if (mySharedData == NULL)
|
||||
mySharedData = (UConverterSharedData*) uprv_malloc(sizeof(UConverterSharedData));
|
||||
if (mySharedData == NULL)
|
||||
{
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
T_FileStream_close(convFile);
|
||||
return NULL;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
T_FileStream_close(convFile);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uprv_memset(mySharedData, 0, sizeof(UConverterSharedData));
|
||||
uprv_memset(mySharedData, 0, sizeof(UConverterSharedData));
|
||||
|
||||
mySharedData->structSize = sizeof(UConverterSharedData);
|
||||
mySharedData->structSize = sizeof(UConverterSharedData);
|
||||
|
||||
myStaticData = (UConverterStaticData*) uprv_malloc(sizeof(UConverterStaticData));
|
||||
if (myStaticData == NULL)
|
||||
myStaticData = (UConverterStaticData*) uprv_malloc(sizeof(UConverterStaticData));
|
||||
if (myStaticData == NULL)
|
||||
{
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
T_FileStream_close(convFile);
|
||||
return NULL;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
T_FileStream_close(convFile);
|
||||
return NULL;
|
||||
}
|
||||
uprv_memset(myStaticData, 0, sizeof(UConverterStaticData));
|
||||
mySharedData->staticData = myStaticData;
|
||||
myStaticData->structSize = sizeof(UConverterStaticData);
|
||||
/* mySharedData->staticDataOwned = FALSE; */ /* not owned if in udata */
|
||||
mySharedData->sharedDataCached = FALSE;
|
||||
uprv_memset(myStaticData, 0, sizeof(UConverterStaticData));
|
||||
mySharedData->staticData = myStaticData;
|
||||
myStaticData->structSize = sizeof(UConverterStaticData);
|
||||
/* mySharedData->staticDataOwned = FALSE; */ /* not owned if in udata */
|
||||
mySharedData->sharedDataCached = FALSE;
|
||||
|
||||
mySharedData->dataMemory = NULL; /* for init */
|
||||
mySharedData->dataMemory = NULL; /* for init */
|
||||
|
||||
readHeaderFromFile(mySharedData, convFile, converterName, err);
|
||||
readHeaderFromFile(mySharedData, convFile, converterName, err);
|
||||
|
||||
if (U_FAILURE(*err)) return NULL;
|
||||
if (U_FAILURE(*err)) return NULL;
|
||||
|
||||
switch (myStaticData->conversionType)
|
||||
switch (myStaticData->conversionType)
|
||||
{
|
||||
case UCNV_SBCS:
|
||||
{
|
||||
|
@ -1013,10 +1015,10 @@ UConverterSharedData* createConverterFromTableFile(const char* converterName, UE
|
|||
}
|
||||
|
||||
default :
|
||||
fprintf(stderr, "error: <uconv_class> omitted\n");
|
||||
*err = U_INVALID_TABLE_FORMAT;
|
||||
mySharedData->table = NULL;
|
||||
break;
|
||||
fprintf(stderr, "error: <uconv_class> omitted\n");
|
||||
*err = U_INVALID_TABLE_FORMAT;
|
||||
mySharedData->table = NULL;
|
||||
break;
|
||||
};
|
||||
|
||||
if(U_SUCCESS(*err) && mySharedData->table != NULL)
|
||||
|
@ -1024,9 +1026,9 @@ UConverterSharedData* createConverterFromTableFile(const char* converterName, UE
|
|||
loadTableFromFile(convFile, mySharedData, err);
|
||||
}
|
||||
|
||||
T_FileStream_close(convFile);
|
||||
T_FileStream_close(convFile);
|
||||
|
||||
return mySharedData;
|
||||
return mySharedData;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue