diff --git a/icu4c/source/tools/gennorm/gennorm.c b/icu4c/source/tools/gennorm/gennorm.c index 96e69c710b..e4a49689bb 100644 --- a/icu4c/source/tools/gennorm/gennorm.c +++ b/icu4c/source/tools/gennorm/gennorm.c @@ -36,6 +36,10 @@ U_CDECL_BEGIN #include "gennorm.h" U_CDECL_END +#ifdef WIN32 +# pragma warning(disable: 4100) +#endif + UBool beVerbose=FALSE, haveCopyright=TRUE; /* prototypes --------------------------------------------------------------- */ diff --git a/icu4c/source/tools/gennorm/store.c b/icu4c/source/tools/gennorm/store.c index 2b42998b21..f25f7d7192 100644 --- a/icu4c/source/tools/gennorm/store.c +++ b/icu4c/source/tools/gennorm/store.c @@ -28,6 +28,10 @@ #include "unormimp.h" #include "gennorm.h" +#ifdef WIN32 +# pragma warning(disable: 4100) +#endif + #define DO_DEBUG_OUT 0 /* file data ---------------------------------------------------------------- */ @@ -78,12 +82,15 @@ utm_open(const char *name, uint32_t count, uint32_t size) { return mem; } +#if 0 +/* we don't use this - we don't clean up memory here... */ static void utm_close(UToolMemory *mem) { if(mem!=NULL) { uprv_free(mem); } } +#endif static void * utm_getStart(UToolMemory *mem) { @@ -198,7 +205,7 @@ createStage2Block(uint32_t code) { uint16_t *p; p=(uint16_t *)utm_allocN(stage2Mem, _NORM_STAGE_2_BLOCK_COUNT); - stage1[i]=j=p-stage2; + stage1[i]=j=(uint16_t)(p-stage2); } return j; } @@ -208,7 +215,7 @@ createStage2Block(uint32_t code) { * get or create the intermediate trie entries for it as well */ static Norm * -createNorm(code) { +createNorm(uint32_t code) { Norm *p; uint16_t stage2Block, k; @@ -217,7 +224,7 @@ createNorm(code) { if(stage2[k]==0) { /* allocate Norm */ p=(Norm *)utm_alloc(normMem); - stage2[k]=p-norms; + stage2[k]=(uint16_t)(p-norms); } else { p=norms+stage2[k]; } @@ -226,7 +233,7 @@ createNorm(code) { /* get an existing Norm unit */ static Norm * -getNorm(code) { +getNorm(uint32_t code) { uint32_t i; uint16_t j; @@ -268,6 +275,7 @@ enumTrie(EnumTrieFn *fn, void *context) { uint16_t j, k, l; code=0; + count=0; for(i=0; i<_NORM_STAGE_1_MAX_COUNT; ++i) { j=stage1[i]; if(j!=0) { @@ -450,7 +458,7 @@ processCombining() { /* calculate the length of the combining data for this lead code point in the combiningTable */ while(jlenNFD)!=0 && myLenNFD!=0) { /* apply NFD(myC) to norm->nfd */ s32=norm->nfd; - lenNFD=0; for(i=0; ilenNFKD)!=0) { /* apply NFD(myC) and NFKD(myC) to norm->nfkd */ s32=norm->nfkd; - lenNFKD=0; for(i=0; ilenNFD)!=0 && myLenNFKD!=0) { /* apply NFKD(myC) to norm->nfd, forming a new norm->nfkd */ s32=norm->nfd; - lenNFKD=0; for(i=0; i>_NORM_TRIE_SHIFT]=pStage2Block-stage2; + stage1[c>>_NORM_TRIE_SHIFT]=(uint16_t)(pStage2Block-stage2); c+=_NORM_STAGE_2_BLOCK_COUNT; } /* set a partial stage 2 block after the repetition */ i=createStage2Block(c); while(c<=0xd7a3) { - stage2[i++]=norm-norms; + stage2[i++]=(uint16_t)(norm-norms); ++c; } } @@ -873,7 +878,7 @@ reorderString(uint32_t *s, int32_t length) { } } - return ((uint16_t)ccs[0]<<8)|ccs[length-1]; + return (uint16_t)(((uint16_t)ccs[0]<<8)|ccs[length-1]); } static UBool combineAndQC[64]={ 0 }; @@ -1102,7 +1107,7 @@ makeFCD() { map[i>>_NORM_TRIE_SHIFT]=(uint16_t)0; } else { /* keep this block */ - map[i>>_NORM_TRIE_SHIFT]=(uint16_t)(i&~_NORM_STAGE_2_MASK)-delta; + map[i>>_NORM_TRIE_SHIFT]=(uint16_t)((i&~_NORM_STAGE_2_MASK)-delta); oredValues=0; } } @@ -1364,8 +1369,8 @@ generateData(const char *dataDir) { indexes[_NORM_INDEX_COMBINE_DATA_COUNT]=combiningTableTop; indexes[_NORM_INDEX_COMBINE_FWD_COUNT]=combineFwdTop; - indexes[_NORM_INDEX_COMBINE_BOTH_COUNT]=combineBothTop-combineFwdTop; - indexes[_NORM_INDEX_COMBINE_BACK_COUNT]=combineBackTop-combineBothTop; + indexes[_NORM_INDEX_COMBINE_BOTH_COUNT]=(uint16_t)(combineBothTop-combineFwdTop); + indexes[_NORM_INDEX_COMBINE_BACK_COUNT]=(uint16_t)(combineBackTop-combineBothTop); indexes[_NORM_INDEX_FCD_TRIE_INDEX_COUNT]=fcdStage1Top; indexes[_NORM_INDEX_FCD_TRIE_DATA_COUNT]=fcdTableTop;