From 9a8794faed3c6a7c80205122d73d93dcb376dd57 Mon Sep 17 00:00:00 2001 From: Stepan Khapugin Date: Tue, 5 Sep 2017 14:10:53 +0200 Subject: add a cast --- googletest/include/gtest/gtest-printers.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index fba7661..129fc68 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -137,7 +137,8 @@ class TypeWithoutFormatter { public: // This default version is called when kTypeKind is kOtherType. static void PrintValue(const T& value, ::std::ostream* os) { - PrintBytesInObjectTo(reinterpret_cast(&value), + PrintBytesInObjectTo(reinterpret_cast( + reinterpret_cast(&value)), sizeof(value), os); } }; -- cgit v0.12 From cf512a099cd59a05ff981db778d08ab3cf143969 Mon Sep 17 00:00:00 2001 From: "stkhapugin@chromium.org" Date: Tue, 19 Sep 2017 12:44:52 +0200 Subject: Swap reinterpret_cast for static_cast Swap reinterpret_cast for static_cast --- googletest/include/gtest/gtest-printers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 129fc68..282a2da 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -137,8 +137,8 @@ class TypeWithoutFormatter { public: // This default version is called when kTypeKind is kOtherType. static void PrintValue(const T& value, ::std::ostream* os) { - PrintBytesInObjectTo(reinterpret_cast( - reinterpret_cast(&value)), + PrintBytesInObjectTo(static_cast( + reinterpret_cast(&value)), sizeof(value), os); } }; -- cgit v0.12