Snes9x - Silence NULL pointer subtraction warning. (#1056)

Use a pointer to address 1 instead.
This commit is contained in:
bladeoner 2023-03-15 17:28:33 +01:00 committed by GitHub
parent c0103d65de
commit 6844bb0dd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)