From 472c43bcd4206c8c5660ddd1551702dcc69f9ed3 Mon Sep 17 00:00:00 2001 From: SASANO Takayoshi Date: Sun, 26 Nov 2023 18:25:31 +0900 Subject: [PATCH] replace sOffset -> offsetof --- include/dos_inc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dos_inc.h b/include/dos_inc.h index d0e7209541b..55244b53529 100644 --- a/include/dos_inc.h +++ b/include/dos_inc.h @@ -390,7 +390,7 @@ static INLINE uint16_t DOS_PackDate(uint16_t year,uint16_t mon,uint16_t day) { /* Remains some classes used to access certain things */ -#define sOffset(s,m) ((char*)&(((s*)NULL)->m)-(char*)NULL) +#define sOffset(s,m) offsetof(s,m) #define sGet(s,m) GetIt(sizeof(((s *)&pt)->m),(PhysPt)sOffset(s,m)) #define sSave(s,m,val) SaveIt(sizeof(((s *)&pt)->m),(PhysPt)sOffset(s,m),val)