Compare commits

...

3 Commits

26 changed files with 1077 additions and 479 deletions

View File

@@ -1006,7 +1006,7 @@ config.libs = [
Object(Matching, "clib/zidawg1.c"),
Object(Matching, "clib/zikorean.c"),
Object(Matching, "clib/ziswordw.c"),
Object(NonMatching, "clib/zkokeyp.c"),
Object(Matching, "clib/zkokeyp.c"),
Object(Matching, "clib/zierror.c"),
Object(Matching, "clib/zmtkey.c"),
Object(Matching, "clib/zoemdata.c"),

View File

@@ -214,13 +214,8 @@ s32 TMCJPEGDEC_set_converterY8U8V8(TMCCJPEGDecWork* work);
s32 TMCJPEGDEC_set_converterRGB565(TMCCJPEGDecWork* work);
s32 TMCJPEGDEC_set_converterRGBA8(TMCCJPEGDecWork* work);
#ifdef TMC_JPEG_FRAME_PARSER
extern const u8 TMCJPEGDEC_SampleH_N[6][4];
extern const u8 TMCJPEGDEC_SampleV_N[6][4];
#else
extern const u8 TMCJPEGDEC_SampleH_N[24];
extern const u8 TMCJPEGDEC_SampleV_N[24];
#endif
extern const u8 TMCJPEGDEC_Zigzag_data[64];
extern const u32 TMCJPEGDEC_Zigzag_loop[64];
#ifdef TMC_JPEG_FRAME_PARSER

View File

@@ -1,22 +1,22 @@
#include <tmc_jpeg_internal.h>
// clang-format off
const u8 TMCJPEGDEC_SampleH_N[24] = {
4, 1, 1, 0,
2, 1, 1, 0,
2, 1, 1, 0,
1, 1, 1, 0,
1, 1, 1, 0,
1, 0, 0, 0
const u8 TMCJPEGDEC_SampleH_N[6][4] = {
{4, 1, 1, 0},
{2, 1, 1, 0},
{2, 1, 1, 0},
{1, 1, 1, 0},
{1, 1, 1, 0},
{1, 0, 0, 0}
};
const u8 TMCJPEGDEC_SampleV_N[24] = {
1, 1, 1, 0,
1, 1, 1, 0,
2, 1, 1, 0,
2, 1, 1, 0,
1, 1, 1, 0,
1, 0, 0, 0
const u8 TMCJPEGDEC_SampleV_N[6][4] = {
{1, 1, 1, 0},
{1, 1, 1, 0},
{2, 1, 1, 0},
{2, 1, 1, 0},
{1, 1, 1, 0},
{1, 0, 0, 0}
};
const u8 TMCJPEGDEC_Zigzag_data[64] = {

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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:

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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) {

View File

@@ -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 ||

View File

@@ -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;
}

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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];

View File

@@ -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++) {

View File

@@ -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) {

View File

@@ -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 {

View File

@@ -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:

View File

@@ -189,7 +189,8 @@ ziU32 Zi8_814834AC(ziGetParam* param, ziU16* remaining, ziU8* count,
if (matches) {
for (candidateIndex = 0; candidateIndex < *count; candidateIndex++) {
if (param->candidates[candidateIndex] ==
(((ziU16)((ZiKoreanKeyEntry*)tableA)[i].characterHigh << 8) | (ziU16)((ZiKoreanKeyEntry*)tableA)[i].characterLow)) {
(((ziU16)tableA[i * sizeof(ZiKoreanKeyEntry) + offsetof(ZiKoreanKeyEntry, characterHigh)] << 8) |
(ziU16)tableA[i * sizeof(ZiKoreanKeyEntry) + offsetof(ZiKoreanKeyEntry, characterLow)])) {
matched++;
param->candidates[candidateIndex] &= 0x7FFF;
break;
@@ -247,254 +248,251 @@ typedef struct {
} ZiKoreanCandidateOptions;
ziU32 Zi8GetKOcandidates(ziGetParam* param, ZiKoreanCandidateOptions* options ZI_NEED_WORK) {
struct {
ziBool matches;
ziU8 inserted;
ziU8 matchPass;
ziU8 keyByte;
ziU8 candidateCount;
ziU8 wordIndex;
ziU8 remainingLetters;
ziU16 remainingCandidates;
ziU16 previousIndex;
ziU16 character;
ziU16 tableCount;
ziU16 keyIndex;
ZiKoreanKeyEntry* entry;
ziS32 candidateIndex;
ziS32 prefixCount;
ziU32 wordOffset;
ziS32 resultCount;
ziS32 tableIndex;
ziU8* wordTable;
union {
ziU32 firstWord;
ziU8 bytes[5];
} packedKeys;
} search;
ziU8* wordTable;
ziS32 tableIndex;
ziS32 resultCount;
ziU32 wordOffset;
ziS32 prefixCount;
ziS32 candidateIndex;
ZiKoreanKeyEntry* entry;
ziU16 keyIndex;
ziU16 tableCount;
ziU16 character;
ziU16 previousIndex;
ziU16 remainingCandidates;
ziU8 remainingLetters;
ziU8 wordIndex;
ziU8 candidateCount;
ziU8 keyByte;
ziU8 matchPass;
ziU8 inserted;
ziBool matches;
ziU8* keyTable;
ziU8* wordNode;
search.previousIndex = 0xFFFF;
search.resultCount = 0;
search.packedKeys.firstWord = 0;
search.packedKeys.bytes[4] = 0;
search.wordIndex = search.remainingLetters = 0;
search.candidateCount = 0;
search.keyByte = 0;
search.remainingCandidates = param->firstCandidate;
search.prefixCount = 0;
search.candidateIndex = 0;
search.inserted = 0;
Zi8LogError(100, ZI_WORK);
Zi8_81483264(param, ZI_WORK);
keyTable = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 9, ZI_WORK);
search.wordTable = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 10, ZI_WORK);
if (keyTable == 0) {
Zi8ReplaceLastError(0x76C, ZI_WORK);
return 0;
} else {
if (search.wordTable == 0) {
Zi8ReplaceLastError(0x776, ZI_WORK);
return 0;
}
if (options->countOnly == 0) {
param->letters = 0;
param->count = 0;
param->candidates[0] = 0;
}
previousIndex = 0xFFFF;
resultCount = 0;
{
ziU8 packedKeys[5] = {0};
remainingLetters = 0;
wordIndex = 0;
candidateCount = 0;
keyByte = 0;
remainingCandidates = param->firstCandidate;
prefixCount = 0;
candidateIndex = 0;
inserted = 0;
Zi8LogError(100, ZI_WORK);
if (param->wordCharCount == 0) goto scan_key_table;
{
if (((search.keyIndex = Zi8_8148302C(param->currentWord[0], keyTable, ZI_WORK)) != 0xFFFF) &&
((keyTable[(search.keyIndex << 3) + search.keyIndex + offsetof(ZiKoreanKeyEntry, keyBytes[4])] & 8) != 0)) {
search.wordOffset = ((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->childLow |
((((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->keyBytes[4] & 3) << 16 |
((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->childHigh << 8);
search.remainingLetters = param->wordCharCount - 1;
search.wordIndex = 1;
wordNode = search.wordTable + search.wordOffset;
match_word:
while (search.remainingLetters != 0) {
search.keyIndex = Zi8_8148302C(param->currentWord[search.wordIndex], (ziU8*)keyTable, ZI_WORK);
if (search.keyIndex == (((ziU16)*wordNode & 0x1F) << 8 | (ziU16)wordNode[1])) {
--search.remainingLetters;
++search.wordIndex;
if ((*wordNode & 0x40) != 0) {
search.remainingLetters = param->wordCharCount - 1;
search.wordIndex = 1;
break;
}
wordNode += 2;
} else {
search.wordIndex = 1;
search.remainingLetters = param->wordCharCount - 1;
break;
}
}
if (search.remainingLetters == 0) {
search.keyIndex = ((ziU16)*wordNode & 0x1F) << 8 | (ziU16)wordNode[1];
search.character = (ziU16)((ziU16)((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->characterHigh << 8 |
((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->characterLow);
if (param->wordCharCount == 1) {
if (search.keyIndex == search.previousIndex) {
for (; (*wordNode & 0x40) == 0; wordNode = wordNode + 2) {
}
wordNode += 2;
search.remainingLetters = param->wordCharCount - 1;
search.wordIndex = 1;
goto next_word;
}
search.previousIndex = search.keyIndex;
if (param->elementCount == 0) {
if (search.remainingCandidates != 0) {
--search.remainingCandidates;
} else {
if (options->countOnly != 0) {
if (++search.prefixCount < (ziS32)options->maxCount) {
goto skip_word;
}
return options->maxCount;
}
param->candidates[search.candidateCount++] = search.character;
++param->count;
if (++param->letters >= param->maxCandidates) {
return param->letters;
}
}
} else {
param->candidates[search.candidateCount++] = search.character;
++param->count;
if (++param->letters >= param->maxCandidates) {
Zi8_814834AC(param, &search.remainingCandidates, &search.candidateCount, &search.inserted, ZI_WORK);
param->count = search.candidateCount;
param->letters = search.candidateCount;
if (search.candidateCount < param->maxCandidates) goto skip_word;
if (options->countOnly != 0) {
if ((search.prefixCount += search.candidateCount) >= (ziS32)options->maxCount) return options->maxCount;
param->count = 0;
param->letters = 0;
search.candidateCount = 0;
} else {
return search.candidateCount;
}
}
}
} else {
for (search.candidateIndex = 0; search.candidateIndex < search.candidateCount; search.candidateIndex++) {
if (search.character == param->candidates[search.candidateIndex]) break;
}
if ((search.candidateIndex == search.candidateCount) &&
(Zi8_814833F0(param, search.character, ZI_WORK) == 0)) {
param->candidates[search.candidateCount++] = search.character;
++param->count;
if (++param->letters < param->maxCandidates) {
goto skip_word;
}
Zi8_814834AC(param, &search.remainingCandidates, &search.candidateCount, &search.inserted, ZI_WORK);
param->count = search.candidateCount;
param->letters = search.candidateCount;
if (search.candidateCount < param->maxCandidates) goto skip_word;
if (options->countOnly != 0) {
if ((search.prefixCount += search.candidateCount) >= (ziS32)options->maxCount) return options->maxCount;
param->count = 0;
param->letters = 0;
search.candidateCount = 0;
} else {
return search.candidateCount;
}
}
}
}
skip_word:
for (; (*wordNode & 0x40) == 0; wordNode = wordNode + 2) {
}
wordNode += 2;
search.remainingLetters = param->wordCharCount - 1;
search.wordIndex = 1;
next_word:
if ((*wordNode & 0x80) != 0) {
goto search_table;
}
goto match_word;
}
}
search_table:
search.resultCount = search.prefixCount;
if (search.candidateCount != 0) {
Zi8_814834AC(param, &search.remainingCandidates, &search.candidateCount, &search.inserted, ZI_WORK);
if (options->countOnly != 0) {
if ((search.prefixCount += search.candidateCount) >= (ziS32)options->maxCount) return options->maxCount;
search.resultCount = search.prefixCount;
}
param->count = search.candidateCount;
param->letters = search.candidateCount;
}
scan_key_table:
if (param->elementCount > 9) {
param->letters = 0;
Zi8_81483264(param, ZI_WORK);
keyTable = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 9, ZI_WORK);
wordTable = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 10, ZI_WORK);
if (keyTable == 0) {
Zi8ReplaceLastError(0x76C, ZI_WORK);
return 0;
}
{
if (param->elementCount != 0 && options->countOnly == 0) {
search.matchPass = 0;
} else {
search.matchPass = 1;
} else {
if (wordTable == 0) {
Zi8ReplaceLastError(0x776, ZI_WORK);
return 0;
}
search.tableCount = Zi8GetTableCount(ZI8_LANG_KO, 9, ZI_WORK);
Zi8_81483118(param, search.packedKeys.bytes);
do {
for (search.tableIndex = 0; search.tableIndex < search.tableCount; search.tableIndex = search.tableIndex + 1) {
search.matches = ZI8_TRUE;
search.entry = (ZiKoreanKeyEntry*)(((search.tableIndex << 3) + search.tableIndex) + keyTable);
search.keyByte = 0;
if (1 < param->elementCount) {
for (search.keyByte = 0;
(ziS32)search.keyByte < (int)param->elementCount / 2;
search.keyByte++) {
if (search.packedKeys.bytes[search.keyByte] != search.entry->keyBytes[search.keyByte]) {
search.matches = ZI8_FALSE;
if (options->countOnly == 0) {
param->letters = 0;
param->count = 0;
param->candidates[0] = 0;
}
Zi8LogError(100, ZI_WORK);
if (param->wordCharCount == 0) goto scan_key_table;
{
if (((keyIndex = Zi8_8148302C(param->currentWord[0], keyTable, ZI_WORK)) != 0xFFFF) &&
((keyTable[(keyIndex << 3) + keyIndex + offsetof(ZiKoreanKeyEntry, keyBytes[4])] & 8) != 0)) {
wordOffset = keyTable[(keyIndex << 3) + keyIndex + offsetof(ZiKoreanKeyEntry, childLow)] |
((keyTable[(keyIndex << 3) + keyIndex + offsetof(ZiKoreanKeyEntry, keyBytes[4])] & 3) << 16 |
keyTable[(keyIndex << 3) + keyIndex + offsetof(ZiKoreanKeyEntry, childHigh)] << 8);
remainingLetters = param->wordCharCount - 1;
wordIndex = 1;
wordNode = wordTable + wordOffset;
match_word:
while (remainingLetters != 0) {
keyIndex = Zi8_8148302C(param->currentWord[wordIndex], keyTable, ZI_WORK);
if (keyIndex == (((ziU16)*wordNode & 0x1F) << 8 | (ziU16)wordNode[1])) {
--remainingLetters;
++wordIndex;
if ((*wordNode & 0x40) != 0) {
remainingLetters = param->wordCharCount - 1;
wordIndex = 1;
break;
}
wordNode += 2;
} else {
wordIndex = 1;
remainingLetters = param->wordCharCount - 1;
break;
}
}
if ((search.matches && ((param->elementCount % 2) != 0)) &&
((search.packedKeys.bytes[search.keyByte] & 0xF0) !=
(search.entry->keyBytes[search.keyByte] & 0xF0))) {
search.matches = ZI8_FALSE;
}
if (search.matches) {
if (param->elementCount % 2 != 0) {
if ((search.entry->keyBytes[search.keyByte] & 0xF) != 0) {
if (search.matchPass == 0) goto next_entry;
} else if (search.matchPass != 0 && options->countOnly == 0) {
goto next_entry;
if (remainingLetters == 0) {
keyIndex = ((ziU16)*wordNode & 0x1F) << 8 | (ziU16)wordNode[1];
character = (ziU16)((ziU16)keyTable[(keyIndex << 3) + keyIndex + offsetof(ZiKoreanKeyEntry, characterHigh)] << 8 |
keyTable[(keyIndex << 3) + keyIndex + offsetof(ZiKoreanKeyEntry, characterLow)]);
if (param->wordCharCount == 1) {
if (keyIndex == previousIndex) {
for (; (*wordNode & 0x40) == 0; wordNode = wordNode + 2) {
}
wordNode += 2;
remainingLetters = param->wordCharCount - 1;
wordIndex = 1;
goto next_word;
}
previousIndex = keyIndex;
if (param->elementCount == 0) {
if (remainingCandidates != 0) {
--remainingCandidates;
} else {
if (options->countOnly != 0) {
if (++prefixCount < (ziS32)options->maxCount) {
goto skip_word;
}
return options->maxCount;
}
param->candidates[candidateCount++] = character;
++param->count;
if (++param->letters >= param->maxCandidates) {
return param->letters;
}
}
} else {
param->candidates[candidateCount++] = character;
++param->count;
if (++param->letters >= param->maxCandidates) {
Zi8_814834AC(param, &remainingCandidates, &candidateCount, &inserted, ZI_WORK);
param->count = candidateCount;
param->letters = candidateCount;
if (candidateCount < param->maxCandidates) goto skip_word;
if (options->countOnly != 0) {
if ((prefixCount += candidateCount) >= (ziS32)options->maxCount) return options->maxCount;
param->count = 0;
param->letters = 0;
candidateCount = 0;
} else {
return candidateCount;
}
}
}
} else {
if ((search.entry->keyBytes[search.keyByte] & 0xF0) != 0) {
if (search.matchPass == 0) goto next_entry;
} else if (search.matchPass != 0 && options->countOnly == 0) {
goto next_entry;
for (candidateIndex = 0; candidateIndex < candidateCount; candidateIndex++) {
if (character == param->candidates[candidateIndex]) break;
}
if ((candidateIndex == candidateCount) &&
(Zi8_814833F0(param, character, ZI_WORK) == 0)) {
param->candidates[candidateCount++] = character;
++param->count;
if (++param->letters < param->maxCandidates) {
goto skip_word;
}
Zi8_814834AC(param, &remainingCandidates, &candidateCount, &inserted, ZI_WORK);
param->count = candidateCount;
param->letters = candidateCount;
if (candidateCount < param->maxCandidates) goto skip_word;
if (options->countOnly != 0) {
if ((prefixCount += candidateCount) >= (ziS32)options->maxCount) return options->maxCount;
param->count = 0;
param->letters = 0;
candidateCount = 0;
} else {
return candidateCount;
}
}
}
if (search.remainingCandidates != 0) {
--search.remainingCandidates;
} else if (options->countOnly != 0) {
if (++search.resultCount >= (ziS32)options->maxCount) return options->maxCount;
} else {
param->candidates[search.candidateCount++] =
(ziU16)((ziU16)((ZiKoreanKeyEntry*)(((search.tableIndex << 3) + search.tableIndex) + keyTable))->characterHigh << 8 |
((ZiKoreanKeyEntry*)(((search.tableIndex << 3) + search.tableIndex) + keyTable))->characterLow);
if (++param->letters >= param->maxCandidates) return param->letters;
}
}
next_entry:
;
skip_word:
for (; (*wordNode & 0x40) == 0; wordNode = wordNode + 2) {
}
wordNode += 2;
remainingLetters = param->wordCharCount - 1;
wordIndex = 1;
next_word:
if ((*wordNode & 0x80) != 0) {
goto search_table;
}
goto match_word;
}
} while (++search.matchPass < 2);
}
search_table:
resultCount = prefixCount;
if (candidateCount != 0) {
Zi8_814834AC(param, &remainingCandidates, &candidateCount, &inserted, ZI_WORK);
if (options->countOnly != 0) {
if ((prefixCount += candidateCount) >= (ziS32)options->maxCount) return options->maxCount;
resultCount = prefixCount;
}
param->count = candidateCount;
param->letters = candidateCount;
}
scan_key_table:
if (param->elementCount > 9) {
param->letters = 0;
return 0;
}
{
if (param->elementCount != 0 && options->countOnly == 0) {
matchPass = 0;
} else {
matchPass = 1;
}
tableCount = Zi8GetTableCount(ZI8_LANG_KO, 9, ZI_WORK);
Zi8_81483118(param, packedKeys);
do {
for (tableIndex = 0; tableIndex < tableCount; tableIndex = tableIndex + 1) {
matches = ZI8_TRUE;
entry = (ZiKoreanKeyEntry*)(((tableIndex << 3) + tableIndex) + keyTable);
keyByte = 0;
if (1 < param->elementCount) {
for (keyByte = 0;
(ziS32)keyByte < (int)param->elementCount / 2;
keyByte++) {
if (packedKeys[keyByte] != entry->keyBytes[keyByte]) {
matches = ZI8_FALSE;
break;
}
}
}
if ((matches && ((param->elementCount % 2) != 0)) &&
((packedKeys[keyByte] & 0xF0) !=
(entry->keyBytes[keyByte] & 0xF0))) {
matches = ZI8_FALSE;
}
if (matches) {
if (param->elementCount % 2 != 0) {
if ((entry->keyBytes[keyByte] & 0xF) != 0) {
if (matchPass == 0) goto next_entry;
} else if (matchPass != 0 && options->countOnly == 0) {
goto next_entry;
}
} else {
if ((entry->keyBytes[keyByte] & 0xF0) != 0) {
if (matchPass == 0) goto next_entry;
} else if (matchPass != 0 && options->countOnly == 0) {
goto next_entry;
}
}
if (remainingCandidates != 0) {
--remainingCandidates;
} else if (options->countOnly != 0) {
if (++resultCount >= (ziS32)options->maxCount) return options->maxCount;
} else {
param->candidates[candidateCount++] =
(ziU16)((ziU16)keyTable[(tableIndex << 3) + tableIndex + offsetof(ZiKoreanKeyEntry, characterHigh)] << 8 |
keyTable[(tableIndex << 3) + tableIndex + offsetof(ZiKoreanKeyEntry, characterLow)]);
if (++param->letters >= param->maxCandidates) return param->letters;
}
}
next_entry:
;
}
} while (++matchPass < 2);
}
if (options->countOnly != 0) return resultCount;
return param->letters;
}
if (options->countOnly != 0) return search.resultCount;
return param->letters;
return 0;
}
return 0;
}

View File

@@ -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) {

View File

@@ -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:

View File

@@ -0,0 +1,73 @@
# JPEG sample-array type correction
Current base: `bf65a26b5e38cddaa37b0e12e15e55ba61f57dd9` (43U only).
Original validation base: `e174f2c2bedc4baa28490dcf53989c9a2994bd2e`.
## Source correction
- Declare and define `TMCJPEGDEC_SampleH_N` and `TMCJPEGDEC_SampleV_N`
consistently as `const u8[6][4]`, using six explicitly grouped rows.
- Remove the obsolete H/V declaration conditional. The independent
`TMCJPEGDEC_SampleComps` incomplete-array condition and parser flag remain
unchanged; they are outside this type mismatch.
- Preserve every initializer byte and both existing `[sample][component]`
consumers in `TMCJPEGDEC_parse_sof`. Both tables remain 24 bytes, at
`.rodata` offsets 0 and 24. No flags, dummy state, casts or assembly added.
## Original e174f2c2 validation snapshot
A clean baseline and candidate were built in an isolated leaf with local
copies of the recovered tools and original input. Main's build was untouched.
The comparisons and numbers in this section describe the JPEG correction
relative to the original e174f2c2 baseline, before the disjoint eZiText changes
in bf65a26b. They are not current-main metrics.
- Full `ninja -j4` 43U build passed. The header change rebuilt all 15 dependent
objects, followed by linking and the DOL check.
- Explicit `ninja build/43U/ok`, with the generated stamp removed first,
passed: `build/43U/main.dol: OK`.
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`.
- Baseline/candidate full reports are byte-identical, SHA256
`dfe72493ec41da47a3052f4903a2ccddccfa1907002b6831274b76ee0b4844ef`.
All 1,027 units and 12,563 function records are unchanged.
- All 1,027 source objects preserve all 2,717 allocated sections, including
bytes, lengths, types, flags and alignments, and all 117,551 relocation
records (locations, types, target names/sections/offsets/sizes/bindings and
addends). This includes all 15 header-dependent objects.
- `jdec_main`: 13/13 exact functions; 5,604/5,604 code bytes and 256/256 data
bytes matched and linked. Its complete `.text` and `.rodata` match retail;
all 67 relocations have identical canonical destinations and addends.
- `jpformat`: 376/376 data bytes matched and linked. `.rodata` is exactly
368/368 bytes; both H/V tables retain their bytes and addresses. Existing
`.sdata2` remains 6 source bytes versus 8 retail bytes, with identical
contents and two retail zero-padding bytes; alignment remains 8. No
relocations exist in either object.
- `pool_diff.py`: identical pools for all 15 dependents (0/0 strings each).
- `ctxdiff.py`, using the recovered local helper: all 13 `jdec_main`
functions have equal instruction counts and `diffs 0`; 1,401/1,401 total
instructions. `jpformat` contains no functions.
- `decomp_status.py` ran. `check_decomp_complete.py` still returns 1 for the
existing repository-wide incomplete state; its baseline/candidate findings
are identical. This correction makes no repository-completion claim.
- `git diff --check` passed.
Original-snapshot global values were unchanged: 93.996216% exact code, 99.817444% fuzzy,
80.08451% linked code, 99.9941% matched data, 85.36267% linked data,
12,469/12,563 exact functions and 982/1,027 complete units.
Detailed local evidence is in the sibling `wii-jpeg-array-evidence` directory:
`audit.py`, `audit.txt`, baseline/final build logs and reports,
`all-dependent-pools.txt`, `pools-ctxdiff.txt`, `explicit-ok.txt`, and completion
checker outputs. Original input and binary build artifacts remain local.
## Rebased bf65a26b independent verification
After the disjoint eZiText change in PR #1221 landed, the parent mechanically
rebased the correction onto bf65a26b and independently rebuilt both main and
the leaf. The parent reported identical full reports and identical allocated
sections and relocation records across all 1,027 source objects between that
new baseline and the rebased leaf. Both full 43U builds passed and retained
DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`.
The correction still preserves the separate `SampleComps` conditional. This
audit update changes documentation only; it does not change source or flags.

View File

@@ -0,0 +1,214 @@
# rx53 zkokeyp matching
Worktree `/mnt/drive2/projects/wii-ipl-workers/sol-high`, branch
`agent/w1005/rx53`, starting commit `bf65a26b`. Fresh fetch confirms
`origin/main` at that commit. Only `zkokeyp.c`, its Matching flag when all
checks pass, and this log are owned. Existing rx4 artifacts are untouched.
New measurements and private tooling are under `/tmp/rx53`.
## Acceptance checks
Both requested functions must reach exact-name objdiff 100% and ctxdiff zero
differences. Preserve all seven functions and all 180 data bytes. Require
identical pools, section order, clean full gate, and the retail DOL SHA1 after
the Matching flip. Source must preserve behavior and use ordinary C.
## Fresh baseline
- `Zi8_814834AC`: 99.94169%, 343/343 instructions, two operand-order differences.
- `Zi8GetKOcandidates`: 98.998505%, 669/669 instructions, 71 differences.
- Unit: 5/7 exact functions, 1152/5200 matched code, 180/180 matched data.
- Pool identical, zero strings. Compiler is GC/3.0a5.
Read f-round, common, all levers including 20-23, mwdbg README and the a5
port, current source and target assembly, Ghidra output, and rx35 attempts.
The port already exists in this worktree. A private launcher changes only
the capture path and lock location to keep new artifacts under `/tmp/rx53`.
## Target register map
`Zi8_814834AC`, target offsets 0x7a4-0x7d0: i is r28; tableA reload is r4;
the scaled row offset is r3. Both character byte addresses use
`add r3, r3, r4`. Baseline uses `add r3, r4, r3`. Earlier rx35 evidence
identifies a pre-allocation operand order difference, so declaration-order
experiments cannot repair those two instructions alone.
`Zi8GetKOcandidates`: param r31, options r30, wordNode r29, keyTable r28,
workspace r27 already match. At 0xb80-0xbdc the target adds shifted index
and index before adding keyTable. Baseline instead adds keyTable to the
shifted index first. Resulting temporary live ranges change caller-saved
register assignments. The target also initializes packed keys with one
zero load and initializes remainingLetters and wordIndex separately.
## Exact filter result
Three new field access forms all produce objdiff 100%, 343/343 instructions,
ctxdiff zero, with no function or data drop. They use a byte subscript plus
`offsetof` for the named character fields, with either explicit row arithmetic,
`sizeof` row multiplication, or reversed C subscript spelling. Retain the
ordinary `sizeof` form. The row is nonnegative and bounded by a 16-bit table
count, so row-size and offset arithmetic preserve the original byte addresses.
Fresh mwdbg captures `filter-baseline` and `filter-exact` confirm the cause.
The 155-entry priority list and all nine named-register assignments are
unchanged. v112/v114/v115 keep r4/r3/r3 and priority positions 80/78/77.
v119/v121/v122 keep r4/r3/r3 and priority positions 73/71/70. These six
values are not coalesced. Their graph degrees remain 11/10/10 and 12/11/11.
The source change reverses the two pre-color ADD input operands; all colors
already matched. Both captures have seven accepted GPR coalesces.
The exact capture equals its independent normal-compiler object byte for byte;
668 GPR and 96 CR operand rewrites pass with zero mismatches.
## Candidates address diagnosis
Replacing all seven remaining computed record-field accesses with named
byte-field offsets gives 99.70105%, 669/669 instructions, 180/180 data,
and four differences, all in initial zero stores. This remains a private
candidate until it is exact. Splitting the two byte counter initializations
alone introduces a temporary and an extra call-result copy: 671 instructions,
98.28849%, 96/180 data. Rejected.
Fresh baseline and byte-field mwdbg captures keep the same 213-entry priority
list, fourteen accepted GPR coalesces, and saved registers r31-r27. keyTable's
reference weight rises 14 to 21, still below wordNode's 27. At the first child
address, baseline computes v66=r28+v64 then v67=v65+v66. The candidate computes
v66=v64+v65 then v67=v66+r28. The index reload v65 loses one interference edge,
and v66 loses one. v63/v64/v65 change r3/r0/r3 to target r0/r3/r0; childLow
v68 changes r5 to target r6. Priority positions 186 through 181 stay fixed.
This is an expression-lifetime change, not declaration-order or saved-register
priority. Its full object equals the independent normal build; 1224 GPR and
182 CR operand rewrites pass with zero mismatches.
The remaining initialization difference already exists in initial PCode.
Baseline v34 clears the packed word, v35 clears its suffix, and v36 clears
both remainingLetters and wordIndex. Retail shares the packed-key zero and
uses separate byte counter zeros. Chained assignments introduce a narrowing
instruction; comma, signed-word and explicit byte casts fail to remove it.
`memset` and `__builtin_memset` emit a call. A compound-literal aggregate emits
copies and enlarges the frame. All are rejected. No allocator tie-break is
claimed for this structural difference.
Three 1200-second searches, seeds 5301-5303, were started from the private
99.70105% candidate under the shared 24-slot limiter. They have not yet
acquired slots. A late array declaration without a new block does not compile
under the current C mode; it is not a valid source attempt.
After the capacity interruption, fresh status and ctxdiff confirm the source
still held the original baseline. Only the proven filter change is now applied;
the candidates function is unchanged pending an exact result.
## Filter acceptance and commit
The fresh non-quick gate passes: full build OK, retail DOL SHA1, pool
identical, 6/7 instruction-exact functions, 2524/5200 matched code,
180/180 data. Regressions, forbidden additions and readability warnings
are all zero. `Zi8GetKOcandidates` remains unchanged at 98.998505%.
Gate evidence: `/tmp/rx53/filter-full-gate.log`.
## Exact candidate result
The five-byte key initializer belongs to a real array. Keeping the search
aggregate while moving that array into a nested block gives 99.75187% with
correct instructions but wrong stack offsets. Flattening the aggregate into
ordinary locals gives 99.78924% and puts the array at target stack offset
0x38. Reversing those declarations restores every scalar slot and reaches
100%, 669/669 instructions, zero ctxdiff differences. The final source removes
the search aggregate and packed-word union entirely. No new carrier remains.
The new block permits the array initializer after the two preceding stores
under this C compiler. It lasts through all uses of the buffer. Splitting the
word counter zeros preserves the original remainingLetters-then-wordIndex
store order. The only addresses that escape are the same independent count,
remaining and inserted locals passed to the existing helpers. Those helpers
access each pointed-to value independently; no source assumes member adjacency.
Final mwdbg initial PCode uses v34 for both packedKeys stores, v35 for
remainingLetters, and v36 for wordIndex. The 213-entry coloring priority and
all fourteen accepted GPR coalesces match the byte-field candidate. Saved
assignments remain param/options/wordNode/keyTable/work = r31/r30/r29/r28/r27,
with weights 110/40/27/21/14. All remaining named locals stay on the stack.
This final change fixes initialization and stack placement without changing
the already-correct address-expression allocation.
The exact candidate capture equals an independent wibo build byte for byte.
Validation checks 1224 GPR and 182 CR operand rewrites with zero mismatches,
plus 1027 machine-register operands across 537 instructions. The filter
capture validates 516 machine-register operands across 266 instructions.
The first candidate capture uses the port's snapshot mode; a full-event
capture is also running to retain simplify and color-mask evidence.
Stopped the three queued searches once both functions were exact. None had
acquired a slot or executed a trial; they contribute no evidence.
## Trial measurements
All variants remain under `/tmp/rx53/zkokeyp`. Only the two exact changes
are retained. Initializer chain, cast, comma, memcpy-style and wrapper
controls failed the required instruction or stack layout. Reversed scalar
declarations plus the ordinary scoped array are the successful source.
| Trial | Function score | Instructions | Matched data |
| --- | ---: | ---: | ---: |
| filter-byte-field | 100.0 | 343/343 | 180/180 |
| filter-byte-size | 100.0 | 343/343 | 180/180 |
| filter-byte-index | 100.0 | 343/343 | 180/180 |
| ko-byte-fields | 99.70105 | 669/669 | 180/180 |
| ko-byte-fields-split | 98.28849 | 671/669 | 96/180 |
| ko-init-compound | 97.98954 | 671/669 | 96/180 |
| ko-init-chain-word | 98.28849 | 671/669 | 96/180 |
| ko-init-memset | 99.14051 | 670/669 | 96/180 |
| ko-init-builtin | 99.14051 | 670/669 | 96/180 |
| ko-init-reuse-word | 98.18385 | 672/669 | 96/180 |
| ko-init-comma | 97.890884 | 672/669 | 96/180 |
| ko-init-chain-byte-cast | 98.28849 | 671/669 | 96/180 |
| ko-init-chain-signed | 98.28849 | 671/669 | 96/180 |
| ko-init-literal | 97.02242 | 678/669 | 96/180 |
| ko-init-assign-list | compile failure | - | - |
| ko-init-separate-array | compile failure | - | - |
| ko-init-scoped-array | 99.75187 | 669/669 | 180/180 |
| ko-init-scoped-array-explicit | 99.75187 | 669/669 | 180/180 |
| ko-init-scoped-union | 99.66367 | 669/669 | 180/180 |
| ko-init-scoped-struct | 99.75187 | 669/669 | 180/180 |
| ko-flat-original | 99.78924 | 669/669 | 180/180 |
| ko-flat-reversed | 100.0 | 669/669 | 180/180 |
| final-readable | 100.0 | 669/669 | 180/180 |
## Linking and full gate
The unit is now Matching in configure.py. All seven text symbols match name,
offset and size. symorder.py reports only compiler-generated name differences
for the jump table and extab/extabindex labels. A complete comparison of all
22 defined symbols confirms identical section order, offsets and sizes;
there are no .sbss or .bss symbols to reorder.
The non-quick gate passes after the Matching flip. Code 5200/5200, data
180/180, functions 7/7, linked code 5200. Regressions, forbidden additions and
readability warnings are zero. The regenerated canonical report confirms
complete code 5200/5200 and complete data 180/180. Pool identical; both
requested ctxdiff checks report zero differences. Full build and
`ninja -C . progress build/43U/report.json build/43U/ok` pass.
`doldiff.py` reports 0 differing bytes, both files 3867904 bytes. DOL SHA1
is 26116613f624061ba99c8d1a299aaa6efa85670d. Gate output is
`/tmp/rx53/final-full-gate.log`; the focused report is
`/tmp/rx53/final-report.json`. The first exact gain is committed as 52030c54.
## Full allocator trace and final verification
The full-event candidate capture completed and independently validated.
Both register classes pass reversed-simplify priority and assignment-event
checks. For the first child address, v63-v68 simplify in ascending order
with remaining degrees 6, 6, 5, 5, 6, 21 against 24 available registers.
They color in reverse. v68 sees legal mask 0x1fc0 and selects target r6;
v67 sees 0x1ff8 and selects r3; v66 and v65 see 0x1ff9 and select r0;
v64 sees 0x1ff8 and selects r3; v63 sees 0x1ff1 and selects r0. None of
these values coalesces. The complete pass retains fourteen accepted moves
and 52 interference rejections, with no spill. Capture and validator output
are under `/tmp/rx53/candidates-exact-full`.
After whitespace cleanup, the final worktree object equals the independently
validated exact candidate snapshot byte for byte. The fresh non-quick gate,
canonical progress report, both zero-diff ctxdiff checks, and zero-byte DOL
diff pass again. The retained source changes are confined to the two assigned
functions; configure.py changes only the authorized zkokeyp Matching flag.
All other eZiText source files and the inherited rx4 artifacts are untouched.

View File

@@ -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.