summaryrefslogtreecommitdiff
path: root/matlab/src/Endpoint.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-10-13 18:41:38 +0200
committerJose <jose@zeroc.com>2017-10-13 18:41:38 +0200
commitd46f067bb9efca15b3fc69ed81d54dbe59d6686e (patch)
tree5f5fab14cbf919c64a272a25944bbcefb324726a /matlab/src/Endpoint.cpp
parentRemove extra ICE_MATLAB_API macros (diff)
downloadice-d46f067bb9efca15b3fc69ed81d54dbe59d6686e.tar.bz2
ice-d46f067bb9efca15b3fc69ed81d54dbe59d6686e.tar.xz
ice-d46f067bb9efca15b3fc69ed81d54dbe59d6686e.zip
Replace SELF/DEREF macros with deref template function
Diffstat (limited to 'matlab/src/Endpoint.cpp')
-rw-r--r--matlab/src/Endpoint.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/matlab/src/Endpoint.cpp b/matlab/src/Endpoint.cpp
index 5ae253c8ee3..f18d4824433 100644
--- a/matlab/src/Endpoint.cpp
+++ b/matlab/src/Endpoint.cpp
@@ -12,9 +12,6 @@
#include "Endpoint.h"
#include "Util.h"
-#define DEREF(x) (*(reinterpret_cast<shared_ptr<Ice::Endpoint>*>(x)))
-#define SELF DEREF(self)
-
using namespace std;
using namespace IceMatlab;
@@ -24,12 +21,6 @@ IceMatlab::createEndpoint(shared_ptr<Ice::Endpoint> p)
return new shared_ptr<Ice::Endpoint>(move(p));
}
-shared_ptr<Ice::Endpoint>
-IceMatlab::getEndpoint(void* p)
-{
- return DEREF(p);
-}
-
namespace
{
@@ -151,7 +142,7 @@ extern "C"
mxArray*
Ice_Endpoint_unref(void* self)
{
- delete &SELF;
+ delete reinterpret_cast<shared_ptr<Ice::Endpoint>*>(self);
return 0;
}
@@ -161,7 +152,8 @@ Ice_Endpoint_equals(void* self, void* other)
assert(other); // Wrapper only calls this function for non-nil arguments.
try
{
- return createResultValue(createBool(Ice::targetEqualTo(SELF, DEREF(other))));
+ return createResultValue(createBool(Ice::targetEqualTo(deref<Ice::Endpoint>(self),
+ deref<Ice::Endpoint>(other))));
}
catch(const std::exception& ex)
{
@@ -174,7 +166,7 @@ Ice_Endpoint_toString(void* self)
{
try
{
- return createResultValue(createStringFromUTF8(SELF->toString()));
+ return createResultValue(createStringFromUTF8(deref<Ice::Endpoint>(self)->toString()));
}
catch(const std::exception& ex)
{
@@ -187,7 +179,7 @@ Ice_Endpoint_getInfo(void* self)
{
try
{
- shared_ptr<Ice::EndpointInfo> info = SELF->getInfo();
+ shared_ptr<Ice::EndpointInfo> info = deref<Ice::Endpoint>(self)->getInfo();
return createResultValue(createInfo(info));
}
catch(const std::exception& ex)