From 6722a1ff6cc61b8996a082845888445143e2768a Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Tue, 22 Sep 2026 07:40:52 +0000 Subject: [PATCH 1/2] Match d_vf_sys unit --- configure.py | 2 +- libs/RevoEX/src/vf/develop/d_vf_sys.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.py b/configure.py index 647d1d89..6ddfd9ab 100644 --- a/configure.py +++ b/configure.py @@ -1159,7 +1159,7 @@ config.libs = [ Object(Matching, "vf/system/pf_system.c"), Object(Matching, "vf/develop/d_vf.c"), - Object(NonMatching, "vf/develop/d_vf_sys.c"), + Object(Matching, "vf/develop/d_vf_sys.c"), Object(Matching, "vf/develop/d_hash.c"), Object(Matching, "vf/develop/d_time.c"), Object(Matching, "vf/develop/d_common.c"), diff --git a/libs/RevoEX/src/vf/develop/d_vf_sys.c b/libs/RevoEX/src/vf/develop/d_vf_sys.c index 89380eb4..7bf0a9bd 100644 --- a/libs/RevoEX/src/vf/develop/d_vf_sys.c +++ b/libs/RevoEX/src/vf/develop/d_vf_sys.c @@ -385,7 +385,7 @@ VFErr VFSysSetSyncMode(s32 i_handle_idx, u32 i_mode) { return VF_ERR_SYSTEM; } -u32 VFSysGetSyncMode(s32 i_handle_idx) { +static u32 VFSysGetSyncMode(s32 i_handle_idx) { VFSys_handle* handle_p = VFSysGetHandleP(i_handle_idx); if (handle_p == NULL || handle_p->drive.pf_disk_p == NULL || handle_p->device_p == NULL) { @@ -541,7 +541,7 @@ s32 VFSysHandleP2Idx(VFSys_handle* i_handle_p) { return VF_ERR_SYSTEM; } -VFSys_handle* VFSysVol2HandleP(PF_VOLUME* i_vol_p) { +static VFSys_handle* VFSysVol2HandleP(PF_VOLUME* i_vol_p) { if (i_vol_p != NULL) { VFSys_handle* handle_p = VFSysGetHandleP(0); VFSys_handle* handle_end_p = &handle_p[l_vfsys_vol_max]; @@ -728,7 +728,7 @@ static void VFiSysClearDeviceSDDirect(VFSys_deviceSD* o_sd_p) { o_sd_p->slotNo = -1; } -VFSys_device* VFSysGetDeviceP(s32 i_idx) { +static VFSys_device* VFSysGetDeviceP(s32 i_idx) { VFSys_handle* handle_p = VFSysGetHandleP(i_idx); if (handle_p != NULL) { return handle_p->device_p; @@ -1170,7 +1170,7 @@ static VFErr VFiSysGetLastDeviceError_common(VFSys_handle* i_handle_p) { return VF_ERR_SYSTEM; } -void VFSysSetDevErrInfo(s32 i_handle_idx, VFErr i_err) { +static void VFSysSetDevErrInfo(s32 i_handle_idx, VFErr i_err) { VFSys_handle* handle_p = VFSysGetHandleP(i_handle_idx); if (handle_p != NULL) { VFiSysSetDeviceErrInfo(handle_p, i_err); -- 2.49.1 From 584dbb69062985814676206e16a53d2c36dff782 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Tue, 22 Sep 2026 02:51:42 -0500 Subject: [PATCH 2/2] Match MSL multibyte string helpers (#152) --- configure.py | 2 +- libs/MSL/src/MSL_Common/mbstring.c | 97 ++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 libs/MSL/src/MSL_Common/mbstring.c diff --git a/configure.py b/configure.py index 647d1d89..fcd11ce2 100644 --- a/configure.py +++ b/configure.py @@ -1952,7 +1952,7 @@ config.libs = [ Object(NonMatching, "MSL_Common/direct_io.c"), Object(NonMatching, "MSL_Common/file_io.c"), Object(NonMatching, "MSL_Common/FILE_POS.c"), - Object(NonMatching, "MSL_Common/mbstring.c"), + Object(Matching, "MSL_Common/mbstring.c"), Object(Matching, "MSL_Common/mem.c"), Object(Matching, "MSL_Common/mem_funcs.c"), Object(Matching, "MSL_Common/math_api.c"), diff --git a/libs/MSL/src/MSL_Common/mbstring.c b/libs/MSL/src/MSL_Common/mbstring.c new file mode 100644 index 00000000..050bbef9 --- /dev/null +++ b/libs/MSL/src/MSL_Common/mbstring.c @@ -0,0 +1,97 @@ +#include +#include + +int mbtowc(wchar_t* pwc, const char* s, size_t n) { + return _current_locale.ctype_cmpt_ptr->decode_mb(pwc, s, n); +} + +int __mbtowc_noconv(wchar_t* pwc, const char* s, size_t n) { + if (s == NULL) { + return 0; + } + + if (n == 0) { + return -1; + } + + if (pwc != NULL) { + *pwc = (unsigned char)*s; + } + + if (!*s) { + return 0; + } + + return 1; +} + +int __wctomb_noconv(char* s, wchar_t wchar) { + if (s == NULL) { + return 0; + } + + *s = (char)wchar; + return 1; +} + +size_t mbstowcs(wchar_t* dest, const char* src, size_t len) { + int count; + char* src_ptr; + size_t slen; + + slen = strlen(src); + + if (dest != NULL) { + src_ptr = (char*)src; + + for (count = 0; count < len; count++) { + if (*src_ptr) { + int res = mbtowc(dest++, src_ptr, slen); + + if (res > 0) { + src_ptr += res; + slen -= res; + } else { + return -1; + } + } else { + *dest = 0; + break; + } + } + } else { + count = 0; + } + + return count; +} + +size_t wcstombs(char* s, const wchar_t* pwcs, size_t n) { + int result; + int chars_written = 0; + char temp[3]; + wchar_t* source; + + if (s == NULL || pwcs == NULL) { + return 0; + } + + source = (wchar_t*)pwcs; + + while (chars_written <= n) { + if (!*source) { + *(s + chars_written) = '\0'; + break; + } + + result = _current_locale.ctype_cmpt_ptr->encode_wc(temp, *source++); + if (chars_written + result > n) { + break; + } + + strncpy(s + chars_written, temp, result); + chars_written += result; + } + + return chars_written; +} -- 2.49.1