[ 
https://issues.apache.org/jira/browse/GEODE-2494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15886945#comment-15886945
 ] 

ASF GitHub Bot commented on GEODE-2494:
---------------------------------------

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.


> Replace SpinLock class with C++11 style BasicLockable class, spinlock_mutex.
> ----------------------------------------------------------------------------
>
>                 Key: GEODE-2494
>                 URL: https://issues.apache.org/jira/browse/GEODE-2494
>             Project: Geode
>          Issue Type: Sub-task
>          Components: native client
>            Reporter: Jacob S. Barrett
>            Assignee: Jacob S. Barrett
>
> Replace {{SpinLock}} class with C++11 style 
> {{[BasicLockable|http://en.cppreference.com/w/cpp/concept/BasicLockable]}} 
> class, {{spinlock_mutex}}. You can find several public domain examples of how 
> to implement a {{spinlock_mutex}} that can be used with 
> {{[std::lock_guard|http://en.cppreference.com/w/cpp/thread/lock_guard]}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to