From 860131cf963c89d10101e232d8b161647ff060ba Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Wed, 5 Feb 2020 20:21:32 -0600 Subject: [PATCH] fix Windows 32-bit compile for check-structures-sanity --- plugins/devel/check-structures-sanity.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/devel/check-structures-sanity.cpp b/plugins/devel/check-structures-sanity.cpp index 61a31c951..021a8c14c 100644 --- a/plugins/devel/check-structures-sanity.cpp +++ b/plugins/devel/check-structures-sanity.cpp @@ -172,7 +172,7 @@ bool Checker::check_access(void *base, type_identity *identity, size_t size) bool Checker::check_vtable(void *vtable, type_identity *identity) { - if (!check_access(PTR_ADD(vtable, -sizeof(void *)), identity, sizeof(void *))) + if (!check_access(PTR_ADD(vtable, -ptrdiff_t(sizeof(void *))), identity, sizeof(void *))) return false; char **info = *(reinterpret_cast(vtable) - 1); @@ -188,7 +188,7 @@ bool Checker::check_vtable(void *vtable, type_identity *identity) char *typeinfo = reinterpret_cast(base) + reinterpret_cast(info)[3]; char *name = typeinfo + 16; #else - char *name = reinterpret_cast(info)[3]; + char *name = reinterpret_cast(info) + 8; #endif #else if (!check_access(info + 1, identity, sizeof(void *))) @@ -474,17 +474,17 @@ void Checker::check_vector(void *base, container_identity *identity, type_identi if (vector.start > vector.finish) { local_ok = false; - FAIL("vector length is negative (" << (length / ssize_t(item_size)) << ")"); + FAIL("vector length is negative (" << (length / ptrdiff_t(item_size)) << ")"); } if (vector.start > vector.end_of_storage) { local_ok = false; - FAIL("vector capacity is negative (" << (capacity / ssize_t(item_size)) << ")"); + FAIL("vector capacity is negative (" << (capacity / ptrdiff_t(item_size)) << ")"); } else if (vector.finish > vector.end_of_storage) { local_ok = false; - FAIL("vector capacity (" << (capacity / ssize_t(item_size)) << ") is less than its length (" << (length / ssize_t(item_size)) << ")"); + FAIL("vector capacity (" << (capacity / ptrdiff_t(item_size)) << ") is less than its length (" << (length / ptrdiff_t(item_size)) << ")"); } size_t ulength = size_t(length);