summaryrefslogtreecommitdiff
path: root/cpp_alloc_test/alloctest.cpp
diff options
context:
space:
mode:
authorstderr64 <stderr64@null.net>2024-10-27 21:16:06 +0200
committerstderr64 <stderr64@null.net>2024-10-27 21:16:06 +0200
commit142cc4551ebbb4f826f63cbc40df40e05497cca3 (patch)
treeae9cdb6a4c8ecd655401b17ae59857db8fb2adf8 /cpp_alloc_test/alloctest.cpp
parentaee8e2534d38d83c4afee8112d5030e4de8c8ad5 (diff)
downloadexperiments-142cc4551ebbb4f826f63cbc40df40e05497cca3.tar.gz
experiments-142cc4551ebbb4f826f63cbc40df40e05497cca3.tar.zst
Use C++ style type cast instead of C style type cast because this is C++ and not C
Diffstat (limited to 'cpp_alloc_test/alloctest.cpp')
-rw-r--r--cpp_alloc_test/alloctest.cpp4
1 files changed, 2 insertions, 2 deletions
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<size_t>(mem_addr) << 8) >= 0x55000000000000 && (reinterpret_cast<size_t>(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<size_t>(mem_addr) << 8) >= 0x7f000000000000 ){
std::cout << "Address is in stack memory area (address is " << mem_addr << ")\n";
return;
}