ICU-900 Don't display some warnings for resource bundles that are known to be somewhat bad.

X-SVN-Rev: 6148
This commit is contained in:
George Rhoten 2001-10-10 18:32:06 +00:00
parent 3534bb0041
commit 7c6392f670
4 changed files with 48 additions and 26 deletions

View File

@ -6,7 +6,7 @@
# invoke with
# nmake /f makedata.mak icup=<path_to_icu_instalation> [Debug|Release]
#
# 03/19/2001 weiv, schererm Created
# 03/19/2001 weiv, schererm Created
.SUFFIXES : .res .txt
@ -15,7 +15,7 @@ ALL : "$(TESTDATAOUT)\testdata.dat"
"$(TESTDATAOUT)\testdata.dat" : "$(TESTDATAOUT)\root.res" "$(TESTDATAOUT)\te.res" "$(TESTDATAOUT)\te_IN.res" "$(TESTDATAOUT)\testtypes.res" "$(TESTDATAOUT)\testempty.res" "$(TESTDATAOUT)\empty.res" $(TESTDATAOUT)test.dat
@echo Building test data
@"$(ICUTOOLS)\pkgdata\$(CFG)\pkgdata" -v -m common -c -p testdata -O "$(PKGOPT)" -d "$(TESTDATAOUT)" -T "$(TESTDATAOUT)" -s "$(TESTDATAOUT)" <<
@"$(ICUTOOLS)\pkgdata\$(CFG)\pkgdata" -v -m common -c -p testdata -O "$(PKGOPT)" -d "$(TESTDATAOUT)" -T "$(TESTDATAOUT)" -s "$(TESTDATAOUT)" <<
root.res
te.res
te_IN.res
@ -25,9 +25,11 @@ test.dat
<<
# Inference rule for creating resource bundles
# Some test data resource bundles are known to have warnings and bad data.
# The -q option is there on purpose, so we don't see it normally.
{$(TESTDATA)}.txt.res:
@echo Making Test Resource Bundle files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -s$(TESTDATA) -d$(TESTDATAOUT) $(?F)
@echo Making Test Resource Bundle files
@"$(ICUTOOLS)\genrb\$(CFG)\genrb" -q -s$(TESTDATA) -d$(TESTDATAOUT) $(?F)
$(TESTDATAOUT)test.dat : {"$(ICUTOOLS)\gentest\$(CFG)"}gentest.exe
"$(ICUTOOLS)\gentest\$(CFG)\gentest" -d$(TESTDATAOUT)

View File

@ -31,14 +31,24 @@ void error(uint32_t linenumber, const char *msg, ...)
va_end(va);
}
void warning(uint32_t linenumber, const char *msg, ...)
{
va_list va;
static gShowWarning = TRUE;
va_start(va, msg);
fprintf(stderr, "%s:%d: warning: ", gCurrentFileName, linenumber);
vfprintf(stderr, msg, va);
fprintf(stderr, "\n");
va_end(va);
void setShowWarning(UBool val)
{
gShowWarning = val;
}
void warning(uint32_t linenumber, const char *msg, ...)
{
if (gShowWarning)
{
va_list va;
va_start(va, msg);
fprintf(stderr, "%s:%d: warning: ", gCurrentFileName, linenumber);
vfprintf(stderr, msg, va);
fprintf(stderr, "\n");
va_end(va);
}
}

View File

@ -38,4 +38,7 @@ extern const char *gCurrentFileName;
void error (uint32_t linenumber, const char *msg, ...);
void warning (uint32_t linenumber, const char *msg, ...);
/* Show warnings? */
void setShowWarning(UBool val);
#endif

View File

@ -54,7 +54,8 @@ enum
{
HELP1,
HELP2,
VERBOSE,
/* VERBOSE, */
QUIET,
VERSION,
SOURCEDIR,
DESTDIR,
@ -65,7 +66,8 @@ enum
UOption options[]={
UOPTION_HELP_H,
UOPTION_HELP_QUESTION_MARK,
UOPTION_VERBOSE,
/* UOPTION_VERBOSE, */
UOPTION_QUIET,
UOPTION_VERSION,
UOPTION_SOURCEDIR,
UOPTION_DESTDIR,
@ -86,7 +88,7 @@ main(int argc,
const char *outputDir = NULL; /* NULL = no output directory, use current */
const char *inputDir = NULL;
const char *encoding = "";
UBool verbose;
/* UBool verbose; */
int i;
#ifdef XP_MAC_CONSOLE
@ -116,22 +118,27 @@ main(int argc,
"Usage: %s [OPTIONS] [FILES]\n"
"\treads the list of resource bundle source files and creates\n"
"\tbinary version of reosurce bundles (.res files)\n"
"\tOptions:\n"
"\t\t-h, -? or --help this usage text\n"
"\t\t-V or --version prints out version number and exits\n"
"\t\t-d of --destdir destination directory, followed by the path, defaults to %s\n"
"\t\t-v or --verbose be verbose\n"
"\t\t-e or --encoding encoding of source files, leave empty for system default encoding\n"
"\t\t NOTE: ICU must be completely built to use this option\n"
"\t\t-s or --sourcedir source directory for files followed by path, defaults to %s\n"
"\t\t-i or --icudatadir directory for locating any needed intermediate data files,\n"
"\t\t followed by path, defaults to %s\n",
"Options:\n"
"\t-h, -? or --help this usage text\n"
"\t-V or --version prints out version number and exits\n"
"\t-d of --destdir destination directory, followed by the path, defaults to %s\n"
/* "\t-v or --verbose be verbose\n"*/
"\t-q or --quiet do not display warnings\n"
"\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-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",
argv[0], u_getDataDirectory(), u_getDataDirectory(),u_getDataDirectory());
return argc < 0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
}
if(options[VERBOSE].doesOccur) {
/* if(options[VERBOSE].doesOccur) {
verbose = TRUE;
}*/
if(options[QUIET].doesOccur) {
setShowWarning(FALSE);
}
if(options[SOURCEDIR].doesOccur) {