Github user pivotal-jbarrett commented on a diff in the pull request:

    https://github.com/apache/geode-native/pull/36#discussion_r103351422
  
    --- Diff: src/tests/cpp/security/Security.cpp ---
    @@ -1014,12 +1016,15 @@ int32_t Security::doEntryOperations() {
                     reinterpret_cast<const unsigned char *>(valBuf),
                     static_cast<int32_t>(strlen(valBuf)));
                 int32_t *val =
    -                (int32_t *)(dynCast<CacheableBytesPtr>(tmpValue)->value());
    +                const_cast<int32_t *>(reinterpret_cast<const int32_t *>(
    +                    dynCast<CacheableBytesPtr>(tmpValue)->value()));
    --- End diff --
    
    `dynCast` is something Geode does to unwrap and rewrap the nasty 
`SharedPtr` so I am not going to touch that. The `const_cast<int32_t 
*>(reinterpret_cast<const int32_t *>` is the real change here to do the C++ 
version of `(int32_t*)` in the original. `dynCast` results in a `const X *`, so 
the obvious `reinterpret_cast<Y &*>` is actually a compiler error because 
`reinterpret_cast` can not drop modifiers like `const`. The `const_cast` then 
drops the modifier.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to