diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.c b/ndn-cpp/c/encoding/binary-xml-encoder.c
index 33f1696..d245f19 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.c
@@ -26,7 +26,7 @@
 static ndn_Error writeArray(struct ndn_BinaryXmlEncoder *self, unsigned char *array, unsigned int arrayLength)
 {
   ndn_Error error;
-  if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + arrayLength))
+  if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + arrayLength)))
     return error;
   
   ndn_memcpy(self->output.array + self->offset, array, arrayLength);
@@ -96,7 +96,7 @@
 {
   while (1) {
     ndn_Error error;
-    if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1))
+    if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1)))
       return error;
     
     self->output.array[self->offset++] = (unsigned char)(x % 10 + '0');
@@ -125,7 +125,7 @@
   unsigned int nBufferBytes = self->offset - startOffset;
   unsigned int nHeaderBytes = getNHeaderEncodingBytes(nBufferBytes);
   ndn_Error error;
-  if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + nHeaderBytes))
+  if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + nHeaderBytes)))
     return error;
   
   // To reverse and shift at the same time, we first shift nHeaderBytes to the destination while reversing,
@@ -141,7 +141,7 @@
   
   // Override the offset to force encodeTypeAndValue to encode at startOffset, then fix the offset.
   self->offset = startOffset;
-  if (error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_UDATA, nBufferBytes))
+  if ((error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_UDATA, nBufferBytes)))
     // We don't really expect to get an error, since we have already ensured the length.
     return error;
   self->offset = startOffset + nHeaderBytes + nBufferBytes;
@@ -178,7 +178,7 @@
 	// Encode backwards. Calculate how many bytes we need.
 	unsigned int nEncodingBytes = getNHeaderEncodingBytes(value);
   ndn_Error error;
-  if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + nEncodingBytes))
+  if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + nEncodingBytes)))
     return error;
 
 	// Bottom 4 bits of value go in last byte with tag.
@@ -207,7 +207,7 @@
 ndn_Error ndn_BinaryXmlEncoder_writeElementClose(struct ndn_BinaryXmlEncoder *self)
 {
   ndn_Error error;
-  if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1))
+  if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1)))
     return error;
   
 	self->output.array[self->offset] = ndn_BinaryXml_CLOSE;
@@ -219,10 +219,10 @@
 ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, unsigned char *value, unsigned int valueLength)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_BLOB, valueLength))
+  if ((error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_BLOB, valueLength)))
     return error;
   
-  if (error = writeArray(self, value, valueLength))
+  if ((error = writeArray(self, value, valueLength)))
     return error;
   
   return 0;
@@ -231,13 +231,13 @@
 ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, unsigned char *value, unsigned int valueLength)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeBlob(self, value, valueLength))
+  if ((error = ndn_BinaryXmlEncoder_writeBlob(self, value, valueLength)))
     return error;  
   
-  if (error = ndn_BinaryXmlEncoder_writeElementClose(self))
+  if ((error = ndn_BinaryXmlEncoder_writeElementClose(self)))
     return error;
   
   return 0;
@@ -249,10 +249,10 @@
   unsigned int startOffset = self->offset;
   
   ndn_Error error;
-  if (error = encodeReversedUnsignedDecimalInt(self, value))
+  if ((error = encodeReversedUnsignedDecimalInt(self, value)))
     return error;
   
-  if (error = reverseBufferAndInsertHeader(self, startOffset, ndn_BinaryXml_UDATA))
+  if ((error = reverseBufferAndInsertHeader(self, startOffset, ndn_BinaryXml_UDATA)))
     return error;
   
   return 0;
@@ -261,13 +261,13 @@
 ndn_Error ndn_BinaryXmlEncoder_writeUnsignedDecimalIntDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, unsigned int value)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeUnsignedDecimalInt(self, value))
+  if ((error = ndn_BinaryXmlEncoder_writeUnsignedDecimalInt(self, value)))
     return error;  
   
-  if (error = ndn_BinaryXmlEncoder_writeElementClose(self))
+  if ((error = ndn_BinaryXmlEncoder_writeElementClose(self)))
     return error;
   
   return 0;
@@ -283,7 +283,7 @@
   
   ndn_Error error;
   while (lo32 != 0) {
-    if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1))
+    if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1)))
       return error;
     
     self->output.array[self->offset++] = (unsigned char)(lo32 & 0xff);
@@ -293,7 +293,7 @@
   if (hi32 != 0) {
     // Pad the lo values out to 4 bytes.
     while (self->offset - startOffset < 4) {
-      if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1))
+      if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1)))
         return error;
     
       self->output.array[self->offset++] = 0;
@@ -301,7 +301,7 @@
     
     // Encode hi32
     while (hi32 != 0) {
-      if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1))
+      if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1)))
         return error;
     
       self->output.array[self->offset++] = (unsigned char)(hi32 & 0xff);
@@ -309,7 +309,7 @@
     }
   }
   
-  if (error = reverseBufferAndInsertHeader(self, startOffset, ndn_BinaryXml_BLOB))
+  if ((error = reverseBufferAndInsertHeader(self, startOffset, ndn_BinaryXml_BLOB)))
     return error;
   
   return 0;
@@ -318,13 +318,13 @@
 ndn_Error ndn_BinaryXmlEncoder_writeTimeMillisecondsDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, double milliseconds)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag)))
     return error;
    
-  if (error = ndn_BinaryXmlEncoder_writeAbsDoubleBigEndianBlob(self, (milliseconds / 1000.0) * 4096.0))
+  if ((error = ndn_BinaryXmlEncoder_writeAbsDoubleBigEndianBlob(self, (milliseconds / 1000.0) * 4096.0)))
     return error;
     
-  if (error = ndn_BinaryXmlEncoder_writeElementClose(self))
+  if ((error = ndn_BinaryXmlEncoder_writeElementClose(self)))
     return error;
   
   return 0;
