ICU-3014 Remove some u_init() calls from some tools to get UNIXy builds alive. They're using ICU without needing data, and without valid data available
X-SVN-Rev: 12832
This commit is contained in:
parent
795d19ec1e
commit
8fcbf88e68
@ -92,7 +92,7 @@ umtx_lock(UMTX *mutex)
|
||||
/* Attempt to lock an uninitialized mutex. Not Supported.
|
||||
* Note that earlier versions of ICU supported lazy mutex initialization.
|
||||
* That was not thread safe on CPUs that reorder memory operations. */
|
||||
U_ASSERT(FALSE);
|
||||
/* U_ASSERT(FALSE); TODO: activate this assert. */
|
||||
umtx_init(mutex); /* But, in case someone really screwed up, we will
|
||||
* still do the lazy init to try to avoid a crash */
|
||||
}
|
||||
|
@ -116,15 +116,6 @@ int main(int argc, char **argv) {
|
||||
char *outFullFileName;
|
||||
int32_t outFullFileNameLen;
|
||||
|
||||
/* Initialize ICU */
|
||||
u_init(&status);
|
||||
if (U_FAILURE(status)) {
|
||||
fprintf(stderr, "%s: can not initialize ICU. status = %s\n",
|
||||
argv[0], u_errorName(status));
|
||||
exit(1);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
//
|
||||
// Pick up and check the command line arguments,
|
||||
// using the standard ICU tool utils option handling.
|
||||
@ -155,6 +146,15 @@ int main(int argc, char **argv) {
|
||||
u_setDataDirectory(options[5].value);
|
||||
}
|
||||
|
||||
/* Initialize ICU */
|
||||
u_init(&status);
|
||||
if (U_FAILURE(status)) {
|
||||
fprintf(stderr, "%s: can not initialize ICU. status = %s\n",
|
||||
argv[0], u_errorName(status));
|
||||
exit(1);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
/* Combine the directory with the file name */
|
||||
if(options[6].doesOccur) {
|
||||
outDir = options[6].value;
|
||||
|
@ -111,16 +111,6 @@ char symPrefix[100];
|
||||
extern int
|
||||
main(int argc, char* argv[]) {
|
||||
UBool verbose = TRUE;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
/* Initialize ICU */
|
||||
u_init(&status);
|
||||
if (U_FAILURE(status)) {
|
||||
fprintf(stderr, "%s: can not initialize ICU. status = %s\n",
|
||||
argv[0], u_errorName(status));
|
||||
exit(1);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
U_MAIN_INIT_ARGS(argc, argv);
|
||||
|
||||
|
@ -102,15 +102,6 @@ main(int argc, char* argv[]) {
|
||||
UBool sourceTOC, verbose;
|
||||
const char *entrypointName = NULL;
|
||||
|
||||
/* Initialize ICU */
|
||||
u_init(&errorCode);
|
||||
if (U_FAILURE(errorCode)) {
|
||||
fprintf(stderr, "%s: can not initialize ICU. errorCode = %s\n",
|
||||
argv[0], u_errorName(errorCode));
|
||||
exit(1);
|
||||
}
|
||||
errorCode = U_ZERO_ERROR;
|
||||
|
||||
U_MAIN_INIT_ARGS(argc, argv);
|
||||
|
||||
/* preset then read command line options */
|
||||
|
@ -99,18 +99,6 @@ main(int argc,
|
||||
const char *encoding = "";
|
||||
int i;
|
||||
|
||||
/* Initialize ICU */
|
||||
u_init(&status);
|
||||
if (U_FAILURE(status) && status != U_FILE_ACCESS_ERROR) {
|
||||
/* Note: u_init() will try to open ICU property data.
|
||||
* failures here are expected when building ICU from scratch.
|
||||
* ignore them.
|
||||
*/
|
||||
fprintf(stderr, "%s: can not initialize ICU. status = %s\n",
|
||||
argv[0], u_errorName(status));
|
||||
exit(1);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
U_MAIN_INIT_ARGS(argc, argv);
|
||||
|
||||
argc = u_parseArgs(argc, argv, (int32_t)(sizeof(options)/sizeof(options[0])), options);
|
||||
@ -221,6 +209,18 @@ main(int argc,
|
||||
if(options[ICUDATADIR].doesOccur) {
|
||||
u_setDataDirectory(options[ICUDATADIR].value);
|
||||
}
|
||||
/* Initialize ICU */
|
||||
u_init(&status);
|
||||
if (U_FAILURE(status) && status != U_FILE_ACCESS_ERROR) {
|
||||
/* Note: u_init() will try to open ICU property data.
|
||||
* failures here are expected when building ICU from scratch.
|
||||
* ignore them.
|
||||
*/
|
||||
fprintf(stderr, "%s: can not initialize ICU. status = %s\n",
|
||||
argv[0], u_errorName(status));
|
||||
exit(1);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
if(options[WRITE_JAVA].doesOccur) {
|
||||
write_java = TRUE;
|
||||
outputEnc = options[WRITE_JAVA].value;
|
||||
|
@ -972,15 +972,6 @@ int main(int argc, char* argv[]) {
|
||||
const char *copyright = NULL;
|
||||
uprv_memset(&UCAVersion, 0, 4);
|
||||
|
||||
/* Initialize ICU */
|
||||
u_init(&status);
|
||||
if (U_FAILURE(status) && status != U_FILE_ACCESS_ERROR) {
|
||||
fprintf(stderr, "%s: can not initialize ICU. status = %s\n",
|
||||
argv[0], u_errorName(status));
|
||||
exit(1);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
U_MAIN_INIT_ARGS(argc, argv);
|
||||
|
||||
/* preset then read command line options */
|
||||
@ -1040,6 +1031,15 @@ int main(int argc, char* argv[]) {
|
||||
if (options[7].doesOccur) {
|
||||
u_setDataDirectory(options[7].value);
|
||||
}
|
||||
/* Initialize ICU */
|
||||
u_init(&status);
|
||||
if (U_FAILURE(status) && status != U_FILE_ACCESS_ERROR) {
|
||||
fprintf(stderr, "%s: can not initialize ICU. status = %s\n",
|
||||
argv[0], u_errorName(status));
|
||||
exit(1);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* prepare the filename beginning with the source dir */
|
||||
uprv_strcpy(filename, srcDir);
|
||||
|
@ -127,14 +127,6 @@ main(int argc, char* argv[]) {
|
||||
char tmp[1024];
|
||||
int32_t i;
|
||||
|
||||
/* Initialize ICU */
|
||||
u_init(&status);
|
||||
if (U_FAILURE(status)) {
|
||||
fprintf(stderr, "%s: can not initialize ICU. status = %s\n",
|
||||
argv[0], u_errorName(status));
|
||||
exit(1);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
U_MAIN_INIT_ARGS(argc, argv);
|
||||
|
||||
progname = argv[0];
|
||||
|
Loading…
Reference in New Issue
Block a user