Skip to content

Commit

Permalink
Macros: remove pointer math on a null pointer
Browse files Browse the repository at this point in the history
Causes warnings on some compilers and/or tools.
Changed ACPI_TO_POINTER to use ACPI_CAST_PTR instead of using
arithmetic.

Reported by: Qian Cai (cai@lca.pw).
  • Loading branch information
acpibob committed Jul 26, 2019
1 parent 2667516 commit 02bbca5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/include/actypes.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ typedef UINT64 ACPI_INTEGER;


/* Pointer/Integer type conversions */ /* Pointer/Integer type conversions */


#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) 0, (ACPI_SIZE) (i)) #define ACPI_TO_POINTER(i) ACPI_CAST_PTR (void, (ACPI_SIZE) (i))
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0) #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0)
#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0) #define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
Expand Down

0 comments on commit 02bbca5

Please sign in to comment.