From ac2117040c34437a2c4ca6484dbb8ecc96ebcbcc Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 15 Sep 2019 16:09:08 +0200 Subject: [PATCH] [Decompilation] Define generic function pointer types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Going with the classic pointer-in-typedef approach here, because the syntax you'd otherwise have to use is terribly inconsistent. It'd be farfunc_t *near near_ptr_to_far_func; but nearfunc_t near *near_ptr_to_near_func; And that'd hopefully be the last change to ReC98.h for a long time! Those glacial compile times if every .c file is affected… Really stands out if your build system is otherwise perfect. Part of P0030, funded by zorg. --- ReC98.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ReC98.h b/ReC98.h index c0939b6b..a22fa8eb 100644 --- a/ReC98.h +++ b/ReC98.h @@ -45,6 +45,17 @@ #define RES_PARASIZE ((sizeof(resident_t) + 0xF) >> 4) // ------ +/// Typedefs +/// -------- +// Generic callback function types. Note the difference between function +// distance (nearfunc / farfunc) and pointer variable distance +// (t_near / t_far). +typedef void (near pascal *near nearfunc_t_near)(void); +typedef void ( far pascal *near farfunc_t_near)(void); +typedef void (near pascal * far nearfunc_t_far)(void); +typedef void ( far pascal * far farfunc_t_far)(void); +/// -------- + #define RES_X 640 #define RES_Y 400