[Cleanup] safe cast int to void* (#35557)

Landing https://github.com/grpc/grpc/pull/34775

Closes #35557

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35557 from veblush:pr-34775 e86a90ee52
PiperOrigin-RevId: 599930342
pull/35530/head
Esun Kim 10 months ago committed by Copybara-Service
parent 32c5d1c160
commit 3a8360dba8
  1. 4
      src/core/lib/channel/channel_args.h

@ -326,7 +326,9 @@ class ChannelArgs {
class Value {
public:
explicit Value(int n) : rep_(reinterpret_cast<void*>(n), &int_vtable_) {}
explicit Value(int n)
: rep_(reinterpret_cast<void*>(static_cast<intptr_t>(n)),
&int_vtable_) {}
explicit Value(std::string s)
: rep_(RefCountedString::Make(s).release(), &string_vtable_) {}
explicit Value(Pointer p) : rep_(std::move(p)) {}

Loading…
Cancel
Save