REDIVIVUS

Proposals / #1378

Recover the Mac wide-character counter's integer limit, result and local count

checked · by eejitgames · submitted 2026-11-06

Mac002b8358 declares a char* result and char* second input, and types its ESI count local as char*. Native code instead returns a numeric character count and compares a signed integer limit against a byte offset. Recover int32_t for that input, result and local, preserving cdecl and all chosen names (szSourceFile/pszCount included). Both the explicit counting path and strlen tail path return integers; all seven callers use the result for numeric totals, sizes or conversion counts. Windows00527d50 already has the integer contract. Existing1294 covers only the separate CL classifier002b8317; no op targets it.

Changes 2, applied together

  1. Retype variable mac 0x002b8358 ESI

    typechar *→int32_t
  2. Set prototype mac 0x002b8358

    signaturechar * UNICODE_GetWideCharCount(char * szText, char * szSourceFile)→int32_t UNICODE_GetWideCharCount(char * szText, int32_t szSourceFile)
    convention__cdecl