Commit 9dba2435 authored by Mihai Moldovan's avatar Mihai Moldovan

nxcomp/src/ChannelEndPoint.cpp: don't use C-style casting in C++ code...

parent ae73fedf
...@@ -103,11 +103,11 @@ ChannelEndPoint::setSpec(const char *hostName, long port) { ...@@ -103,11 +103,11 @@ ChannelEndPoint::setSpec(const char *hostName, long port) {
if (hostName && strlen(hostName) && port >= 1) if (hostName && strlen(hostName) && port >= 1)
{ {
length = snprintf(NULL, 0, "tcp:%s:%ld", hostName, port); length = snprintf(NULL, 0, "tcp:%s:%ld", hostName, port);
spec_ = (char *)calloc(length + 1, sizeof(char)); spec_ = static_cast<char *>(calloc(length + 1, sizeof(char)));
snprintf(spec_, length+1, "tcp:%s:%ld", hostName, port); snprintf(spec_, length+1, "tcp:%s:%ld", hostName, port);
isTCP_ = true; isTCP_ = true;
} }
else setSpec((char*)NULL); else setSpec(static_cast<char*>(NULL));
} }
bool bool
...@@ -133,7 +133,7 @@ ChannelEndPoint::getSpec(char **socketUri) const { ...@@ -133,7 +133,7 @@ ChannelEndPoint::getSpec(char **socketUri) const {
if (length > 0) if (length > 0)
{ {
newSocketUri = (char *)calloc(length + 1, sizeof(char)); newSocketUri = static_cast<char *>(calloc(length + 1, sizeof(char)));
if (isUnixSocket()) if (isUnixSocket())
snprintf(newSocketUri, length+1, "unix:%s", unixPath); snprintf(newSocketUri, length+1, "unix:%s", unixPath);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment