From 65fdb34219f33b2871a532a38814ac4ebea10abc Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Tue, 7 Jan 2020 12:13:03 +0100 Subject: [lldb][NFC] Use static_cast instead of reinterpret_cast where possible Summary: There are a few places in LLDB where we do a `reinterpret_cast` for conversions that we could also do with `static_cast`. This patch moves all this code to `static_cast`. Reviewers: shafik, JDevlieghere, labath Reviewed By: labath Subscribers: arphaman, usaxena95, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72161 --- lldb/source/Utility/Environment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/source/Utility/Environment.cpp') diff --git a/lldb/source/Utility/Environment.cpp b/lldb/source/Utility/Environment.cpp index 14053360071..8cafd302461 100644 --- a/lldb/source/Utility/Environment.cpp +++ b/lldb/source/Utility/Environment.cpp @@ -13,7 +13,7 @@ using namespace lldb_private; char *Environment::Envp::make_entry(llvm::StringRef Key, llvm::StringRef Value) { const size_t size = Key.size() + 1 /*=*/ + Value.size() + 1 /*\0*/; - char *Result = reinterpret_cast( + char *Result = static_cast( Allocator.Allocate(sizeof(char) * size, alignof(char))); char *Next = Result; @@ -26,7 +26,7 @@ char *Environment::Envp::make_entry(llvm::StringRef Key, } Environment::Envp::Envp(const Environment &Env) { - Data = reinterpret_cast( + Data = static_cast( Allocator.Allocate(sizeof(char *) * (Env.size() + 1), alignof(char *))); char **Next = Data; for (const auto &KV : Env) -- cgit v1.2.3