From 25179e00d3c362de7286b6e89b5d6b9f2541487f Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 12 Jul 2018 09:37:43 -0400 Subject: [PATCH] Fix PtrByteDiff cast A quick testing pass that loaded the code with asserts caused a compile failure --- misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc.h b/misc.h index a80b3801..2d92a2fb 100644 --- a/misc.h +++ b/misc.h @@ -413,7 +413,7 @@ inline ptrdiff_t PtrDiff(const PTR pointer1, const PTR pointer2) template inline size_t PtrByteDiff(const PTR pointer1, const PTR pointer2) { - return (size_t)(static_cast(pointer1) - static_cast(pointer2)); + return (size_t)(reinterpret_cast(pointer1) - reinterpret_cast(pointer2)); } #if (!__STDC_WANT_SECURE_LIB__ && !defined(_MEMORY_S_DEFINED)) || defined(CRYPTOPP_WANT_SECURE_LIB)