From 7928f020c7358a95f46944d67f5a1e890b30455f Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Sat, 27 Jul 2019 17:09:42 +0300 Subject: [PATCH] annotate structs in mcb.h process.h [#95] --- hdr/mcb.h | 1 + hdr/portab.h | 1 + hdr/process.h | 2 ++ 3 files changed, 4 insertions(+) diff --git a/hdr/mcb.h b/hdr/mcb.h index 1d747328..199b3ec8 100644 --- a/hdr/mcb.h +++ b/hdr/mcb.h @@ -67,3 +67,4 @@ typedef struct _mcb { // AR_MEMB(_mcb, BYTE, m_name, 8); /* owner name limited to 8 bytes */ BYTE m_name[8]; /* owner name limited to 8 bytes */ } PACKED mcb; +ANNOTATE_SIZE(mcb, 16); diff --git a/hdr/portab.h b/hdr/portab.h index c245193d..bacaa3a1 100644 --- a/hdr/portab.h +++ b/hdr/portab.h @@ -260,6 +260,7 @@ void PurgeHook(void *ptr, UDWORD len); #define BSSZ(t, n) CTORZ(t, n) #define DATA(t, n, i) CTOR(t, n, i) #define DATAAIS(t, n, ...) CTORAI(static, t, n, __VA_ARGS__) +#define ANNOTATE_SIZE(n, s) static_assert(sizeof(n) == s, "wrong size of " #n) #define FAR /* linear architecture */ #define REG diff --git a/hdr/process.h b/hdr/process.h index 8784d389..53891270 100644 --- a/hdr/process.h +++ b/hdr/process.h @@ -51,6 +51,7 @@ typedef struct { } _exec; } ldata; } exec_blk; +ANNOTATE_SIZE(exec_blk, 22); #define exec ldata._exec #define load ldata._load @@ -107,6 +108,7 @@ typedef struct _psp { } _u3; } _u; } psp; +ANNOTATE_SIZE(psp, 0x100); #define ps_fcb1 _u._u1._ps_fcb1 #define ps_fcb2 _u._u2._ps_fcb2