util-memory: Cast to intptr_t

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2019-09-05 18:09:33 +02:00
parent 4c44496b87
commit 2a4a3bf501
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ void* util::malloc_aligned(size_t align, size_t size)
void* ptr = malloc(asize); void* ptr = malloc(asize);
// Calculate actual aligned position // Calculate actual aligned position
intptr_t ptr_off = aligned_offset(align, reinterpret_cast<size_t>(ptr) + sizeof(void*)); intptr_t ptr_off = static_cast<intptr_t>(aligned_offset(align, reinterpret_cast<size_t>(ptr) + sizeof(void*)));
// Store actual pointer at ptr_off - sizeof(void*). // Store actual pointer at ptr_off - sizeof(void*).
*reinterpret_cast<intptr_t*>(ptr_off - sizeof(void*)) = reinterpret_cast<intptr_t>(ptr); *reinterpret_cast<intptr_t*>(ptr_off - sizeof(void*)) = reinterpret_cast<intptr_t>(ptr);