To avoid warnings on some compilers added extra parens to if ((error = func()))
diff --git a/ndn-cpp/transport/tcp-transport.cpp b/ndn-cpp/transport/tcp-transport.cpp
index e8c60ed..3742c97 100644
--- a/ndn-cpp/transport/tcp-transport.cpp
+++ b/ndn-cpp/transport/tcp-transport.cpp
@@ -15,7 +15,7 @@
void TcpTransport::connect(Face &face)
{
ndn_Error error;
- if (error = ndn_TcpTransport_connect(&transport_, (char *)face.getHost(), face.getPort()))
+ if ((error = ndn_TcpTransport_connect(&transport_, (char *)face.getHost(), face.getPort())))
throw std::runtime_error(ndn_getErrorString(error));
// TODO: This belongs in the socket listener.
@@ -31,7 +31,7 @@
void TcpTransport::send(const unsigned char *data, unsigned int dataLength)
{
ndn_Error error;
- if (error = ndn_TcpTransport_send(&transport_, (unsigned char *)data, dataLength))
+ if ((error = ndn_TcpTransport_send(&transport_, (unsigned char *)data, dataLength)))
throw std::runtime_error(ndn_getErrorString(error));
}
@@ -41,7 +41,7 @@
ndn_Error error;
unsigned char buffer[8000];
unsigned int nBytes;
- if (error = ndn_TcpTransport_receive(&transport_, buffer, sizeof(buffer), &nBytes))
+ if ((error = ndn_TcpTransport_receive(&transport_, buffer, sizeof(buffer), &nBytes)))
throw std::runtime_error(ndn_getErrorString(error));
ndn_BinaryXmlElementReader_onReceivedData(&elementReader_, buffer, nBytes);
@@ -54,7 +54,7 @@
void TcpTransport::close()
{
ndn_Error error;
- if (error = ndn_TcpTransport_close(&transport_))
+ if ((error = ndn_TcpTransport_close(&transport_)))
throw std::runtime_error(ndn_getErrorString(error));
}