diff options
| author | elijah-thomas774 <elijahthomas774@gmail.com> | 2025-11-22 20:49:58 -0500 |
|---|---|---|
| committer | elijah-thomas774 <elijahthomas774@gmail.com> | 2025-11-22 20:49:58 -0500 |
| commit | 2b0e4985ff3f9e75ade31c29d11eb62a56671241 (patch) | |
| tree | e6599a09a3148c8dc404a771b52c04edac1a10a9 /src/libms/libms.c | |
| parent | e9396ddd50a44f49ad3b473dd9c4722f16f600c1 (diff) | |
Libms matching:
Thanks Troy from gc/wii decomp server
Reference: https://github.com/Trippixyz/LibMessageStudio/blob/ceb14124dbf037627a3c40e2bb9c87725baf3cbb/src/libms.c
Diffstat (limited to 'src/libms/libms.c')
| -rw-r--r-- | src/libms/libms.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libms/libms.c b/src/libms/libms.c index 0e678693..2bc9398b 100644 --- a/src/libms/libms.c +++ b/src/libms/libms.c @@ -17,9 +17,9 @@ void LMSi_Free(void *ptr) { return (MSB_FREE_FUNC)(ptr); } -int LMSi_MemCmp(const char *p1, const char *p2, int n) { +int LMSi_MemCmp(const void *p1, const void *p2, int n) { for (int i = 0; i < n; i++) { - if (p1[i] != p2[i]) { + if (((const char *)p1)[i] != ((const char *)p2)[i]) { return 0; } } @@ -27,11 +27,11 @@ int LMSi_MemCmp(const char *p1, const char *p2, int n) { return 1; } -void LMSi_MemCopy(char *p1, const char *p2, int n) { +void LMSi_MemCopy(void *p1, const void *p2, int n) { // https://decomp.me/scratch/JOWiM // NONMATCHING - register usage too optimal // Look, how difficult can an unrolled memcopy be to match for (int i = 0; i < n; i++) { - *(p1++) = *(p2++); + ((char *)p1)[i] = ((const char *)p2)[i]; } } |
