From 86901205d0f5e8de2538096a84e412d668b6059b Mon Sep 17 00:00:00 2001 From: Fredrik Holmqvist Date: Wed, 25 Apr 2018 21:42:16 +0200 Subject: [PATCH] Avoid arithmetic operations on void pointers See what I did there? --- src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp b/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp index 2c435d4640..d9ca7a0a40 100644 --- a/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp +++ b/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp @@ -1117,7 +1117,7 @@ AcpiOsReadable(void *pointer, ACPI_SIZE length) if (id == B_ERROR) return false; if (get_area_info(id, &info) != B_OK) return false; return (info.protection & B_READ_AREA) != 0 && - pointer + length <= info.address + info.ram_size; + ((char *)pointer) + length <= info.address + info.ram_size; #endif } @@ -1150,7 +1150,7 @@ AcpiOsWritable(void *pointer, ACPI_SIZE length) if (get_area_info(id, &info) != B_OK) return false; return (info.protection & B_READ_AREA) != 0 && (info.protection & B_WRITE_AREA) != 0 && - pointer + length <= info.address + info.ram_size; + ((char *)pointer) + length <= info.address + info.ram_size; #endif }