/*
*******************************************************************************
*
- * Copyright (C) 2003-2011, International Business Machines
+ * Copyright (C) 2003-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
UChar src [2] = {0,0};
int32_t srcLen = 0;
+ // data even OK?
+ {
+ UErrorCode dataStatus = U_ZERO_ERROR;
+ loadTestData(dataStatus);
+ if(U_FAILURE(dataStatus)) {
+ errln("Couldn't load test data: %s\n", u_errorName(dataStatus)); // save us from thousands and thousands of errors
+ return;
+ }
+ }
for (int32_t i = 0; i <= 0x10FFFF; i++){
if (quick == TRUE && i > 0x0FFF){
{ 0, 0, 0, 0 } /* data version */
};
+#if !UCONFIG_NO_BREAK_ITERATION
+
// A wrapper for both BytesTrieBuilder and UCharsTrieBuilder.
// may want to put this somewhere in ICU, as it could be useful outside
// of this tool?
return (int32_t)(transformType | transformConstant);
}
};
+#endif
static const UChar LINEFEED_CHARACTER = 0x000A;
static const UChar CARRIAGE_RETURN_CHARACTER = 0x000D;
IcuToolErrorCode status("gendict/main()");
#if UCONFIG_NO_BREAK_ITERATION || UCONFIG_NO_FILE_IO
+ const char* outDir=NULL;
UNewDataMemory *pData;
char msg[1024];
+ UErrorCode tempstatus = U_ZERO_ERROR;
/* write message with just the name */ // potential for a buffer overflow here...
sprintf(msg, "gendict writes dummy %s because of UCONFIG_NO_BREAK_ITERATION and/or UCONFIG_NO_FILE_IO, see uconfig.h", outFileName);
fprintf(stderr, "%s\n", msg);
/* write the dummy data file */
- pData = udata_create(outDir, NULL, outFileName, &dataInfo, NULL, &status);
+ pData = udata_create(outDir, NULL, outFileName, &dataInfo, NULL, &tempstatus);
udata_writeBlock(pData, msg, strlen(msg));
- udata_finish(pData, &status);
- return (int)status;
+ udata_finish(pData, &tempstatus);
+ return (int)tempstatus;
#else
// Read in the dictionary source file