From 142cc4551ebbb4f826f63cbc40df40e05497cca3 Mon Sep 17 00:00:00 2001 From: stderr64 Date: Sun, 27 Oct 2024 21:16:06 +0200 Subject: Use C++ style type cast instead of C style type cast because this is C++ and not C --- cpp_alloc_test/alloctest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cpp_alloc_test/alloctest.cpp') diff --git a/cpp_alloc_test/alloctest.cpp b/cpp_alloc_test/alloctest.cpp index 065dcc1..651c9a3 100644 --- a/cpp_alloc_test/alloctest.cpp +++ b/cpp_alloc_test/alloctest.cpp @@ -20,11 +20,11 @@ class AllocTest{ std::cout << "Error: address is NULL\n"; return; } - if ( ((size_t)mem_addr << 8) >= 0x55000000000000 && ((size_t)mem_addr << 8) <= 0x5fffffffffffff ){ + if ( (reinterpret_cast(mem_addr) << 8) >= 0x55000000000000 && (reinterpret_cast(mem_addr) << 8) <= 0x5fffffffffffff ){ std::cout << "Address is in heap memory area (address is " << mem_addr << ")\n"; return; } - else if ( ((size_t)mem_addr << 8) >= 0x7f000000000000 ){ + else if ( (reinterpret_cast(mem_addr) << 8) >= 0x7f000000000000 ){ std::cout << "Address is in stack memory area (address is " << mem_addr << ")\n"; return; } -- cgit v1.2.3-86-g962b