Silence NULL pointer subtraction warning.

Use a pointer to address 1 instead.
This commit is contained in:
BearOso 2022-04-28 19:11:55 -05:00
parent d99f79bcc0
commit 6b5cd1d45a
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ enum
}; };
#define COUNT(ARRAY) (sizeof(ARRAY) / sizeof(ARRAY[0])) #define COUNT(ARRAY) (sizeof(ARRAY) / sizeof(ARRAY[0]))
#define Offset(field, structure) ((int) (((char *) (&(((structure) NULL)->field))) - ((char *) NULL))) #define Offset(field, structure) ((int) (((char *) (&(((structure) 1)->field))) - ((char *) 1)))
#define OFFSET(f) Offset(f, STRUCT *) #define OFFSET(f) Offset(f, STRUCT *)
#define DUMMY(f) Offset(f, struct Obsolete *) #define DUMMY(f) Offset(f, struct Obsolete *)
#define DELETED(f) (-1) #define DELETED(f) (-1)