From 05b1bfe4f7cf2c6bfce8884458d743d17c6c0d1a Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Thu, 1 Oct 2026 19:09:35 -0500 Subject: [PATCH] cleanup(eZiText): rename work unk_0x16 to cangjieEnabled Same Zi8GetFormatVersion(... ) & 2 pattern as ZiInfoWork.cangjieEnabled. --- libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h | 2 +- libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c | 6 +++--- libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c | 4 ++-- libs/RVLMiddleware/eZiText/src/clib/zi8initd.c | 2 +- libs/RVLMiddleware/eZiText/src/clib/zi8match.c | 4 ++-- libs/RVLMiddleware/eZiText/src/clib/zi8misc.c | 2 +- libs/RVLMiddleware/eZiText/src/clib/ziswordw.c | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index 64c9c64c..56e23afb 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -215,7 +215,7 @@ struct __zi8_work_data_s { ziU32 unk_0x0C; ziU32 unk_0x10; ziU16 unk_0x14; - ziU8 unk_0x16; + ziU8 cangjieEnabled; // 0x16 ziU8 unk_0x17; ziU8 subLanguage; // 0x18 ziU8 unk_0x19; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c b/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c index 536a5e06..fc6f96bb 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c @@ -430,7 +430,7 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt if (getMode != 7 && getMode != 10 && getMode != 8 && getMode != 9) { Zi8PrepareMatch(request, &match, 0, work); } else { - if (!((struct __zi8_work_data_s*)work)->unk_0x16 || request->elementCount > 6) { + if (!((struct __zi8_work_data_s*)work)->cangjieEnabled || request->elementCount > 6) { resultFallback = 0; goto engine_finish; } @@ -1151,7 +1151,7 @@ context_word_lookup: if (ordinalIndex == 0xFFFF) goto context_results_done; record = records + ordinalIndex * 12; phoneticGroups = phraseTable + ((record[9] & 15) << 16 | (record[11] | record[10] << 8)); - if (((struct __zi8_work_data_s*)work)->unk_0x16) { + if (((struct __zi8_work_data_s*)work)->cangjieEnabled) { switch (phoneticGroups[0] & 7) { case 2: phoneticGroups += 2; break; case 3: case 4: phoneticGroups += 3; break; @@ -1965,7 +1965,7 @@ component_retry: ((ZiChineseWork*)work)->duplicateOrdinals[((ZiChineseWork*)work)->duplicateIndex] = ordinalIndex; relatedRecord = records + ordinalIndex * 12; phoneticGroups = phraseTable + ((relatedRecord[9] & 15) << 16 | (relatedRecord[11] | relatedRecord[10] << 8)); - if (((struct __zi8_work_data_s*)work)->unk_0x16) { + if (((struct __zi8_work_data_s*)work)->cangjieEnabled) { switch (phoneticGroups[0] & 7) { case 2: phoneticGroups += 2; break; case 3: case 4: phoneticGroups += 3; break; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c index f2f0e586..05254938 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c @@ -491,7 +491,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option } } ZI_WORK->subLanguage = parameters->subLanguage; - ZI_WORK->unk_0x16 = Zi8GetFormatVersion(1,ZI_WORK) & 2; + ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1,ZI_WORK) & 2; options->maxCount = ZI_WORK->unk_0x10; options->maxWordLength = ZI_WORK->unk_0x0A; ZI_WORK->unk_0x0A = -1; @@ -558,7 +558,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option } else if ((parameters->language == 1) && ((((parameters->getMode == 7 || (parameters->getMode == 8)) || (parameters->getMode == 10)) || (parameters->getMode == 9)))) { - if (ZI_WORK->unk_0x16 != '\0') { + if (ZI_WORK->cangjieEnabled != '\0') { candidateCount = Zi8GetChineseCandidates(parameters,options,ZI_WORK); } else { error = 0x708; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c b/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c index f0aaa2ee..47f96938 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c @@ -48,7 +48,7 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) { Zi8SetLatinSearchOrder(0, 0, ZI_WORK); ZADP_Zi8SetPDremoveOpt(1, ZI_WORK); ZI_WORK->unk_0x17 = 5; - ZI_WORK->unk_0x16 = Zi8GetFormatVersion(1, ZI_WORK) & 2; + ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1, ZI_WORK) & 2; ZI_WORK->unk_0x1B28.bits.msb = 1; ZI_WORK->unk_0x1B2C.bits.msb = 1; zyFuzzy = ZI_WORK->unk_0x1B2C.word; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8match.c b/libs/RVLMiddleware/eZiText/src/clib/zi8match.c index 3aaaf01d..5299e262 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8match.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8match.c @@ -139,7 +139,7 @@ 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); - if (ZI_WORK->unk_0x16 != 0) { + if (ZI_WORK->cangjieEnabled != 0) { switch (data[0] & 7) { case 2: data += 2; @@ -346,7 +346,7 @@ match_code: traversal.soundIndex = initialCode; } sound = (ziU8*)(tableAddress + ((node[9] & 0xF) * 0x10000 + (node[0xB] + node[0xA] * 0x100))); - if (ZI_WORK->unk_0x16 != 0) { + if (ZI_WORK->cangjieEnabled != 0) { switch (sound[0] & 7) { case 2: sound += 2; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c b/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c index e7dd2fd0..cf788c63 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8misc.c @@ -37,7 +37,7 @@ ziU16 Zi8Uni2Ptr(ziU16 ch, ziE12* buf ZI_NEED_WORK) { p = (ziU8*)(table2 + (((e[9] & 0xF) << 16) | (e[0xB] | (e[0xA] << 8)))); - if (WORKP->unk_0x16 != 0) { + if (WORKP->cangjieEnabled != 0) { switch (p[0] & 7) { case 2: p += 2; diff --git a/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c b/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c index 4a5ac4bd..daebeb2e 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c +++ b/libs/RVLMiddleware/eZiText/src/clib/ziswordw.c @@ -103,10 +103,10 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) { if (length == 1) return 1; count = --length; ordinals[count] |= 0x8000; - ZI_WORK->unk_0x16 = Zi8GetFormatVersion(1, __zi8_work_data) & 2; + ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1, __zi8_work_data) & 2; entry = (ziChineseEntry*)Zi8GetTableAddress(1, 0, __zi8_work_data) + ordinals[0]; data = (ziU8*)Zi8GetTableAddress(1, 1, __zi8_work_data) + ((entry->offsetHigh & 15) << 16 | ((entry->offsetLow[0] << 8) | entry->offsetLow[1])); - if (ZI_WORK->unk_0x16 != 0) { + if (ZI_WORK->cangjieEnabled != 0) { switch (*data & 7) { case 2: offset = 2; -- 2.49.1