diff --git a/Mod/Lib/Heap.cp b/Mod/Lib/Heap.cp index 26c69b75..151be540 100644 --- a/Mod/Lib/Heap.cp +++ b/Mod/Lib/Heap.cp @@ -164,14 +164,15 @@ MODULE Heap; END FreeModule; - PROCEDURE REGCMD* (m: Module; IN name: ARRAY OF SHORTCHAR; cmd: Command); - VAR c: Cmd; + PROCEDURE REGCMD* (mod: S.PTR; IN name: ARRAY OF SHORTCHAR; cmd: Command); + VAR c: Cmd; m: Module; BEGIN ASSERT(LEN(name$) < CmdNameLen, 114); (* REGCMD is called during module initialization code before that modules type descriptors have been set up. 'NEW' depends on the Heap modules type descriptors being ready for use, therefore, just for the commands registered by the Heap module itself, we must use S.NEW. *) + m := mod; IF m.name = "Heap" THEN S.NEW(c, SIZE(CmdDesc)) ELSE @@ -180,12 +181,14 @@ MODULE Heap; c.name := name$; c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: ADDRESS); - BEGIN S.PUT(typ, m.types); m.types := typ + PROCEDURE REGTYP* (mod: S.PTR; typ: ADDRESS); + VAR m: Module; + BEGIN m := mod; S.PUT(typ, m.types); m.types := typ END REGTYP; - PROCEDURE INCREF*(m: Module); - BEGIN INC(m.refcnt) + PROCEDURE INCREF* (mod: S.PTR); + VAR m: Module; + BEGIN m := mod; INC(m.refcnt) END INCREF; diff --git a/Mod/Lib/SYSTEM.c b/Mod/Lib/SYSTEM.c index 40fa94c8..1dd18e99 100644 --- a/Mod/Lib/SYSTEM.c +++ b/Mod/Lib/SYSTEM.c @@ -167,7 +167,7 @@ void SYSTEM_INHERIT(SYSTEM_ADRINT *t, SYSTEM_ADRINT *t0) void SYSTEM_ENUMP(void *adr, SYSTEM_ADRINT n, void (*P)(void*)) { while (n > 0) { - P((void*)(*((void**)(adr)))); + P(*((void**)(adr))); adr = ((void**)adr) + 1; n--; } diff --git a/Mod/Lib/SYSTEM.oh b/Mod/Lib/SYSTEM.oh index 7438e247..2086da2e 100644 --- a/Mod/Lib/SYSTEM.oh +++ b/Mod/Lib/SYSTEM.oh @@ -397,10 +397,10 @@ static inline REAL __MAXFD (REAL x, REAL y) { return x>y?x:y; } // Module entry/registration/exit -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); +extern void Heap_REGCMD (SYSTEM_PTR m, CHAR *name, INTEGER name__len, void (*cmd)(void)); +extern SYSTEM_PTR Heap_REGMOD (CHAR *name, INTEGER name__len, void (*enumPtrs)(void(*)(SYSTEM_PTR))); +extern void Heap_REGTYP (SYSTEM_PTR m, SYSTEM_ADRINT typ); +extern void Heap_INCREF (SYSTEM_PTR m); #define __DEFMOD static void *m; if (m!=0) {return m;} #define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, 24, cmd) diff --git a/Target/Win32/ofront+.exe b/Target/Win32/ofront+.exe index d3943e97..18553391 100644 Binary files a/Target/Win32/ofront+.exe and b/Target/Win32/ofront+.exe differ