diff --git a/libs/RVLMiddleware/eZiText/src/clib/Zi8punct.c b/libs/RVLMiddleware/eZiText/src/clib/Zi8punct.c index 50a21fd0..e15cf582 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/Zi8punct.c +++ b/libs/RVLMiddleware/eZiText/src/clib/Zi8punct.c @@ -23,8 +23,8 @@ const ziWChar Zi8PunctTable[40] = { 0xFFE1, 0x20AC, 0x203B, 0xFF20, 0x0000, }; -ziU32 Zi8Punctuation(ziGetParam* param, ziPtr options ZI_NEED_WORK) { - ziS32 limit = ((ZiCandidateOptions*)options)->capacity - 1; +ziU32 Zi8Punctuation(ziGetParam* param, ZiCandidateOptions* options ZI_NEED_WORK) { + ziS32 limit = options->capacity - 1; ziS32 count = 0; ziU8 i = 0; ziU16 fc = param->firstCandidate; @@ -36,11 +36,11 @@ ziU32 Zi8Punctuation(ziGetParam* param, ziPtr options ZI_NEED_WORK) { } if (fc == 0) { count++; - if (((ZiCandidateOptions*)options)->countOnly == 0) { + if (options->countOnly == 0) { param->candidates[i++] = Zi8PunctTable[j]; if ((param->context & 0x10) != 0) { param->candidates[i++] = 0x20; - if ((ziU8)i >= limit) { + if (i >= limit) { break; } } @@ -48,7 +48,7 @@ ziU32 Zi8Punctuation(ziGetParam* param, ziPtr options ZI_NEED_WORK) { break; } } else { - if (count >= (ziS32)((ZiCandidateOptions*)options)->maxCount) { + if (count >= (ziS32)options->maxCount) { return count; } } @@ -57,7 +57,7 @@ ziU32 Zi8Punctuation(ziGetParam* param, ziPtr options ZI_NEED_WORK) { } j++; } - if (((ZiCandidateOptions*)options)->countOnly == 0) { + if (options->countOnly == 0) { param->letters = count; } return count; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zaddress.c b/libs/RVLMiddleware/eZiText/src/clib/zaddress.c index f97c7948..7263f21c 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zaddress.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zaddress.c @@ -10,21 +10,21 @@ ziU8 Zi8LangSupported(ziU8 lang ZI_NEED_WORK) { return 0; } - for (i = 0; ZI_WORK->langEntries[i].language != 0; i++) { + for (i = 0; ZI_WORK->langEntries[i].language != ZI8_LANG_NONE; i++) { if (lang == ZI_WORK->langEntries[i].language) { break; } } - if (ZI_WORK->langEntries[i].language == 0) { - for (i = 0; ZI_WORK->langEntries[i].language != 0; i++) { + if (ZI_WORK->langEntries[i].language == ZI8_LANG_NONE) { + for (i = 0; ZI_WORK->langEntries[i].language != ZI8_LANG_NONE; i++) { if ((ZI_WORK->langEntries[i].tableData != ZI8_NULL) && (lang == ZI_WORK->langEntries[i].tableData[0])) { break; } } } - if (ZI_WORK->langEntries[i].language != 0) { + if (ZI_WORK->langEntries[i].language != ZI8_LANG_NONE) { return i + 1; } else { Zi8ReplaceLastError(0x582, ZI_WORK); @@ -89,19 +89,19 @@ ziU32 Zi8GetTableData(ziU8 lang, ziU8 tableIdx, ziU8 memberId ZI_NEED_WORK) { } ziU32 Zi8GetTableAddress(ziU8 lang, ziU8 tableIdx ZI_NEED_WORK) { - return Zi8GetTableData(lang, tableIdx, 1, ZI_WORK); + return Zi8GetTableData(lang, tableIdx, ziTableAddress, ZI_WORK); } ziU32 Zi8GetTableSize(ziU8 lang, ziU8 tableIdx ZI_NEED_WORK) { - return Zi8GetTableData(lang, tableIdx, 2, ZI_WORK); + return Zi8GetTableData(lang, tableIdx, ziTableSize, ZI_WORK); } ziU16 Zi8GetTableCount(ziU8 lang, ziU8 tableIdx ZI_NEED_WORK) { - return Zi8GetTableData(lang, tableIdx, 2, ZI_WORK); + return Zi8GetTableData(lang, tableIdx, ziTableSize, ZI_WORK); } ziU8 Zi8GetFormatVersion(ziU8 lang ZI_NEED_WORK) { - return Zi8GetTableData(lang, 0, 4, ZI_WORK); + return Zi8GetTableData(lang, 0, ziTableFormatVersion, ZI_WORK); } ziU32 Zi8WCharCount(ziWChar* str ZI_NEED_WORK) { diff --git a/libs/RVLMiddleware/eZiText/src/clib/zconvert.c b/libs/RVLMiddleware/eZiText/src/clib/zconvert.c index bb5fbc4e..e636249b 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zconvert.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zconvert.c @@ -104,7 +104,7 @@ ziChar Zi8ConvertWC2UC(ziWChar character, ziU8 language ZI_NEED_WORK) { } entry = (ziConversionEntry*)((ziU8*)table + value + character - first + 8); Zi8LogError(100, __zi8_work_data); - return *(ziU8*)entry; + return entry->first[0]; } Zi8LogError(0x6C2, __zi8_work_data); return 0; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8alts.c b/libs/RVLMiddleware/eZiText/src/clib/zi8alts.c index 357adcbc..314c7acd 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8alts.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8alts.c @@ -10,7 +10,7 @@ ziU16 Zi8MatchAltSound(ziU8* elements, ziU16 count, ziU8* table, ziU16 ch, ziU16 off; ziU16 w; - hi = (ziU8)((ziU16)ch >> 8); + hi = (ziU8)(ch >> 8); lo = (ziU8)ch; flags = (ziU8)(flags >> 3); if (count == 0) { @@ -28,25 +28,22 @@ ziU16 Zi8MatchAltSound(ziU8* elements, ziU16 count, ziU8* table, ziU16 ch, goto search; up: i = j; -body: - if (((elements + i * 4)[3] & 0xE) == 0 || - ((elements + i * 4)[3] & flags) != 0) { - off = (ziU16)(((ziU16)(elements + i * 4)[2] | - (((ziU16)(elements + i * 4)[3] & 1) << 8)) << 1); - w = (ziU16)((((ziU16)(elements + i * 4)[3] & 0xF0) >> 4) | - (table[off] | ((ziU16)table[off + 1] << 8))); - if (target == (w & (ziU16)mask)) { - return w; + do { + if (((elements + i * 4)[3] & 0xE) == 0 || + ((elements + i * 4)[3] & flags) != 0) { + off = (ziU16)(((ziU16)(elements + i * 4)[2] | + (((ziU16)(elements + i * 4)[3] & 1) << 8)) << 1); + w = (ziU16)((((ziU16)(elements + i * 4)[3] & 0xF0) >> 4) | + (table[off] | ((ziU16)table[off + 1] << 8))); + if (target == (w & (ziU16)mask)) { + return w; + } } - } - i++; - if (i >= count) { - goto down_start; - } - if ((elements + i * 4)[1] == hi && (elements + i * 4)[0] == lo) { - goto body; - } -down_start: + i++; + if (i >= count) { + break; + } + } while ((elements + i * 4)[1] == hi && (elements + i * 4)[0] == lo); i = j; goto dec; down_body: diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8cinfo.c b/libs/RVLMiddleware/eZiText/src/clib/zi8cinfo.c index aae09dbc..36be20fc 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8cinfo.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8cinfo.c @@ -25,7 +25,7 @@ const ziU8 zi8CangjieCodes[32] = { 21, 22, 23, 25, 26, 27, 29, 30, 31 }; -ziU32 Zi8GetCJInfo(ziU8* input, ziWChar* output, ziU8 outputSize, ziPtr work) +ziU32 Zi8GetCJInfo(ziU8* input, ziWChar* output, ziU8 outputSize, ziPtr __zi8_work_data) { ziS32 packedCodes; ziS32 code; @@ -33,13 +33,13 @@ ziU32 Zi8GetCJInfo(ziU8* input, ziWChar* output, ziU8 outputSize, ziPtr work) ziS32 codeCount; ziS32 index; - ((ZiInfoWork*)work)->cangjieEnabled = Zi8GetFormatVersion(1, work) & 2; - if (((ZiInfoWork*)work)->cangjieEnabled == 0) { - Zi8LogError(0x8fc, work); + ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(ZI8_LANG_ZH, __zi8_work_data) & 2; + if (ZI_WORK->cangjieEnabled == 0) { + Zi8LogError(0x8fc, __zi8_work_data); return 0; } if (outputSize < 6) { - Zi8LogError(0x322, work); + Zi8LogError(0x322, __zi8_work_data); return 0; } @@ -57,14 +57,14 @@ ziU32 Zi8GetCJInfo(ziU8* input, ziWChar* output, ziU8 outputSize, ziPtr work) } } if (index >= 0x19) { - Zi8LogError(0x26d, work); + Zi8LogError(0x26d, __zi8_work_data); return 0; } output[outputCount] = index + 0x41; outputCount++; } output[outputCount] = 0; - Zi8LogError(100, work); + Zi8LogError(100, __zi8_work_data); return (ziU8)outputCount; } @@ -858,7 +858,7 @@ ziPtr work) return; } -ziU32 ZiCharInfo2(ziWChar ch, ziWChar* charInfoBuffer, ziU8 maxInfoBufSize, ziU32 hetMode, ziWChar* elements, ziU32 elementCount, ziPtr work) +ziU32 ZiCharInfo2(ziWChar ch, ziWChar* charInfoBuffer, ziU8 maxInfoBufSize, ziU32 hetMode, ziWChar* elements, ziU32 elementCount, ZiInfoWork* work) { union { @@ -892,22 +892,22 @@ ziU32 ZiCharInfo2(ziWChar ch, ziWChar* charInfoBuffer, ziU8 maxInfoBufSize, ziU3 } if (((ziU8)hetMode & 0x80) != 0) { hetMode = (ziU8)(hetMode & 0x7f); - if (Zi8GetFormatVersion(1,work) >= 4) { - charTableCount = Zi8GetTableCount(1,0x19,work); - tablePtr = (ziU8*)Zi8GetTableAddress(1,0x19,work); + if (Zi8GetFormatVersion(ZI8_LANG_ZH,work) >= 4) { + charTableCount = Zi8GetTableCount(ZI8_LANG_ZH,0x19,work); + tablePtr = (ziU8*)Zi8GetTableAddress(ZI8_LANG_ZH,0x19,work); } else { charTableCount = 0; - tablePtr = (ziU8*)0; + tablePtr = ZI8_NULL; } if ((hetMode & 0xff) == 1) { - tableBase = (ziU8*)Zi8GetTableAddress(1,3,work); + tableBase = (ziU8*)Zi8GetTableAddress(ZI8_LANG_ZH,3,work); } else { - tableBase = (ziU8*)Zi8GetTableAddress(1,4,work); + tableBase = (ziU8*)Zi8GetTableAddress(ZI8_LANG_ZH,4,work); } if ((hetMode & 0xff) != 1 && (hetMode & 0xff) != 2) goto lookupCharacter; - if (charTableCount <= Zi8GetTableCount(1,8,work)) { + if (charTableCount <= Zi8GetTableCount(ZI8_LANG_ZH,8,work)) { highByte = (ziU8)((ch >> 8) & 0xff); lowByte = (ziU8)ch; index = 0; @@ -917,10 +917,10 @@ ziU32 ZiCharInfo2(ziWChar ch, ziWChar* charInfoBuffer, ziU8 maxInfoBufSize, ziU3 charIndex = (ziU16)(((ziU32)tablePtr[2] >> 5) & 7) + tableBase[codeOffset] + (ziU16)(((ziU32)tableBase[codeOffset + 1] & 0xffff) << 8); if ((hetMode & 0xff) == 1) { - count = Zi8GetPInfo(charIndex,(ziU16*)charInfoBuffer,maxInfoBufSize,work); + count = Zi8GetPInfo(charIndex,charInfoBuffer,maxInfoBufSize,work); } else { - count = Zi8GetZInfo(charIndex,(ziU16*)charInfoBuffer,maxInfoBufSize,work); + count = Zi8GetZInfo(charIndex,charInfoBuffer,maxInfoBufSize,work); } normalizeStrokes: if ((hetMode & 0xff) == 0x11) { @@ -953,10 +953,10 @@ lookupCharacter: count = 0; } else { - tablePtr = (ziU8*)Zi8GetTableAddress(1,1,work); + tablePtr = (ziU8*)Zi8GetTableAddress(ZI8_LANG_ZH,1,work); tablePtr += ((uniInfoBuffer[9] & 0xf) << 0x10 | (uniInfoBuffer[11] | ((ziU32)uniInfoBuffer[10] << 8))); - ((ZiInfoWork*)work)->cangjieEnabled = Zi8GetFormatVersion(1,work) & 2; - if ((((((ZiInfoWork*)work)->cangjieEnabled != 0) && ((hetMode & 0xff) != 7)) && ((hetMode & 0xff) != 10)) + work->cangjieEnabled = Zi8GetFormatVersion(ZI8_LANG_ZH,work) & 2; + if ((((work->cangjieEnabled != 0) && ((hetMode & 0xff) != 7)) && ((hetMode & 0xff) != 10)) && (((hetMode & 0xff) != 8 && ((hetMode & 0xff) != 9)))) { switch (*tablePtr & 7) { case 2: @@ -974,12 +974,12 @@ lookupCharacter: break; } } - switch((ziU32)hetMode & 0xff) { + switch(hetMode & 0xff) { case 7: case 8: case 9: case 10: - count = (ziU32)Zi8GetCJInfo(tablePtr,charInfoBuffer,maxInfoBufSize,work); + count = Zi8GetCJInfo(tablePtr,charInfoBuffer,maxInfoBufSize,work); if ((((hetMode & 0xff) == 9) || ((hetMode & 0xff) == 10)) && (2 < (count & 0xff))) { charInfoBuffer[1] = charInfoBuffer[(count & 0xff) - 1]; charInfoBuffer[2] = 0; @@ -993,15 +993,15 @@ lookupCharacter: break; case 1: case 3: - tableBase = (ziU8*)Zi8GetTableAddress(1,3,work); + tableBase = (ziU8*)Zi8GetTableAddress(ZI8_LANG_ZH,3,work); charIndex = Zi8GetPCode((ziU32)tableBase,uniInfoBuffer); - count = Zi8GetPInfo(charIndex,(ziU16*)charInfoBuffer,maxInfoBufSize,work); + count = Zi8GetPInfo(charIndex,charInfoBuffer,maxInfoBufSize,work); break; case 2: case 4: - tableBase = (ziU8*)Zi8GetTableAddress(1,4,work); + tableBase = (ziU8*)Zi8GetTableAddress(ZI8_LANG_ZH,4,work); charIndex = Zi8GetPCode((ziU32)tableBase,uniInfoBuffer); - count = Zi8GetZInfo(charIndex,(ziU16*)charInfoBuffer,maxInfoBufSize,work); + count = Zi8GetZInfo(charIndex,charInfoBuffer,maxInfoBufSize,work); break; default: count = 0; @@ -1009,8 +1009,8 @@ lookupCharacter: } if ((((elementCount & 0xff) != 0) && ((uniInfoBuffer[0] & 0x80) != 0)) && (((hetMode & 0xff) == 3 || ((hetMode & 0xff) == 4)))) { - alternateTable = (ziU8 *)Zi8GetTableAddress(1,5,work); - alternatesRemaining = Zi8GetTableCount(1,5,work); + alternateTable = (ziU8 *)Zi8GetTableAddress(ZI8_LANG_ZH,5,work); + alternatesRemaining = Zi8GetTableCount(ZI8_LANG_ZH,5,work); while (alternatesRemaining != 0) { if (codeOffset == (((ziU16)alternateTable[1] << 8) | (ziU16)alternateTable[0])) break; alternatesRemaining--; @@ -1042,10 +1042,10 @@ lookupCharacter: alternatesRemaining--; alternateTable = alternateTable + 4; if ((hetMode & 0xff) == 3) { - count = Zi8GetPInfo(charIndex,(ziU16*)charInfoBuffer,maxInfoBufSize,work); + count = Zi8GetPInfo(charIndex,charInfoBuffer,maxInfoBufSize,work); } else { - count = Zi8GetZInfo(charIndex,(ziU16*)charInfoBuffer,maxInfoBufSize,work); + count = Zi8GetZInfo(charIndex,charInfoBuffer,maxInfoBufSize,work); } goto checkElements; } diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c b/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c index 0eefea20..b92a0bed 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c @@ -117,7 +117,7 @@ check_keys: records[context->cnt].key = 0; } if (prefixLength != 0 && *prefixLength < context->cnt && - ZiDAWGgetEOWattribute(current->node) != 0) { + ZiDAWGgetEOWattribute(current->node)) { *prefixLength = context->cnt; for (index = 0; index < context->cnt; index++) output[index] = (ziU16)records[index].attr; } @@ -125,7 +125,7 @@ check_keys: } if (context->cnt < search[1]) goto descend; if (search[0] != 0 && context->cnt > search[1]) goto next_sibling; - if (acceptPrefix != 0 || ZiDAWGgetEOWattribute(current->node) != 0) { + if (acceptPrefix != 0 || ZiDAWGgetEOWattribute(current->node)) { for (index = 0; index < context->cnt; index++) output[index] = (ziU16)records[index].attr; result = context->cnt; searching = 0; @@ -232,7 +232,7 @@ unsigned int Zi8MatchROMdata2(ziWChar* elements, ziU8 count, ziU8 language, if (status == 0) { ZI_WORK->dawgGroupIndex = 0; ZI_WORK->matchOffset = 0; - if (group != 0 && *group == 0xc && language == 10 && ZI_WORK->forceAltGraph != 0) { + if (group != 0 && *group == 0xc && language == ZI8_LANG_FI && ZI_WORK->forceAltGraph != 0) { ZI_WORK->graphTableId = 0x10; } else { ZI_WORK->graphTableId = 0; @@ -275,7 +275,7 @@ search_segment: ZI_WORK->dawgGroupIndex++; status = 0; ZI_WORK->graphTableId = 0; - if (ZI_WORK->dawgCtx.key == 0 && language == 10) { + if (ZI_WORK->dawgCtx.key == 0 && language == ZI8_LANG_FI) { for (index = 0; index < ZI_WORK->matchOffset; index++) { switch (ZI_WORK->dawgWord[index]) { case 0x61: @@ -323,7 +323,7 @@ ziU32 Zi8MatchROMdata(ziWChar* elements, ziU8 count, ziU8 language, acceptPrefix, ZI_WORK); if ((ziU8)result != 0) break; status = 0; - if (count <= 1 && language == 0x36) break; + if (count <= 1 && language == ZI8_LANG_SW) break; ZI_WORK->dawgGroup = NextDawgGroup(ZI_WORK->dawgGroup, language, ZI_WORK); } } @@ -380,7 +380,7 @@ void Zi8SyllablesROMdata(ziWChar *elements, ziU8 count, ziU8 language, ziWChar * keyTable = 0x1b; } } - Zi8MatchROMdata0(elements,count,language & 0xff,output,capacity,1,status,graphTable,keyTable,0,(ziU8 *)prefixLength, + Zi8MatchROMdata0(elements,count,language & 0xff,output,capacity,1,status,graphTable,keyTable,0,prefixLength, &ZI_WORK->dawgCtx,ZI_WORK->dawgSearchState,ZI_WORK); return; } diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8getSW.c b/libs/RVLMiddleware/eZiText/src/clib/zi8getSW.c index 5e082924..36a21679 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8getSW.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8getSW.c @@ -62,7 +62,7 @@ ziU32 Zi8GetSyllablesCandidates(ziGetParam* param, ziSwParam* sw ZI_NEED_WORK) { out = buf; rem = 0x40; } else { - out = (ziWChar*)param->candidates; + out = param->candidates; rem = sw->capacity - 1; } if ((param->getOptions & 0xFD) == 0x80) { diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c index 9d3823d9..6fa8e56e 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c @@ -66,8 +66,8 @@ ziU16 Zi8GetGlobalDataSize(void) { static ziU16 Zi8GetDataSignature(ziU8* destination, ziU16 capacity, ziU8 language, ziPtr work) { ziU8* signature; ziU16 length; - if (language == 1) { - if (Zi8GetFormatVersion(1, work) < 8) { + if (language == ZI8_LANG_ZH) { + if (Zi8GetFormatVersion(ZI8_LANG_ZH, work) < 8) { Zi8LogError(0x26f, work); return 0; } @@ -324,11 +324,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option saved.savedCandidates = 0; saved.restoreCandidates = 0; if (options->lookupMode == '\0') { - if (((ZI_WORK->getcPhase == '\t') && (parameters->elementCount != 0)) && - (((parameters->elements[parameters->elementCount - 1] == 0xEFF8 && - ((ziU8)Zi8AlphaSignature(parameters,options->countOnly,ZI_WORK) != 0)) || - ((parameters->elements[parameters->elementCount - 1] == 0xEF04 && - ((ziU8)Zi8ZhSignature(parameters,options->countOnly,ZI_WORK) != 0)))))) { + if (ZI_WORK->getcPhase == '\t' && parameters->elementCount != 0 && + ((parameters->elements[parameters->elementCount - 1] == 0xEFF8 && + Zi8AlphaSignature(parameters,options->countOnly,ZI_WORK)) || + (parameters->elements[parameters->elementCount - 1] == 0xEF04 && + Zi8ZhSignature(parameters,options->countOnly,ZI_WORK)))) { candidateCount = (unsigned int)parameters->letters; if (options->countOnly != '\0') { parameters->letters = 0; @@ -338,7 +338,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option } if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) { switch (parameters->language) { - case 1: + case ZI8_LANG_ZH: if ((ZI_WORK->getcPhase == '\0') || (ZI_WORK->countOnly == options->countOnly)) { switch(ZI_WORK->getcPhase) { case '\0': @@ -371,7 +371,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option case '\b': case '\t': if ((parameters->elements[0] == 0xEF04) && - ((ziU8)Zi8ZhSignature(parameters,options->countOnly,ZI_WORK) != 0)) { + Zi8ZhSignature(parameters,options->countOnly,ZI_WORK)) { ZI_WORK->getcPhase = '\t'; candidateCount = (unsigned int)parameters->letters; if (options->countOnly != '\0') { @@ -388,15 +388,15 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option } } break; - case 0x10: - case 0x12: - case 0x77: - case 0x78: - case 0x79: - case 0x7A: - case 0x7B: - case 0x7C: - case 0x7D: + case ZI8_LANG_JP: + case ZI8_LANG_KO: + case ZI8_LANG_PYP: + case ZI8_LANG_PYS: + case ZI8_LANG_ZYP: + case ZI8_LANG_ZYS: + case ZI8_LANG_SP2: + case ZI8_LANG_PY2: + case ZI8_LANG_ZY2: break; case 0x11: default: @@ -467,7 +467,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option case '\b': case '\t': if ((parameters->elements[0] == 0xEFF8) && - ((ziU8)Zi8AlphaSignature(parameters,options->countOnly,ZI_WORK) != 0)) { + Zi8AlphaSignature(parameters,options->countOnly,ZI_WORK)) { ZI_WORK->getcPhase = '\t'; candidateCount = (unsigned int)parameters->letters; if (options->countOnly != '\0') { @@ -491,20 +491,20 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option } } ZI_WORK->subLanguage = parameters->subLanguage; - ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1,ZI_WORK) & 2; + ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(ZI8_LANG_ZH,ZI_WORK) & 2; options->maxCount = ZI_WORK->maxCandidateCount; options->maxWordLength = ZI_WORK->maxWordLength; ZI_WORK->maxWordLength = -1; - if ((ziU8)Zi8LangSupported(parameters->language,ZI_WORK) == 0) { + if (Zi8LangSupported(parameters->language,ZI_WORK) == 0) { Zi8LogError(0x163,ZI_WORK); return 0; } else { - if (parameters->language == 0x10) { + if (parameters->language == ZI8_LANG_JP) { error = 0x2c1; candidateCount = 0; } - else if (parameters->language == 0x12) { + else if (parameters->language == ZI8_LANG_KO) { if ((parameters->elementCount == 0) || (parameters->elements[0] >= 0xeff1)) { candidateCount = Zi8GetKOcandidates(parameters,options,ZI_WORK); } @@ -512,13 +512,13 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option candidateCount = Zi8GetKoreanCandidates(parameters,options,ZI_WORK); } } - else if ((parameters->language == 1) && ((parameters->context & 8) != 0)) { + else if ((parameters->language == ZI8_LANG_ZH) && ((parameters->context & 8) != 0)) { candidateCount = Zi8Punctuation(parameters,options,ZI_WORK); error = 100; } - else if ((parameters->language == 1) && - ((((parameters->getOptions & 0xbf) == 4 && (parameters->elementCount != 0)) && - ((ziU8)Zi8IsCharacter(parameters->elements[0],ZI_WORK) != 0)))) { + else if ((parameters->language == ZI8_LANG_ZH) && + ((parameters->getOptions & 0xbf) == 4 && parameters->elementCount != 0 && + Zi8IsCharacter(parameters->elements[0],ZI_WORK))) { saved.convertedElementCount = Zi8GetCharInfo(parameters->elements[0],characterInfo,0x10,1,ZI_WORK); if (saved.convertedElementCount == 0) { parameters->letters = parameters->completion = parameters->count = 0; @@ -543,11 +543,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option parameters->completion = 1; } } - else if ((parameters->language == 1) && (parameters->getMode == 0xf)) { + else if ((parameters->language == ZI8_LANG_ZH) && (parameters->getMode == 0xf)) { error = 0x2d0; candidateCount = 0; } - else if ((parameters->language == 1) && ((parameters->getMode == 3 || (parameters->getMode == 4)))) { + else if ((parameters->language == ZI8_LANG_ZH) && ((parameters->getMode == 3 || (parameters->getMode == 4)))) { if ((parameters->getOptions & 0x80) != 0) { candidateCount = Zi8Get1KeyPressSpelling(parameters,options,ZI_WORK); } else if (parameters->elementCount == 0) { @@ -556,7 +556,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option candidateCount = Zi8Get1KeyPressCandidates(parameters,options,ZI_WORK); } } - else if ((parameters->language == 1) && + else if ((parameters->language == ZI8_LANG_ZH) && ((((parameters->getMode == 7 || (parameters->getMode == 8)) || (parameters->getMode == 10)) || (parameters->getMode == 9)))) { if (ZI_WORK->cangjieEnabled != '\0') { candidateCount = Zi8GetChineseCandidates(parameters,options,ZI_WORK); @@ -565,11 +565,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option candidateCount = 0; } } - else if ((parameters->language == 1) && ((parameters->getMode == 0xb || (parameters->getMode == 0xe)))) { + else if ((parameters->language == ZI8_LANG_ZH) && ((parameters->getMode == 0xb || (parameters->getMode == 0xe)))) { error = 0x2ee; candidateCount = 0; } - else if (parameters->language == 1) { + else if (parameters->language == ZI8_LANG_ZH) { candidateCount = Zi8GetChineseCandidates(parameters,options,ZI_WORK); if ((((candidateCount == 0) && ((parameters->getOptions & 0x20) == 0)) && ((parameters->getMode == 1 && (parameters->elementCount != 0)))) && (((parameters->elements[parameters->elementCount - 1] == 0xF37A || diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c b/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c index 287b3d56..c319b1d7 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c @@ -37,18 +37,18 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) { Zi8LogError(0x578, ZI_WORK); return 0; } - if (ZI_WORK->langEntries->language == 0) { + if (ZI_WORK->langEntries->language == ZI8_LANG_NONE) { Zi8LogError(0x582, ZI_WORK); return 0; } ZI_WORK->letterHyphen = 0x2D; - ZI_WORK->language = 0; + ZI_WORK->language = ZI8_LANG_NONE; ZI_WORK->searchModes[3] = 0; ZI_WORK->capacity = 0x100; Zi8SetLatinSearchOrder(0, 0, ZI_WORK); ZADP_Zi8SetPDremoveOpt(1, ZI_WORK); ZI_WORK->zhPudMinPrefix = 5; - ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1, ZI_WORK) & 2; + ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(ZI8_LANG_ZH, ZI_WORK) & 2; ZI_WORK->pyFuzzy.bits.msb = 1; ZI_WORK->zyFuzzy.bits.msb = 1; zyFuzzy = ZI_WORK->zyFuzzy.word; @@ -63,11 +63,11 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) { } ziU8 Zi8IsZicorpSignature(ziU16* p, ziU16 len ZI_NEED_WORK) { - if ((ziU16)len > 6 && p[0] == 0x7A && p[1] == 0x69 && p[2] == 0x63 && + if (len > 6 && p[0] == 0x7A && p[1] == 0x69 && p[2] == 0x63 && p[3] == 0x6F && p[4] == 0x72 && p[5] == 0x70) { return 1; } - if ((ziU16)len > 6 && p[0] == 0x39 && p[1] == 0x34 && p[2] == 0x32 && + if (len > 6 && p[0] == 0x39 && p[1] == 0x34 && p[2] == 0x32 && p[3] == 0x36 && p[4] == 0x37 && p[5] == 0x37) { return 1; } diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8is.c b/libs/RVLMiddleware/eZiText/src/clib/zi8is.c index e18a95a2..6776324c 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8is.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8is.c @@ -7,7 +7,7 @@ extern ziU32 Zi8GetTableAddress(ziU8 lang, ziU8 tableIdx ZI_NEED_WORK); extern ziU8 _Zi8GetCandidates(ziGetParam* getParam ZI_NEED_WORK); extern void Zi8Memset(ziPtr p, ziU32 v, ziU32 len); -ziU8 Zi8GetZHCharSet(ziPtr workData) { +ziU8 Zi8GetZHCharSet(ziPtr __zi8_work_data) { ziU8 charSet = 0; ziU8 bak; ziU16 v0; @@ -18,23 +18,23 @@ ziU8 Zi8GetZHCharSet(ziPtr workData) { ziWChar candBuf[0x10]; ziGetParam getParam; - Zi8LogError(0x64, workData); - if (Zi8LangSupported(1, workData) == 0) { - Zi8ReplaceLastError(0x26C, workData); + Zi8LogError(0x64, __zi8_work_data); + if (Zi8LangSupported(ZI8_LANG_ZH, __zi8_work_data) == 0) { + Zi8ReplaceLastError(0x26C, __zi8_work_data); return 0; } - if (Zi8GetTableCount(1, 10, workData) != 0) { - bak = ((struct __zi8_work_data_s*)workData)->subLanguage; - ((struct __zi8_work_data_s*)workData)->subLanguage = 1; - addr = Zi8GetTableAddress(1, 10, workData); + if (Zi8GetTableCount(ZI8_LANG_ZH, 10, __zi8_work_data) != 0) { + bak = ZI_WORK->subLanguage; + ZI_WORK->subLanguage = 1; + addr = Zi8GetTableAddress(ZI8_LANG_ZH, 10, __zi8_work_data); p = (ziU8*)addr; v0 = (ziU16)((ziU16)p[0] | ((ziU16)p[1] << 8)); - ((struct __zi8_work_data_s*)workData)->subLanguage = 0; - addr = Zi8GetTableAddress(1, 10, workData); + ZI_WORK->subLanguage = 0; + addr = Zi8GetTableAddress(ZI8_LANG_ZH, 10, __zi8_work_data); p = (ziU8*)addr; v1 = (ziU16)((ziU16)p[2] | ((ziU16)p[3] << 8)); v2 = (ziU16)((ziU16)p[4] | ((ziU16)p[5] << 8)); - ((struct __zi8_work_data_s*)workData)->subLanguage = bak; + ZI_WORK->subLanguage = bak; if (v0 != 0) { if (v0 > 0x4E20) { charSet |= 8; @@ -56,7 +56,7 @@ ziU8 Zi8GetZHCharSet(ziPtr workData) { } Zi8Memset(&getParam, 0, 0x2C); - getParam.language = 1; + getParam.language = ZI8_LANG_ZH; getParam.context = 1; getParam.getOptions = 0; getParam.candidates = candBuf; @@ -64,17 +64,17 @@ ziU8 Zi8GetZHCharSet(ziPtr workData) { getParam.subLanguage = 1; retry: getParam.getMode = 0; - if (_Zi8GetCandidates(&getParam, workData) != 0) { + if (_Zi8GetCandidates(&getParam, __zi8_work_data) != 0) { charSet |= getParam.subLanguage; goto next; } getParam.getMode = 1; - if (_Zi8GetCandidates(&getParam, workData) != 0) { + if (_Zi8GetCandidates(&getParam, __zi8_work_data) != 0) { charSet |= getParam.subLanguage; goto next; } getParam.getMode = 2; - if (_Zi8GetCandidates(&getParam, workData) != 0) { + if (_Zi8GetCandidates(&getParam, __zi8_work_data) != 0) { charSet |= getParam.subLanguage; } next: @@ -123,10 +123,10 @@ ziBool Zi8IsCharacter(ziWChar ch ZI_NEED_WORK) { case 0xFF1F: return 1; } - hi = (ziU8)(((ziU16)ch >> 8) & 0xFF); + hi = (ziU8)((ch >> 8) & 0xFF); lo = (ziU8)ch; - count = Zi8GetTableCount(1, 0, ZI_WORK); - addr = Zi8GetTableAddress(1, 0, ZI_WORK); + count = Zi8GetTableCount(ZI8_LANG_ZH, 0, ZI_WORK); + addr = Zi8GetTableAddress(ZI8_LANG_ZH, 0, ZI_WORK); table = (ziU8*)addr; for (i = 0; i < count; i++) { if (table[6] == hi && table[7] == lo) { diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8match.c b/libs/RVLMiddleware/eZiText/src/clib/zi8match.c index a1147e4a..68177367 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8match.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8match.c @@ -108,7 +108,7 @@ ziBool Zi8ExactMatchNextChar(ziU8* node, ziU8 firstByteMask, ziU8 firstByteValue return 0; } -ziU32 Zi8SecMatchChar(ziPtr nodeAddress, ziU8* dictionaryAddress, ziMatchParam* match, ziU16* code ZI_NEED_WORK) { +ziU32 Zi8SecMatchChar(ziU8* nodeAddress, ziU8* dictionaryAddress, ziMatchParam* match, ziU16* code ZI_NEED_WORK) { ziBool isPartial = 0; ziU16 matchCode; ziU8* data; @@ -121,7 +121,7 @@ ziU32 Zi8SecMatchChar(ziPtr nodeAddress, ziU8* dictionaryAddress, ziMatchParam* if (match->componentIndex != 0) { state.targetCode = match->componentIndex; - matchCode = ((ziU16)(((ziU8*)nodeAddress)[4] & 3) << 8) | ((ziU8*)nodeAddress)[5]; + matchCode = ((ziU16)(nodeAddress[4] & 3) << 8) | nodeAddress[5]; value = 0; while (value++ < 6) { if (state.targetCode == matchCode) { @@ -137,8 +137,8 @@ ziU32 Zi8SecMatchChar(ziPtr nodeAddress, ziU8* dictionaryAddress, ziMatchParam* } } - data = (ziU8*)Zi8GetTableAddress(1, 1, ZI_WORK); - data += ((ziU8*)nodeAddress)[0xB] + (((ziU8*)nodeAddress)[0xA] << 8) + ((((ziU8*)nodeAddress)[9] & 0xF) << 16); + data = (ziU8*)Zi8GetTableAddress(ZI8_LANG_ZH, 1, ZI_WORK); + data += nodeAddress[0xB] + (nodeAddress[0xA] << 8) + ((nodeAddress[9] & 0xF) << 16); if (ZI_WORK->cangjieEnabled != 0) { switch (data[0] & 7) { case 2: @@ -168,27 +168,27 @@ ziU32 Zi8SecMatchChar(ziPtr nodeAddress, ziU8* dictionaryAddress, ziMatchParam* isPartial = 1; } } else if ((match->length & 1) != 0) { - if ((((ziU8*)nodeAddress)[match->length >> 1] & 0xF) == 0xF) { + if ((nodeAddress[match->length >> 1] & 0xF) == 0xF) { isPartial = 1; } } else { - if ((((ziU8*)nodeAddress)[match->length >> 1] & 0xF0) == 0xF0) { + if ((nodeAddress[match->length >> 1] & 0xF0) == 0xF0) { isPartial = 1; } } if (match->length > 2) { if ((match->length & 1) != 0) { - if (((((ziU8*)nodeAddress)[(match->length - 1) >> 1] & 0xF0) == 0) || ((((ziU8*)nodeAddress)[(match->length - 1) >> 1] & 0xF0) == 0xF0)) { + if (((nodeAddress[(match->length - 1) >> 1] & 0xF0) == 0) || ((nodeAddress[(match->length - 1) >> 1] & 0xF0) == 0xF0)) { return 0; } } else { - if (((((ziU8*)nodeAddress)[(match->length - 1) >> 1] & 0xF) == 0) || ((((ziU8*)nodeAddress)[(match->length - 1) >> 1] & 0xF) == 0xF)) { + if (((nodeAddress[(match->length - 1) >> 1] & 0xF) == 0) || ((nodeAddress[(match->length - 1) >> 1] & 0xF) == 0xF)) { return 0; } } } if (code != 0) { - *code = ((ziU16)((ziU8*)nodeAddress)[6] << 8) + (ziU16)((ziU8*)nodeAddress)[7]; + *code = ((ziU16)nodeAddress[6] << 8) + (ziU16)nodeAddress[7]; } if (isPartial) { return 2; @@ -208,7 +208,7 @@ ziU32 Zi8SecMatchChar(ziPtr nodeAddress, ziU8* dictionaryAddress, ziMatchParam* state.dataIndex = 4; state.remaining = ((match->length + 1) >> 1) - 4; - if (((ziU8)value + 1) < (int)state.remaining) { + if ((value + 1) < state.remaining) { return 0; } if ((match->length & 1) != 0) { @@ -231,7 +231,7 @@ ziU32 Zi8SecMatchChar(ziPtr nodeAddress, ziU8* dictionaryAddress, ziMatchParam* } } if (code != 0) { - *code = ((ziU16)((ziU8*)nodeAddress)[6] << 8) + (ziU16)((ziU8*)nodeAddress)[7]; + *code = ((ziU16)nodeAddress[6] << 8) + (ziU16)nodeAddress[7]; } if (isPartial) { return 2; @@ -254,20 +254,20 @@ ziBool Zi8PriMatchNextComp(ziU8* node, ziU8 firstByteMask, ziU8 firstByteValue, return 0; } -ziBool Zi8SecMatchComp(ziPtr nodeAddress, ziMatchParam* matchAddress, ziPtr dictionaryAddress ZI_NEED_WORK) { +ziBool Zi8SecMatchComp(ziU8* nodeAddress, ziMatchParam* matchAddress, ziU8* dictionaryAddress ZI_NEED_WORK) { int chainIndex; ziU16 matchCode; ziU16 targetCode; if (matchAddress->componentIndex != 0) { targetCode = matchAddress->componentIndex; - matchCode = ((ziU16)(((ziU8*)nodeAddress)[6] & 3) << 8) | ((ziU8*)nodeAddress)[7]; + matchCode = ((ziU16)(nodeAddress[6] & 3) << 8) | nodeAddress[7]; chainIndex = 0; while (chainIndex++ < 6) { if (targetCode == matchCode) { break; } - matchCode = ((ziU16)(*((ziU8*)dictionaryAddress + matchCode * 8 + 6) & 3) << 8) | *((ziU8*)dictionaryAddress + matchCode * 8 + 7); + matchCode = ((ziU16)(*(dictionaryAddress + matchCode * 8 + 6) & 3) << 8) | *(dictionaryAddress + matchCode * 8 + 7); if (matchCode == 0) { break; } @@ -277,10 +277,10 @@ ziBool Zi8SecMatchComp(ziPtr nodeAddress, ziMatchParam* matchAddress, ziPtr dict } } if (matchAddress->length > 8) { - if ((int)((ziU8*)nodeAddress)[5] < (int)(matchAddress->length - 2)) { + if (nodeAddress[5] < (matchAddress->length - 2)) { return 0; } - } else if ((int)((ziU8*)nodeAddress)[5] < (int)(matchAddress->length - 1)) { + } else if (nodeAddress[5] < (matchAddress->length - 1)) { return 0; } return 1; @@ -289,7 +289,7 @@ ziBool Zi8SecMatchComp(ziPtr nodeAddress, ziMatchParam* matchAddress, ziPtr dict extern ziU16 Zi8MatchAltSound(ziPtr soundTable, ziU16 soundCode, ziPtr pCodeTable, ziU16 index, ziU16 mask, ziU16 value, ziU8 flag ZI_NEED_WORK); ziU16 Zi8GetPCode(ziU8* table, ziU8* node); -ziBool Zi8MatchPhonetic(ziPtr pCodeTable, ziU8* dictionary, ziPtr soundTable, ziU16 soundCode, ziU32 tableAddress, ziU8* node, ziU16* masks, ziU16* values, ziU16* count, ziU8** resultNode, ziU8** stringOffset, ziU8 partialMode, ziU8 strictMode, ziU8 numParts, ziU16 partMask, ziU16 partValue, ziU8 flag, ziU8 altMode, ziU16 initialCode, ziU16* resultCode, ziU8 lastMode ZI_NEED_WORK) { +ziBool Zi8MatchPhonetic(ziU8* pCodeTable, ziU8* dictionary, ziPtr soundTable, ziU16 soundCode, ziU32 tableAddress, ziU8* node, ziU16* masks, ziU16* values, ziU16* count, ziU8** resultNode, ziU8** stringOffset, ziU8 partialMode, ziU8 strictMode, ziU8 numParts, ziU16 partMask, ziU16 partValue, ziU8 flag, ziU8 altMode, ziU16 initialCode, ziU16* resultCode, ziU8 lastMode ZI_NEED_WORK) { struct { ziBool hasString; ziU8 partIndex; @@ -327,7 +327,7 @@ next_node: node += 0xC; continue; decode_node: - traversal.code = Zi8GetPCode((ziU8*)pCodeTable, node); + traversal.code = Zi8GetPCode(pCodeTable, node); if ((*values != (traversal.code & *masks)) && (altMode == 0) && ((node[0] & 0x80) != 0)) { if (*count != 0) { traversal.soundIndex = (initialCode - traversal.remaining) - 1; @@ -399,7 +399,7 @@ next_group: if (traversal.hasString) { goto phonetic_skip; } - traversal.code = Zi8GetPCode((ziU8*)pCodeTable, dictionary + (traversal.dictionaryIndex & 0x7FFF) * sizeof(DictionaryNode)); + traversal.code = Zi8GetPCode(pCodeTable, dictionary + (traversal.dictionaryIndex & 0x7FFF) * sizeof(DictionaryNode)); if (((traversal.code & masks[traversal.partIndex]) != values[traversal.partIndex]) && (altMode == 0) && (dictionary[(traversal.dictionaryIndex & 0x7FFF) * sizeof(DictionaryNode)] & 0x80) != 0) { traversal.code = Zi8MatchAltSound(soundTable, soundCode, pCodeTable, traversal.dictionaryIndex & 0x7FFF, masks[traversal.partIndex], values[traversal.partIndex], flag, ZI_WORK); } @@ -575,7 +575,7 @@ scan_final: value -= 0x61; } pinyin[index] = (ziU8)value + 1; - if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) == 0) goto try_final_extension; + if (!Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal)) goto try_final_extension; if (outputIndex == 0) { *resultCount += 1; } @@ -590,7 +590,7 @@ try_final_extension: if (index < 3) { pinyin[index + 1] = 0xFF; - if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) { + if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal)) { if (outputIndex == 0) { *resultCount += 1; } @@ -624,7 +624,7 @@ finish_final: partial = 1; } if (partial && alternateInitial == 0) { - if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) { + if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal)) { if (convertedCount == 0) { result++; initial[outputIndex] = 0x7E00; @@ -641,7 +641,7 @@ finish_final: } } else { pinyin[index] = 0xFF; - if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) { + if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal)) { if (convertedCount == 0) { result++; initial[outputIndex] = 0x7E00; @@ -653,7 +653,7 @@ finish_final: *bestFinal = final[0]; if ((outputIndex == 0) && (count == 0)) { pinyin[index] = 0; - if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) { + if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal)) { if (convertedCount == 0) { *bestInitial = 0x7E00; *bestFinal = 0x200; @@ -664,7 +664,7 @@ finish_final: } } else { pinyin[index] = 0; - if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) { + if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal)) { if (convertedCount == 0) { result++; initial[outputIndex] = 0x7E00; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c b/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c index 24994126..3a6ed87b 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c @@ -6,8 +6,6 @@ extern ziU32 Zi8GetTableAddress(ziU8 lang, ziU8 tableIdx ZI_NEED_WORK); typedef struct { ziU8 b[0xC]; } ziE12; -#define WORKP ((struct __zi8_work_data_s*)__zi8_work_data) - ziU16 Zi8Uni2Ptr(ziU16 ch, ziE12* buf ZI_NEED_WORK) { ziU8 hi; ziU8 lo; @@ -18,15 +16,15 @@ ziU16 Zi8Uni2Ptr(ziU16 ch, ziE12* buf ZI_NEED_WORK) { ziU8* e; ziU8* p; - hi = (ziU8)(((ziU16)ch >> 8) & 0xFF); + hi = (ziU8)((ch >> 8) & 0xFF); lo = (ziU8)ch; - count = Zi8GetTableCount(1, 0, __zi8_work_data); - table = Zi8GetTableAddress(1, 0, __zi8_work_data); - table2 = Zi8GetTableAddress(1, 1, __zi8_work_data); + count = Zi8GetTableCount(ZI8_LANG_ZH, 0, __zi8_work_data); + table = Zi8GetTableAddress(ZI8_LANG_ZH, 0, __zi8_work_data); + table2 = Zi8GetTableAddress(ZI8_LANG_ZH, 1, __zi8_work_data); if (buf == ZI8_NULL) { for (i = 0; i < 0x40; i++) { - if (ch == WORKP->duplicateCharacters[i]) { - i = WORKP->duplicateOrdinalCache[i]; + if (ch == ZI_WORK->duplicateCharacters[i]) { + i = ZI_WORK->duplicateOrdinalCache[i]; e = (ziU8*)table + i * 0xC; if (i >= count) { break; @@ -37,7 +35,7 @@ ziU16 Zi8Uni2Ptr(ziU16 ch, ziE12* buf ZI_NEED_WORK) { p = (ziU8*)(table2 + (((e[9] & 0xF) << 16) | (e[0xB] | (e[0xA] << 8)))); - if (WORKP->cangjieEnabled != 0) { + if (ZI_WORK->cangjieEnabled != 0) { switch (p[0] & 7) { case 2: p += 2; @@ -65,19 +63,19 @@ ziU16 Zi8Uni2Ptr(ziU16 ch, ziE12* buf ZI_NEED_WORK) { } } e = (ziU8*)table; - if (WORKP->unicodeMap != ZI8_NULL && WORKP->unicodeMapSubLang == WORKP->subLanguage) { - if ((ziU16)ch >= WORKP->unicodeRange1Min && (ziU16)ch <= WORKP->unicodeRange1Max) { - i = (ziU16)(ch - WORKP->unicodeRange1Min); + if (ZI_WORK->unicodeMap != ZI8_NULL && ZI_WORK->unicodeMapSubLang == ZI_WORK->subLanguage) { + if (ch >= ZI_WORK->unicodeRange1Min && ch <= ZI_WORK->unicodeRange1Max) { + i = (ziU16)(ch - ZI_WORK->unicodeRange1Min); goto map; } - if ((ziU16)ch >= WORKP->unicodeRange2Min && (ziU16)ch <= WORKP->unicodeRange2Max) { - i = (ziU16)(WORKP->unicodeRange1Max + (ch - WORKP->unicodeRange2Min) - - WORKP->unicodeRange1Min + 1); + if (ch >= ZI_WORK->unicodeRange2Min && ch <= ZI_WORK->unicodeRange2Max) { + i = (ziU16)(ZI_WORK->unicodeRange1Max + (ch - ZI_WORK->unicodeRange2Min) - + ZI_WORK->unicodeRange1Min + 1); goto map; } return 0xFFFF; map: - i = WORKP->unicodeMap[i]; + i = ZI_WORK->unicodeMap[i]; if (i != 0xFFFF) { e = (ziU8*)table + i * 0xC; if (hi == e[6] && lo == e[7]) { @@ -110,11 +108,11 @@ ziU16 Zi8Uni2Ord(ziU16 ch ZI_NEED_WORK) { ziU16 Zi8Ord2Uni(ziU16 ord ZI_NEED_WORK) { ziU8* p; - if ((ziU16)ord >= Zi8GetTableCount(1, 0, __zi8_work_data)) { + if (ord >= Zi8GetTableCount(ZI8_LANG_ZH, 0, __zi8_work_data)) { Zi8LogError(0x132, __zi8_work_data); return 0; } - p = (ziU8*)Zi8GetTableAddress(1, 0, __zi8_work_data); + p = (ziU8*)Zi8GetTableAddress(ZI8_LANG_ZH, 0, __zi8_work_data); p += ord * 0xC; Zi8LogError(0x64, __zi8_work_data); return (ziU16)(((ziU16)p[6] << 8) + p[7]); @@ -125,9 +123,9 @@ ziU16 Zi8Ord2Ord(ziU16 ord ZI_NEED_WORK) { ziU16 count; ziU8* p; - count = Zi8GetTableCount(1, 0, __zi8_work_data); - table = Zi8GetTableAddress(1, 0, __zi8_work_data); - if (ord == 0 || (ziU16)ord >= count) { + count = Zi8GetTableCount(ZI8_LANG_ZH, 0, __zi8_work_data); + table = Zi8GetTableAddress(ZI8_LANG_ZH, 0, __zi8_work_data); + if (ord == 0 || ord >= count) { Zi8LogError(0x132, __zi8_work_data); return ord; } diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8pud2.c b/libs/RVLMiddleware/eZiText/src/clib/zi8pud2.c index d2d314f4..92be9ec0 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8pud2.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8pud2.c @@ -77,7 +77,7 @@ ziU8 Zi8MatchPUDdata_ZHS(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* Zi8LogError(0x4B0, __zi8_work_data); return 0; } - if (language == 1) { + if (language == ZI8_LANG_ZH) { length *= 2; } if (continuation == 0) { @@ -106,7 +106,7 @@ ziU8 Zi8MatchPUDdata_ZHS(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* while ((ziS32)ZI_WORK->pudWordIndex < (ziS32)ZI_WORK->pudWordCount) { wordSize = *word++; entrySize = wordSize; - if (language == 1) { + if (language == ZI8_LANG_ZH) { if (ZI_WORK->zhPudMinPrefix > *word) goto next; wordSize--; entrySize--; @@ -118,7 +118,7 @@ next: ZI_WORK->pudWordIndex++; word += entrySize; } else { - if (language == 1) { + if (language == ZI8_LANG_ZH) { bytePattern = (ziU8*)pattern; for (index = 0; index < length; index++) { if (word[index] != bytePattern[index]) goto next; @@ -143,7 +143,7 @@ matched: else *output = Zi8ConvertWC2Key(*pattern, language, __zi8_work_data); return 1; } - if (language == 1) { + if (language == ZI8_LANG_ZH) { byteOutput = (ziU8*)output; for (index = copied = 0; index < (ziS32)wordSize && copied < capacity; copied++) { byteOutput[index] = word[index]; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8space.c b/libs/RVLMiddleware/eZiText/src/clib/zi8space.c index eb8e03d3..295431c2 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8space.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8space.c @@ -87,7 +87,7 @@ ziU8 Zi8ZHaddSpace(ziWChar* src, ziU8 count, ziWChar* dst, return 1; fail: - if ((ziU8)count >= (ziU16)maxLen) { + if (count >= maxLen) { count = (ziU8)(maxLen - 1); } for (i = 0; i < count; i++) { diff --git a/libs/RVLMiddleware/eZiText/src/clib/zidawg1.c b/libs/RVLMiddleware/eZiText/src/clib/zidawg1.c index dbf63654..07113124 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zidawg1.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zidawg1.c @@ -129,8 +129,8 @@ ziU8* ZiDAWGGetSibling(ziU8* cursor) { } -ziU8 ZiDAWGgetEOWattribute(ziU32 node) { - return (nodeHeaderTable[*(ziU8*)node >> 4] & 0x10) > 0; +ziU8 ZiDAWGgetEOWattribute(ziU8* node) { + return (nodeHeaderTable[*node >> 4] & 0x10) > 0; } ziU32 ZiDAWGgetCHARattribute(zi8DawgCtx* context, ziU32 node, ziPtr __zi8_work_data) { @@ -149,17 +149,17 @@ ziU32 ZiDAWGgetCHARattribute(zi8DawgCtx* context, ziU32 node, ziPtr __zi8_work_d } attribute = key << 24; - attribute |= ((ziU8*)context->characterFlags)[key] << 16; - attribute |= (((ziU32)((ziU8*)context->characters)[key * 2] & 0xFFFF) << 8) + - ((ziU8*)context->characters + key * 2)[1]; + attribute |= context->characterFlags[key] << 16; + attribute |= (((ziU32)context->characters[key * 2] & 0xFFFF) << 8) + + (context->characters + key * 2)[1]; Zi8LogError(0x64, __zi8_work_data); return attribute; } -ziU32 ZiDAWGGetGraph(ziPtr context) { - return (((ziU32)((zi8DawgCtx*)context)->table[2] & 0xFFFF) << 8) + - ((zi8DawgCtx*)context)->table[3] + - ((ziU32)((zi8DawgCtx*)context)->table + 4); +ziU32 ZiDAWGGetGraph(zi8DawgCtx* context) { + return (((ziU32)context->table[2] & 0xFFFF) << 8) + + context->table[3] + + ((ziU32)context->table + 4); } ziU32 ZiDAWGGetGraphInfo(zi8DawgCtx* context, ziU8* entry, ziU16* keys) { diff --git a/libs/RVLMiddleware/eZiText/src/clib/zikorean.c b/libs/RVLMiddleware/eZiText/src/clib/zikorean.c index a4ba8593..0906ed9c 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zikorean.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zikorean.c @@ -23,10 +23,10 @@ ziU8 Zi8LookupKoreanChar(ziWChar character, ziU8* result, ziU16* index, ziPtr wo return 0; } -ziU8 Zi8MatchKoreanSequence(ziU16* resultIndex, ziU16* input, ziU8 type, ziU16 count, ziPtr workData); +ziU8 Zi8MatchKoreanSequence(ziU16* resultIndex, ziU16* input, ziU8 type, ziU16 count, struct __zi8_work_data_s* workData); ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument, - ziPtr workData) { + struct __zi8_work_data_s* workData) { struct { ziU8 characterIndex; ziU8 matched; @@ -104,7 +104,7 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument, state.characterIndex, (state.elementIndex - currentCharacter) - 1, workData); - if ((((struct __zi8_work_data_s*)workData)->koAltTables == 1)) { + if (workData->koAltTables == 1) { switch (state.characterIndex) { case 1: selectedTable = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 0x1E, workData); @@ -177,10 +177,10 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument, if (state.currentCandidate != 0) { state.currentCandidate--; } else { - params->candidates[(ziU8)result] = + params->candidates[result] = ((ziU16)selectedTable[state.nextIndex * 2] << 8) | (selectedTable + state.nextIndex * 2)[1]; - if ((state.tableCount6 != 0) && (((struct __zi8_work_data_s*)workData)->koAltTables == 0)) { - params->candidates[(ziU8)result] += state.inputIndex * state.tableCount3; + if ((state.tableCount6 != 0) && (workData->koAltTables == 0)) { + params->candidates[result] += state.inputIndex * state.tableCount3; } result++; } @@ -208,7 +208,7 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument, if (currentCharacter == 0) { params->completion = 1; } - params->candidates[(ziU8)result] = + params->candidates[result] = state.tableCount0 + (state.table31 + state.index * 3)[2]; result++; currentCharacter++; @@ -216,11 +216,11 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument, } } if (state.index == state.tableCount31) { - if ((params->candidates[(ziU8)result] = buffer[currentCharacter]) < 0xFF) { + if ((params->candidates[result] = buffer[currentCharacter]) < 0xFF) { if (currentCharacter == 0) { params->completion = 1; } - params->candidates[(ziU8)result] += state.tableCount0; + params->candidates[result] += state.tableCount0; result++; } } @@ -235,7 +235,7 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument, return result; } -ziU8 Zi8MatchKoreanSequence(ziU16* resultIndex, ziU16* input, ziU8 type, ziU16 count, ziPtr workData) { +ziU8 Zi8MatchKoreanSequence(ziU16* resultIndex, ziU16* input, ziU8 type, ziU16 count, struct __zi8_work_data_s* workData) { ziU16 nestedScratch; ziU16 nestedIndexStorage; ziU16 index1; @@ -249,7 +249,7 @@ ziU8 Zi8MatchKoreanSequence(ziU16* resultIndex, ziU16* input, ziU8 type, ziU16 c firstCharacter = input[0]; mappedCharacter = 0xFF; - if (((struct __zi8_work_data_s*)workData)->koAltTables == 0) { + if (workData->koAltTables == 0) { table = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 3, workData); tableCount = Zi8GetTableCount(ZI8_LANG_KO, 3, workData); } else { diff --git a/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c b/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c index 906097f7..9cb066e8 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c +++ b/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c @@ -53,7 +53,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) { Zi8ReplaceLastError(300, __zi8_work_data); return 0; } - if (language != 1) { + if (language != ZI8_LANG_ZH) { for (count = 0; word[count] != 0; count++) { if (word[count] >= 0xEFF1 || count == 64) return 0; } @@ -91,7 +91,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) { ZI_WORK->formatCount = savedCount; if (count != 0) return 1; } - if (language != 1) { + if (language != ZI8_LANG_ZH) { Zi8ReplaceLastError(0x26C, __zi8_work_data); return 0; } @@ -106,10 +106,10 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) { { if (count-- == 1) return 1; ordinals[count] |= 0x8000; - ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1, __zi8_work_data) & 2; - table = (ziChineseEntry*)Zi8GetTableAddress(1, 0, __zi8_work_data); + ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(ZI8_LANG_ZH, __zi8_work_data) & 2; + table = Zi8GetTableAddress(ZI8_LANG_ZH, 0, __zi8_work_data); entry = table + ordinals[0]; - baseData = (ziU8*)Zi8GetTableAddress(1, 1, __zi8_work_data); + baseData = Zi8GetTableAddress(ZI8_LANG_ZH, 1, __zi8_work_data); baseData += ((entry->offsetHigh & 15) << 16 | (entry->offsetLow[1] | (entry->offsetLow[0] << 8))); data = baseData; if (ZI_WORK->cangjieEnabled != 0) { @@ -168,10 +168,10 @@ ziWChar Zi8ConvertUC2UserKey(ziChar character, ziU8 language ZI_NEED_WORK) { if (character == 0 || language > 0x82 || (keys = ZI_WORK->userKeys[language]) == 0) return 0; for (key = 0; key < 32; key++) { for (cursor = keys->lower[key]; cursor != 0 && *cursor != 0; cursor++) { - if ((ziU16)*cursor == (ziU16)character) goto found; + if (*cursor == (ziU16)character) goto found; } for (cursor = keys->upper[key]; cursor != 0 && *cursor != 0; cursor++) { - if ((ziU16)*cursor == (ziU16)character) goto found; + if (*cursor == (ziU16)character) goto found; } } found: diff --git a/libs/RVLMiddleware/eZiText/src/clib/zkokeyp.c b/libs/RVLMiddleware/eZiText/src/clib/zkokeyp.c index 01b6cbff..62d28d3f 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zkokeyp.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zkokeyp.c @@ -313,7 +313,7 @@ ziU32 Zi8GetKOcandidates(ziGetParam* param, ZiKoreanCandidateOptions* options ZI wordNode = wordTable + wordOffset; match_word: while (remainingLetters != 0) { - keyIndex = Zi8_8148302C(param->currentWord[wordIndex], (ziU8*)keyTable, ZI_WORK); + keyIndex = Zi8_8148302C(param->currentWord[wordIndex], keyTable, ZI_WORK); if (keyIndex == (((ziU16)*wordNode & 0x1F) << 8 | (ziU16)wordNode[1])) { --remainingLetters; ++wordIndex; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zmtkey.c b/libs/RVLMiddleware/eZiText/src/clib/zmtkey.c index 53c0b796..5ee9c5c0 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zmtkey.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zmtkey.c @@ -62,10 +62,10 @@ ziBool Zi8getKeyLayout(ziU8 language, ziWChar key, ziWChar* chars, ziU8 mode, zi return 0; } keyChars = customTable->lower[key]; - for (keyIndex = 0; keyChars[(ziU16)keyIndex] != 0; keyIndex++) { - chars[(ziU16)keyIndex] = keyChars[(ziU16)keyIndex]; + for (keyIndex = 0; keyChars[keyIndex] != 0; keyIndex++) { + chars[keyIndex] = keyChars[keyIndex]; } - chars[(ziU16)keyIndex] = 0; + chars[keyIndex] = 0; return 1; } else { if (mode == 1) { @@ -93,19 +93,19 @@ tables_ready: } keyIndex = tableCount = 0; - for (; (ziU16)keyIndex < key; keyIndex++) { - tableCount += dataAddress[(ziU16)keyIndex]; + for (; keyIndex < key; keyIndex++) { + tableCount += dataAddress[keyIndex]; } if ((charCount = (ziU8)dataAddress[key]) == 0) { return 0; } dataAddress = dataAddress + numKeys + (tableCount * 2); keyIndex = 0; - for (; (ziU16)keyIndex < charCount; keyIndex++) { - chars[(ziU16)keyIndex] = (ziU16)dataAddress[(ziU16)keyIndex * 2] | - ((ziU16)dataAddress[((ziU16)keyIndex * 2) + 1] << 8); + for (; keyIndex < charCount; keyIndex++) { + chars[keyIndex] = (ziU16)dataAddress[keyIndex * 2] | + ((ziU16)dataAddress[(keyIndex * 2) + 1] << 8); } - chars[(ziU16)keyIndex] = 0; + chars[keyIndex] = 0; return 1; } } @@ -121,7 +121,7 @@ ziBool Zi8ChangeCharCase(ziBool upper, ziWChar* character, ziU8 language ZI_NEED ziU16 result; ziS32 keyIndex; ziPtr from; - ziPtr to; + ziWChar* to; ziS32 characterIndex; customTables = 0; @@ -130,9 +130,9 @@ ziBool Zi8ChangeCharCase(ziBool upper, ziWChar* character, ziU8 language ZI_NEED numKeys = 0x20; Zi8LogError(0x64, ZI_WORK); if (ZI_WORK->userKeys[language] != 0) { - customTables = (ziUserKeyMap*)ZI_WORK->userKeys[language]; + customTables = ZI_WORK->userKeys[language]; } else if (ZI_WORK->customKeyMap != 0) { - customTables = (ziUserKeyMap*)ZI_WORK->customKeyMap; + customTables = ZI_WORK->customKeyMap; } else { tableCount = Zi8GetTableCount(language, 0x1e, ZI_WORK); if (tableCount != 0) { @@ -144,18 +144,18 @@ ziBool Zi8ChangeCharCase(ziBool upper, ziWChar* character, ziU8 language ZI_NEED } } if (customTables != 0) { - for (keyIndex = 0; (changed == 0) && (keyIndex < (ziS32)(ziU32)numKeys); keyIndex++) { + for (keyIndex = 0; (changed == 0) && (keyIndex < (ziS32)numKeys); keyIndex++) { if (upper != 0) { - from = (ziPtr)customTables->lower[keyIndex]; - to = (ziPtr)customTables->upper[keyIndex]; + from = customTables->lower[keyIndex]; + to = customTables->upper[keyIndex]; } else { - from = (ziPtr)customTables->upper[keyIndex]; - to = (ziPtr)customTables->lower[keyIndex]; + from = customTables->upper[keyIndex]; + to = customTables->lower[keyIndex]; } if ((from != 0) && (to != 0)) { for (characterIndex = 0; ((ziU16)((ziS16*)from)[characterIndex]) != 0; characterIndex++) { if ((ziU16)((ziS16*)from)[characterIndex] == *character) { - *character = (ziU16)((ziWChar*)to)[characterIndex]; + *character = (ziU16)to[characterIndex]; changed = 1; break; } @@ -165,7 +165,7 @@ ziBool Zi8ChangeCharCase(ziBool upper, ziWChar* character, ziU8 language ZI_NEED } else if (dataAddress != 0) { total = 0; - for (keyIndex = 0; keyIndex < (ziS32)(ziU32)numKeys; keyIndex++) { + for (keyIndex = 0; keyIndex < (ziS32)numKeys; keyIndex++) { total += dataAddress[keyIndex]; } dataAddress = dataAddress + numKeys; @@ -174,7 +174,7 @@ ziBool Zi8ChangeCharCase(ziBool upper, ziWChar* character, ziU8 language ZI_NEED dataAddress = dataAddress + ((ziU32)total * 2); direction = -1; } - for (keyIndex = 0; keyIndex < (ziS32)(ziU32)total; keyIndex++) { + for (keyIndex = 0; keyIndex < (ziS32)total; keyIndex++) { tableCount = (ziU16)(dataAddress[(keyIndex * 2)] | ((ziU16)dataAddress[(keyIndex * 2) + 1] << 8)); if (tableCount == *character) { diff --git a/libs/RVLMiddleware/eZiText/src/clib/zoemdata.c b/libs/RVLMiddleware/eZiText/src/clib/zoemdata.c index c91c957a..0449e605 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zoemdata.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zoemdata.c @@ -44,7 +44,7 @@ posEntry: if (pattern[position] == Zi8ConvertWC2Key(word[position], language, __zi8_work_data)) continue; break; } else if (word[position] != pattern[position]) { - if (!ZI_WORK->ignoreCase || language == 1) break; + if (!ZI_WORK->ignoreCase || language == ZI8_LANG_ZH) break; folded = pattern[position]; if (!Zi8ChangeCharCase(1, &folded, language, __zi8_work_data) || folded != word[position]) break; } @@ -64,7 +64,7 @@ posEntry: while (word[position] != 0) position++; return position; matchRetry: - if ((ziS32)index >= ZI_WORK->oemLen) goto oemFailed; + if (index >= ZI_WORK->oemLen) goto oemFailed; if (!ZI_WORK->oemMatch(index, word, capacity, ZI_WORK->oemData)) goto oemFailed; goto posEntry; oemFailed: diff --git a/tools/decomp-assist/rx55.cleanup.md b/tools/decomp-assist/rx55.cleanup.md new file mode 100644 index 00000000..14e9f41e --- /dev/null +++ b/tools/decomp-assist/rx55.cleanup.md @@ -0,0 +1,323 @@ +# rx55 expression cleanup + +Baseline: `9d225c150d2dd75ba0ee7d53ed581f39da07433d`, branch `agent/w1005/rx55`. +Scope: eZiText, excluding `zi81key.c`, `zi8cgetc.c`, `zi8alpha.c`, `zprepare.c`, and `zi8uwd.c`. +All 26 permitted units already have 100% code and data. This round preserves their bytes and scores; new matches are not an acceptance condition. + +Acceptance requires unchanged complete object bytes against fresh local baseline objects, identical target string pools, unchanged objdiff measures, zero instruction differences, and the full non-quick gate with DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`. +Shared headers, excluded sources, public identifiers, compiler settings, and unrelated untracked rx4 files remain untouched. + +Baseline objects were rebuilt with normal ninja targets. `ninja -t clean` initially failed on its compiler-directory dependency; removing only the requested object outputs and rebuilding recovered the baseline. Temporary snapshots and detailed trial output are in `/tmp/rx55-cleanup`. +The checked-in headers define language IDs and the local `zaddress.c` table-member enum. They do not name the logged error codes or table-kind IDs. Those unnamed values stay numeric. + +## Trials + +- 001 `zaddress.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 8. +- 002 `zi8cinfo.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 13. +- 003 `zi8dawg.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 3. +- 004 `zi8getc2.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 12. +- 005 `zi8initd.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 3. +- 006 `zi8is.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 7. +- 007 `zi8match.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 1. +- 008 `zi8misc.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 7. +- 009 `zi8pud2.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 4. +- 010 `ziswordw.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 5. +- 011 `zoemdata.c`: use existing language IDs and table-member constants. ACCEPT, complete object byte-identical. constants: 1. +- 012 `zi8getc2.c`: name language-switch cases with existing SDK constants. ACCEPT, complete object byte-identical. constants: 10. +- 013 `zi8cinfo.c`: type candidate-info work parameters and remove repeated casts. REVERT, object bytes changed; functions: Zi8GetCJInfo. pointers: 13. +- 014 `zi8dawg.c`: remove casts from null pointers and the already typed prefix pointer. REVERT, object bytes changed; functions: Zi8MatchROMdata0. casts: 4. +- 015 `zi8match.c`: use typed node and dictionary pointers in secondary matching. ACCEPT, complete object byte-identical. pointers: 24. +- 016 `zi8match.c`: type the phonetic-code table parameter. ACCEPT, complete object byte-identical. pointers: 3. +- 017 `zi8misc.c`: use the shared work accessor instead of an identical local macro. ACCEPT, complete object byte-identical. pointers: 16. +- 018 `Zi8punct.c`: type punctuation options and remove repeated casts. ACCEPT, complete object byte-identical. pointers: 5. +- 019 `zidawg1.c`: remove casts from typed character arrays. ACCEPT, complete object byte-identical. casts: 3. +- 020 `zidawg1.c`: type the DAWG context used to read its graph. ACCEPT, complete object byte-identical. pointers: 4. +- 021 `ziswordw.c`: use implicit conversions from void table addresses to typed pointers. ACCEPT, complete object byte-identical. casts: 2. +- 022 `zkokeyp.c`: remove a cast from the already typed Korean key table. ACCEPT, complete object byte-identical. casts: 1. +- 023 `zmtkey.c`: remove explicit casts on work-owned void pointers. ACCEPT, complete object byte-identical. casts: 2. +- 024 `zmtkey.c`: use typed case-mapping arrays throughout the conversion loop. REVERT, object bytes changed; functions: Zi8ChangeCharCase. pointers: 9. +- 025 `zi8cinfo.c`: type only the character-info work parameter that reads work fields. ACCEPT, complete object byte-identical. pointers: 3. +- 026 `zi8dawg.c`: remove only the already typed prefix pointer cast. ACCEPT, complete object byte-identical. casts: 1. +- 027 `zi8cinfo.c`: remove the cast on a null table pointer. ACCEPT, complete object byte-identical. casts: 1. +- 028 `zmtkey.c`: remove implicit-conversion casts when storing case arrays. ACCEPT, complete object byte-identical. casts: 4. +- 029 `zikorean.c`: type Korean work parameters for direct member access. ACCEPT, complete object byte-identical. pointers: 9. +- 030 `zidawg1.c`: use a byte pointer for DAWG end-of-word lookup. ACCEPT, complete object byte-identical. pointers: 1. +- 031 `zi8alts.c`: Zi8MatchAltSound: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 1. +- 032 `zi8cinfo.c`: ZiCharInfo2: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 1. +- 033 `zi8initd.c`: Zi8IsZicorpSignature: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 2. +- 034 `zi8is.c`: Zi8IsCharacter: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 1. +- 035 `zi8match.c`: Zi8SecMatchChar: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 1. +- 036 `zi8misc.c`: Zi8Uni2Ptr: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 5. +- 037 `zi8misc.c`: Zi8Ord2Uni: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 1. +- 038 `zi8misc.c`: Zi8Ord2Ord: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 1. +- 039 `Zi8punct.c`: Zi8Punctuation: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 1. +- 040 `zi8space.c`: Zi8ZHaddSpace: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 2. +- 041 `zikorean.c`: Zi8GetKoreanCandidates: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 5. +- 042 `zmtkey.c`: Zi8getKeyLayout: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 11. +- 043 `zoemdata.c`: Zi8MatchOEMdata: remove casts to the declared scalar type. ACCEPT, complete object byte-identical. casts: 1. +- 044 `zi8misc.c`: Zi8Uni2Ptr: express Unicode range selection with if/else. REVERT, object bytes changed; functions: metadata/data only. control: 1. +- 045 `zmtkey.c`: Zi8getKeyLayout: select the fallback table with if/else. REVERT, object bytes changed; functions: metadata/data only. control: 1. +- 046 `zidawg1.c`: ZiDAWGGetGraphInfo: use a while condition for entry scanning. REVERT, object bytes changed; functions: ZiDAWGGetGraphInfo. control: 1. +- 047 `zi8dawg.c`: Zi8MatchROMdata0: convert the key-check jump into a for loop. REVERT, object bytes changed; functions: Zi8MatchROMdata0. control: 1. +- 048 `zi8match.c`: Zi8GetPyPhonetic: structure ASCII and extended pinyin selection. REVERT, compile failed. control: 1. +- 049 `zkokeyp.c`: Zi8_8148302C: read character bytes through the existing key-entry fields. REVERT, object bytes changed; functions: Zi8_8148302C. members: 2. +- 050 `zkokeyp.c`: Zi8_814834AC: use the already selected key entry for character bytes. REVERT, object bytes changed; functions: Zi8_814834AC. members: 2. +- 051 `zkokeyp.c`: Zi8GetKOcandidates: index existing key-entry fields directly. REVERT, object bytes changed; functions: Zi8GetKOcandidates. members: 8. +- 052 `zconvert.c`: Zi8ConvertWC2UC: read the first byte through its existing entry field. ACCEPT, complete object byte-identical. members: 1. +- 053 `zconvert.c`: conversion header counts: use the table count member. REVERT, object bytes changed; functions: Zi8ConvertWC2UC, Zi8ConvertUC2Key. members: 2. +- 054 `zi8match.c`: Zi8SecMatchChar and Zi8SecMatchComp: use array indexing for dictionary bytes. REVERT, object bytes changed; functions: Zi8SecMatchChar, Zi8SecMatchComp. expressions: 4. +- 055 `zi8is.c`: Zi8GetZHCharSet: use the standard workspace accessor. ACCEPT, complete object byte-identical. pointers: 18. +- 056 `zikorean.c`: keep void-pointer declarations for functions that only forward the workspace. ACCEPT, complete object byte-identical. scope: 4. +- 057 `zi8getc2.c`: candidate dispatch: remove casts from byte-sized return values. ACCEPT, complete object byte-identical. casts: 6. +- 058 `zi8cinfo.c`: ZiCharInfo2: remove a cast to the existing return type. ACCEPT, complete object byte-identical. casts: 1. +- 059 `zi8getc2.c`: candidate dispatch: test Boolean signature and character results directly. ACCEPT, complete object byte-identical. control: 5. +- 060 `zi8match.c`: Zi8GetPyPhonetic: test the Boolean final lookup directly. ACCEPT, complete object byte-identical. control: 6. +- 061 `zi8dawg.c`: Zi8MatchROMdata0: test the end-of-word predicate directly. ACCEPT, complete object byte-identical. control: 2. +- 062 `zmtkey.c`: Zi8ChangeCharCase: remove a cast to the pointed-to word type. REVERT, object bytes changed; functions: Zi8ChangeCharCase. casts: 1. +- 063 `ziswordw.c`: Zi8ConvertUC2UserKey: compare dereferenced word values directly. ACCEPT, complete object byte-identical. casts: 2. +- 064 `zmtkey.c`: Zi8ChangeCharCase: type the destination while retaining its load-bearing scalar cast. ACCEPT, complete object byte-identical. pointers: 2. +- 065 `zidawg1.c`: ZiDAWGgetCHARattribute: use a byte pointer for node data. REVERT, object bytes changed; functions: metadata/data only. pointers: 5. +- 066 `zi8getc2.c`: Zi8IsDupWordW: access the existing flat duplicate buffer without array-pointer casts. REVERT, object bytes changed; functions: Zi8IsDupWordW. casts: 4. +- 067 `zi8match.c`: Zi8SecMatchComp: remove casts from integer-promoted comparisons. ACCEPT, complete object byte-identical. casts: 4. +- 068 `zi8match.c`: Zi8SecMatchChar: use the ordinary promoted remaining count. ACCEPT, complete object byte-identical. casts: 1. +- 069 `zi8match.c`: Zi8GetPyFinal: scan rows with a structured while loop. REVERT, object bytes changed; functions: Zi8GetPyFinal. control: 1. +- 070 `zi8match.c`: Zi8GetPyPhonetic: structure pinyin selection while retaining the shared error label. REVERT, object bytes changed; functions: Zi8GetPyPhonetic. control: 1. +- 071 `zi8getSW.c`: Zi8GetSyllablesCandidates: use the already typed candidate pointer. ACCEPT, complete object byte-identical. casts: 1. +- 072 `zi8cinfo.c`: Zi8GetCJInfo: use the standard work accessor. ACCEPT, complete object byte-identical. pointers: 2. +- 073 `zi8cinfo.c`: Zi8GetCJInfo: remove the inner duplicate assignment. REVERT, object bytes changed; functions: Zi8GetCJInfo. expressions: 1. +- 074 `zmtkey.c`: Zi8getKeyLayout: remove a cast from a byte array element. REVERT, object bytes changed; functions: Zi8getKeyLayout. casts: 1. +- 075 `zi8getSW.c`: Zi8GetSyllablesCandidates: branch directly to cleanup when space is exhausted. REVERT, object bytes changed; functions: Zi8GetSyllablesCandidates. control: 1. +- 076 `zi8alts.c`: Zi8MatchAltSound: scan matching rows with a do/while loop. ACCEPT, complete object byte-identical. control: 1. +- 077 `zi8cinfo.c`: ZiCharInfo2: pass the word buffer without casting its equivalent typedef. ACCEPT, complete object byte-identical. casts: 6. +- 078 `zmtkey.c`: Zi8ChangeCharCase: remove redundant intermediate widening casts. ACCEPT, complete object byte-identical. casts: 3. +- 079 `zidawg1.c`: ZiDAWGGetSibling: widen the byte directly to the required word type. REVERT, object bytes changed; functions: ZiDAWGGetSibling. casts: 1. +- 080 `zi8alts.c`: Zi8MatchAltSound: scan preceding matches with a structured while loop. REVERT, object bytes changed; functions: metadata/data only. control: 1. +- 081 `zi8getc2.c`: candidate dispatch: remove redundant grouping from the cleaned Boolean calls. ACCEPT, complete object byte-identical. expressions: 4. + +## Retained changes and rejected expressions + +The 81 compiled trials retained 58 changes and reverted 23. The final diff changes 20 C files. Counts are 74 existing constants substituted, 113 explicit casts removed, 13 Boolean comparisons simplified, one forward scan changed to a do/while loop, one byte reinterpretation replaced by an existing member access, and four Boolean expressions stripped of redundant grouping. The member-access change accounts for one of the 113 removed casts. Work access now uses typed pointers or `ZI_WORK`; the duplicate `WORKP` macro and its 15 uses are gone. + +Trials 44 and 45 preserve code/data scores but change only `.strtab`, through the compiler's anonymous exception-symbol numbering. Trial 65 also changes metadata only. Trial 80 preserves instruction bytes but changes object metadata. All remain reverted because this round requires complete object equality, including metadata. + +The retained do/while scan removes the `body` and `down_start` labels without changing any object byte. The preceding-row loop, pinyin dispatch, key-selection loop, graph scan, Unicode range dispatch, and syllable exit rewrites were rejected. Existing shared failure paths remain ordinary C gotos. + +The Korean record-field rewrites change address arithmetic or register operands. The current `offsetof` expressions are retained. `rx53.attempts.md` independently records the operand-order constraint on these accesses. The failed removal of the duplicate `packedCodes` assignment and the scalar casts in `Zi8ChangeCharCase` and `Zi8getKeyLayout` confirms those expressions affect code generation. + +Four touched candidate-dispatch expressions retain their evaluation order while dropping redundant parentheses. Their object remains byte-identical. + +The untouched permitted files are `eztx.c`, `zi8copy.c`, `zi8getc.c`, `zi8ver.c`, `zi8ZHuwd.c`, and `zierror.c`. Their remaining pointer conversions cross actual types or encode ABI/data representations; remaining numeric values lack matching named constants. No shared header or excluded source changed. + +No owned function is non-matching. The expression-cleanup contract supersedes the generic matching-round requirement for increased exact counts. The 99 functions in touched units must stay 99/99, with 61,424 code bytes and 4,436 data bytes unchanged. + +## Rejected trial measurements + +Values below are temporary trial results, all reverted. The baseline for every listed unit is 100% code, data, and functions. + +| Trial | Unit | Fuzzy percent | Matched code | Matched data | Exact functions | +| --- | --- | ---: | ---: | ---: | ---: | +| 013 | zi8cinfo | 99.95981 | 10588/10948 | 1848/1848 | 9/10 | +| 014 | zi8dawg | 99.33443 | 2780/4868 | 48/120 | 5/6 | +| 024 | zmtkey | 99.45848 | 1052/2216 | 24/60 | 3/4 | +| 044 | zi8misc | 100.0 | 1636/1636 | 80/80 | 4/4 | +| 045 | zmtkey | 100.0 | 2216/2216 | 60/60 | 4/4 | +| 046 | zidawg1 | 98.0649 | 1128/1664 | 32/80 | 5/6 | +| 047 | zi8dawg | 98.18406 | 2780/4868 | 120/120 | 5/6 | +| 048 | zi8match | compile failed | restored | restored | restored | +| 049 | zkokeyp | 99.71923 | 4964/5200 | 96/180 | 6/7 | +| 050 | zkokeyp | 98.973076 | 3828/5200 | 40/180 | 6/7 | +| 051 | zkokeyp | 96.901535 | 2524/5200 | 40/180 | 6/7 | +| 053 | zconvert | 98.509056 | 584/2208 | 32/112 | 2/4 | +| 054 | zi8match | 99.98062 | 6740/8256 | 728/728 | 8/10 | +| 062 | zmtkey | 99.819496 | 1052/2216 | 24/60 | 3/4 | +| 065 | zidawg1 | 100.0 | 1664/1664 | 80/80 | 6/6 | +| 066 | zi8getc2 | 99.95122 | 6332/6888 | 332/332 | 16/17 | +| 069 | zi8match | 99.997574 | 8044/8256 | 728/728 | 9/10 | +| 070 | zi8match | 99.30184 | 5384/8256 | 608/728 | 9/10 | +| 073 | zi8cinfo | 99.996346 | 10588/10948 | 1848/1848 | 9/10 | +| 074 | zmtkey | 99.819496 | 1488/2216 | 24/60 | 3/4 | +| 075 | zi8getSW | 99.967606 | 0/1852 | 20/20 | 0/1 | +| 079 | zidawg1 | 99.72356 | 1140/1664 | 32/80 | 5/6 | +| 080 | zi8alts | 100.0 | 1200/1200 | 20/20 | 1/1 | + +## Final verification + +- Clean non-quick gate passed. DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`. +- All 1,027 report units retain identical measures, function results, and section results against the fresh local baseline. Global measures are unchanged. +- All 99 touched-unit functions pass `ctxdiff.py` with `diffs 0` and identical instruction counts. +- All 20 touched-unit string pools are identical to target. All 31 complete eZiText objects equal their saved pre-cleanup bytes. +- The five excluded source files equal their saved baseline bytes. No headers, configure settings, symbols, or other translation units changed. +- Remaining non-matching owned functions: none. Uncertainty: none in retained edits; rejected expressions are listed above. + +Full non-quick gate output follows verbatim. + +```text +full build: ok +main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d +[libs/RVLMiddleware/eZiText/src/clib/Zi8punct] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/Zi8punct] objdiff: code 300/300 data 100/100 functions 1/1 fuzzy 100.0000 linked code 300 +[libs/RVLMiddleware/eZiText/src/clib/Zi8punct] instruction-exact functions: 1/1 +[libs/RVLMiddleware/eZiText/src/clib/Zi8punct] section .rodata size 80 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/Zi8punct] section .text size 300 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/Zi8punct] section extab size 8 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/Zi8punct] section extabindex size 12 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/Zi8punct] baseline: code 300/300 data 100 functions 1 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zaddress] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zaddress] objdiff: code 1244/1244 data 140/140 functions 7/7 fuzzy 100.0000 linked code 1244 +[libs/RVLMiddleware/eZiText/src/clib/zaddress] instruction-exact functions: 7/7 +[libs/RVLMiddleware/eZiText/src/clib/zaddress] section .text size 1244 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zaddress] section extab size 56 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zaddress] section extabindex size 84 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zaddress] baseline: code 1244/1244 data 140 functions 7 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zconvert] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zconvert] objdiff: code 2208/2208 data 112/112 functions 4/4 fuzzy 100.0000 linked code 2208 +[libs/RVLMiddleware/eZiText/src/clib/zconvert] instruction-exact functions: 4/4 +[libs/RVLMiddleware/eZiText/src/clib/zconvert] section .rodata size 32 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zconvert] section .text size 2208 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zconvert] section extab size 32 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zconvert] section extabindex size 48 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zconvert] baseline: code 2208/2208 data 112 functions 4 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8alts] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8alts] objdiff: code 1200/1200 data 20/20 functions 1/1 fuzzy 100.0000 linked code 1200 +[libs/RVLMiddleware/eZiText/src/clib/zi8alts] instruction-exact functions: 1/1 +[libs/RVLMiddleware/eZiText/src/clib/zi8alts] section .text size 1200 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8alts] section extab size 8 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8alts] section extabindex size 12 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8alts] baseline: code 1200/1200 data 20 functions 1 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8cinfo] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8cinfo] objdiff: code 10948/10948 data 1848/1848 functions 10/10 fuzzy 100.0000 linked code 10948 +[libs/RVLMiddleware/eZiText/src/clib/zi8cinfo] instruction-exact functions: 10/10 +[libs/RVLMiddleware/eZiText/src/clib/zi8cinfo] section .data size 1616 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8cinfo] section .rodata size 32 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8cinfo] section .text size 10948 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8cinfo] section extab size 80 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8cinfo] section extabindex size 120 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8cinfo] baseline: code 10948/10948 data 1848 functions 10 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] objdiff: code 4868/4868 data 120/120 functions 6/6 fuzzy 100.0000 linked code 4868 +[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] instruction-exact functions: 6/6 +[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section .text size 4868 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extab size 48 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] section extabindex size 72 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8dawg] baseline: code 4868/4868 data 120 functions 6 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8getSW] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8getSW] objdiff: code 1852/1852 data 20/20 functions 1/1 fuzzy 100.0000 linked code 1852 +[libs/RVLMiddleware/eZiText/src/clib/zi8getSW] instruction-exact functions: 1/1 +[libs/RVLMiddleware/eZiText/src/clib/zi8getSW] section .text size 1852 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getSW] section extab size 8 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getSW] section extabindex size 12 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getSW] baseline: code 1852/1852 data 20 functions 1 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] objdiff: code 6888/6888 data 332/332 functions 17/17 fuzzy 100.0000 linked code 6888 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] instruction-exact functions: 17/17 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .data size 80 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .rodata size 16 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sbss2 size 8 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .sdata2 size 8 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section .text size 6888 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extab size 88 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] section extabindex size 132 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8getc2] baseline: code 6888/6888 data 332 functions 17 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8initd] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8initd] objdiff: code 704/704 data 20/20 functions 2/2 fuzzy 100.0000 linked code 704 +[libs/RVLMiddleware/eZiText/src/clib/zi8initd] instruction-exact functions: 2/2 +[libs/RVLMiddleware/eZiText/src/clib/zi8initd] section .text size 704 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8initd] section extab size 8 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8initd] section extabindex size 12 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8initd] baseline: code 704/704 data 20 functions 2 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8is] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8is] objdiff: code 1136/1136 data 40/40 functions 3/3 fuzzy 100.0000 linked code 1136 +[libs/RVLMiddleware/eZiText/src/clib/zi8is] instruction-exact functions: 3/3 +[libs/RVLMiddleware/eZiText/src/clib/zi8is] section .text size 1136 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8is] section extab size 16 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8is] section extabindex size 24 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8is] baseline: code 1136/1136 data 40 functions 3 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8match] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8match] objdiff: code 8256/8256 data 728/728 functions 10/10 fuzzy 100.0000 linked code 8256 +[libs/RVLMiddleware/eZiText/src/clib/zi8match] instruction-exact functions: 10/10 +[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .rodata size 528 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8match] section .text size 8256 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extab size 80 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8match] section extabindex size 120 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8match] baseline: code 8256/8256 data 728 functions 10 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8misc] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8misc] objdiff: code 1636/1636 data 80/80 functions 4/4 fuzzy 100.0000 linked code 1636 +[libs/RVLMiddleware/eZiText/src/clib/zi8misc] instruction-exact functions: 4/4 +[libs/RVLMiddleware/eZiText/src/clib/zi8misc] section .text size 1636 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8misc] section extab size 32 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8misc] section extabindex size 48 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8misc] baseline: code 1636/1636 data 80 functions 4 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8pud2] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8pud2] objdiff: code 2136/2136 data 120/120 functions 7/7 fuzzy 100.0000 linked code 2136 +[libs/RVLMiddleware/eZiText/src/clib/zi8pud2] instruction-exact functions: 7/7 +[libs/RVLMiddleware/eZiText/src/clib/zi8pud2] section .text size 2136 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8pud2] section extab size 48 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8pud2] section extabindex size 72 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8pud2] baseline: code 2136/2136 data 120 functions 7 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zi8space] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zi8space] objdiff: code 776/776 data 20/20 functions 1/1 fuzzy 100.0000 linked code 776 +[libs/RVLMiddleware/eZiText/src/clib/zi8space] instruction-exact functions: 1/1 +[libs/RVLMiddleware/eZiText/src/clib/zi8space] section .text size 776 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8space] section extab size 8 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8space] section extabindex size 12 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zi8space] baseline: code 776/776 data 20 functions 1 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zidawg1] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zidawg1] objdiff: code 1664/1664 data 80/80 functions 6/6 fuzzy 100.0000 linked code 1664 +[libs/RVLMiddleware/eZiText/src/clib/zidawg1] instruction-exact functions: 6/6 +[libs/RVLMiddleware/eZiText/src/clib/zidawg1] section .text size 1664 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zidawg1] section extab size 32 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zidawg1] section extabindex size 48 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zidawg1] baseline: code 1664/1664 data 80 functions 6 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zikorean] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zikorean] objdiff: code 5188/5188 data 308/308 functions 3/3 fuzzy 100.0000 linked code 5188 +[libs/RVLMiddleware/eZiText/src/clib/zikorean] instruction-exact functions: 3/3 +[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .data size 248 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zikorean] section .text size 5188 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extab size 24 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zikorean] section extabindex size 36 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zikorean] baseline: code 5188/5188 data 308 functions 3 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/ziswordw] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/ziswordw] objdiff: code 2028/2028 data 48/48 functions 2/2 fuzzy 100.0000 linked code 2028 +[libs/RVLMiddleware/eZiText/src/clib/ziswordw] instruction-exact functions: 2/2 +[libs/RVLMiddleware/eZiText/src/clib/ziswordw] section .sdata2 size 8 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/ziswordw] section .text size 2028 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/ziswordw] section extab size 16 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/ziswordw] section extabindex size 24 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/ziswordw] baseline: code 2028/2028 data 48 functions 2 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] objdiff: code 5200/5200 data 180/180 functions 7/7 fuzzy 100.0000 linked code 5200 +[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] instruction-exact functions: 7/7 +[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .data size 40 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section .text size 5200 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extab size 56 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] section extabindex size 84 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zkokeyp] baseline: code 5200/5200 data 180 functions 7 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zmtkey] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zmtkey] objdiff: code 2216/2216 data 60/60 functions 4/4 fuzzy 100.0000 linked code 2216 +[libs/RVLMiddleware/eZiText/src/clib/zmtkey] instruction-exact functions: 4/4 +[libs/RVLMiddleware/eZiText/src/clib/zmtkey] section .text size 2216 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zmtkey] section extab size 24 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zmtkey] section extabindex size 36 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zmtkey] baseline: code 2216/2216 data 60 functions 4 fuzzy 100.0000 +[libs/RVLMiddleware/eZiText/src/clib/zoemdata] pool: IDENTICAL +[libs/RVLMiddleware/eZiText/src/clib/zoemdata] objdiff: code 976/976 data 60/60 functions 3/3 fuzzy 100.0000 linked code 976 +[libs/RVLMiddleware/eZiText/src/clib/zoemdata] instruction-exact functions: 3/3 +[libs/RVLMiddleware/eZiText/src/clib/zoemdata] section .text size 976 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zoemdata] section extab size 24 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zoemdata] section extabindex size 36 match 100.0 +[libs/RVLMiddleware/eZiText/src/clib/zoemdata] baseline: code 976/976 data 60 functions 3 fuzzy 100.0000 +regressions vs baseline: 0 +global matched_code_percent: 94.31032 -> 94.31032 +global fuzzy_match_percent: 99.82008 -> 99.82008 +global complete_code_percent: 80.92587 -> 80.92587 +global matched_data_percent: 99.99410 -> 99.99410 +forbidden patterns added (net, per file): 0 +readability warnings (net, per file; must be 0 in the final result): 0 +GATE PASS +``` + +## Commits + +- `9d6a57a201ab01918c66c76344d5aaed36670de8`: simplify ezitext language and work expressions. +- `c302ce8110456d91982694f805d4011112355b11`: simplify ezitext matching expressions. +- The commit containing this log contains the remaining candidate and conversion cleanups.