diff --git a/ndn-cpp/c/encoding/binary-xml-data.c b/ndn-cpp/c/encoding/binary-xml-data.c
index 776ca74..c02ca70 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.c
+++ b/ndn-cpp/c/encoding/binary-xml-data.c
@@ -13,21 +13,21 @@
 static ndn_Error encodeSignature(struct ndn_Signature *signature, struct ndn_BinaryXmlEncoder *encoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Signature))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Signature)))
     return error;
   
   // TODO: Check if digestAlgorithm is the same as the default, and skip it, otherwise encode it as UDATA.
 
-  if (error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_Witness, signature->witness, signature->witnessLength))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
+      (encoder, ndn_BinaryXml_DTag_Witness, signature->witness, signature->witnessLength)))
     return error;
 
   // Require a signature.
-  if (error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_SignatureBits, signature->signature, signature->signatureLength))
+  if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
+      (encoder, ndn_BinaryXml_DTag_SignatureBits, signature->signature, signature->signatureLength)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeElementClose(encoder))
+  if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
     return error;
   
   return 0;    
@@ -36,21 +36,21 @@
 static ndn_Error decodeSignature(struct ndn_Signature *signature, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Signature))
+  if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Signature)))
     return error;
   
   /* TODO: digestAlgorithm as UDATA */ signature->digestAlgorithm = 0; signature->digestAlgorithmLength = 0;
   
-  if (error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_Witness, 0, &signature->witness, &signature->witnessLength))
+  if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
+      (decoder, ndn_BinaryXml_DTag_Witness, 0, &signature->witness, &signature->witnessLength)))
     return error;
   
   // Require a signature.
-  if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_SignatureBits, 0, &signature->signature, &signature->signatureLength))
+  if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
+      (decoder, ndn_BinaryXml_DTag_SignatureBits, 0, &signature->signature, &signature->signatureLength)))
     return error;
   
-  if (error = ndn_BinaryXmlDecoder_readElementClose(decoder))
+  if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
     return error;
   
   return 0;
@@ -62,15 +62,15 @@
     return 0;
 
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_SignedInfo))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_SignedInfo)))
     return error;
 
   // This will skip encoding if there is no publisherPublicKeyDigest.
-  if (error = ndn_encodeBinaryXmlPublisherPublicKeyDigest(&signedInfo->publisherPublicKeyDigest, encoder))
+  if ((error = ndn_encodeBinaryXmlPublisherPublicKeyDigest(&signedInfo->publisherPublicKeyDigest, encoder)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeOptionalTimeMillisecondsDTagElement
-      (encoder, ndn_BinaryXml_DTag_Timestamp, signedInfo->timestampMilliseconds))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalTimeMillisecondsDTagElement
+      (encoder, ndn_BinaryXml_DTag_Timestamp, signedInfo->timestampMilliseconds)))
     return error;
   
   if (signedInfo->type != ndn_ContentType_DATA) {
@@ -78,19 +78,19 @@
     // TODO: Implement converting the type from an int and encoding.
   }
   
-  if (error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
-      (encoder, ndn_BinaryXml_DTag_FreshnessSeconds, signedInfo->freshnessSeconds))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
+      (encoder, ndn_BinaryXml_DTag_FreshnessSeconds, signedInfo->freshnessSeconds)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_FinalBlockID, signedInfo->finalBlockID, signedInfo->finalBlockIDLength))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
+      (encoder, ndn_BinaryXml_DTag_FinalBlockID, signedInfo->finalBlockID, signedInfo->finalBlockIDLength)))
     return error;
  
   // This will skip encoding if there is no key locator.
-  if (error = ndn_encodeBinaryXmlKeyLocator(&signedInfo->keyLocator, encoder))
+  if ((error = ndn_encodeBinaryXmlKeyLocator(&signedInfo->keyLocator, encoder)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeElementClose(encoder))
+  if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
     return error;
   
   return 0;  
@@ -99,10 +99,10 @@
 static ndn_Error decodeSignedInfo(struct ndn_SignedInfo *signedInfo, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_SignedInfo))
+  if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_SignedInfo)))
     return error;
   
-  if (error = ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest(&signedInfo->publisherPublicKeyDigest, decoder))
+  if ((error = ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest(&signedInfo->publisherPublicKeyDigest, decoder)))
     return error;
   
   if (error= ndn_BinaryXmlDecoder_readOptionalTimeMillisecondsDTagElement
@@ -112,18 +112,18 @@
   // TODO: Implement reading the type and converting to an int.
   signedInfo->type = ndn_ContentType_DATA;
  
-  if (error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
-      (decoder, ndn_BinaryXml_DTag_FreshnessSeconds, &signedInfo->freshnessSeconds))
+  if ((error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
+      (decoder, ndn_BinaryXml_DTag_FreshnessSeconds, &signedInfo->freshnessSeconds)))
     return error;
 
-  if (error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_FinalBlockID, 0, &signedInfo->finalBlockID, &signedInfo->finalBlockIDLength))
+  if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
+      (decoder, ndn_BinaryXml_DTag_FinalBlockID, 0, &signedInfo->finalBlockID, &signedInfo->finalBlockIDLength)))
     return error;
 
-  if (error = ndn_decodeOptionalBinaryXmlKeyLocator(&signedInfo->keyLocator, decoder))
+  if ((error = ndn_decodeOptionalBinaryXmlKeyLocator(&signedInfo->keyLocator, decoder)))
     return error;
   
-  if (error = ndn_BinaryXmlDecoder_readElementClose(decoder))
+  if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
     return error;
   
   return 0;
@@ -132,23 +132,23 @@
 ndn_Error ndn_encodeBinaryXmlData(struct ndn_Data *data, struct ndn_BinaryXmlEncoder *encoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_ContentObject))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_ContentObject)))
     return error;
   
-  if (error = encodeSignature(&data->signature, encoder))
+  if ((error = encodeSignature(&data->signature, encoder)))
     return 0;
 
-  if (error = ndn_encodeBinaryXmlName(&data->name, encoder))
+  if ((error = ndn_encodeBinaryXmlName(&data->name, encoder)))
     return error;
 
-  if (error = encodeSignedInfo(&data->signedInfo, encoder))
+  if ((error = encodeSignedInfo(&data->signedInfo, encoder)))
     return 0;
 
-  if (error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_Content, data->content, data->contentLength))
+  if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
+      (encoder, ndn_BinaryXml_DTag_Content, data->content, data->contentLength)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeElementClose(encoder))
+  if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
     return error;
   
   return 0;
@@ -157,37 +157,37 @@
 ndn_Error ndn_decodeBinaryXmlData(struct ndn_Data *data, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_ContentObject))
+  if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_ContentObject)))
     return error;
 
   int gotExpectedTag;
-  if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Signature, &gotExpectedTag))
+  if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Signature, &gotExpectedTag)))
     return error;
   if (gotExpectedTag) {
-    if (error = decodeSignature(&data->signature, decoder))
+    if ((error = decodeSignature(&data->signature, decoder)))
       return error;
   }
   else
     ndn_Signature_init(&data->signature);
   
-  if (error = ndn_decodeBinaryXmlName(&data->name, decoder))
+  if ((error = ndn_decodeBinaryXmlName(&data->name, decoder)))
     return error;
   
-  if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_SignedInfo, &gotExpectedTag))
+  if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_SignedInfo, &gotExpectedTag)))
     return error;
   if (gotExpectedTag) {
-    if (error = decodeSignedInfo(&data->signedInfo, decoder))
+    if ((error = decodeSignedInfo(&data->signedInfo, decoder)))
       return error;
   }
   else
     ndn_SignedInfo_init(&data->signedInfo);
 
   // Require a Content element, but set allowNull to allow a missing BLOB.
-  if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_Content, 1, &data->content, &data->contentLength))
+  if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
+      (decoder, ndn_BinaryXml_DTag_Content, 1, &data->content, &data->contentLength)))
     return error; 
   
-  if (error = ndn_BinaryXmlDecoder_readElementClose(decoder))
+  if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
     return error;
   
   return 0;
diff --git a/ndn-cpp/c/encoding/binary-xml-decoder.c b/ndn-cpp/c/encoding/binary-xml-decoder.c
index a6d7bfa..1d50461 100644
--- a/ndn-cpp/c/encoding/binary-xml-decoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-decoder.c
@@ -88,7 +88,7 @@
   ndn_Error error;
   unsigned int type;
   unsigned int value;
-  if (error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &type, &value))
+  if ((error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &type, &value)))
     return error;
   
   if (type != ndn_BinaryXml_DTAG)
@@ -142,7 +142,7 @@
   (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, unsigned char **value, unsigned int *valueLength)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag))
+  if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag)))
     return error;
   
   if (allowNull) {
@@ -159,13 +159,13 @@
   }
   
   unsigned int itemType;
-  if (error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &itemType, valueLength))
+  if ((error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &itemType, valueLength)))
     return error;
   // Ignore itemType.
   *value = self->input + self->offset;
   self->offset += *valueLength;
   
-  if (error = ndn_BinaryXmlDecoder_readElementClose(self))
+  if ((error = ndn_BinaryXmlDecoder_readElementClose(self)))
     return error;
   
   return 0;
@@ -176,10 +176,10 @@
 {
   ndn_Error error;
   int gotExpectedTag;
-  if (error = ndn_BinaryXmlDecoder_peekDTag(self, expectedTag, &gotExpectedTag))
+  if ((error = ndn_BinaryXmlDecoder_peekDTag(self, expectedTag, &gotExpectedTag)))
     return error;
   if (gotExpectedTag) {
-    if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, allowNull, value, valueLength))
+    if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, allowNull, value, valueLength)))
       return error;
   }
   else {
@@ -194,18 +194,18 @@
   (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, unsigned char **value, unsigned int *valueLength)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag))
+  if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag)))
     return error;
     
   unsigned int itemType;
-  if (error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &itemType, valueLength))
+  if ((error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &itemType, valueLength)))
     return error;
   if (itemType != ndn_BinaryXml_UDATA)
     return NDN_ERROR_item_is_not_UDATA;
   *value = self->input + self->offset;
   self->offset += *valueLength;
   
-  if (error = ndn_BinaryXmlDecoder_readElementClose(self))
+  if ((error = ndn_BinaryXmlDecoder_readElementClose(self)))
     return error;
   
   return 0;
@@ -217,10 +217,10 @@
   unsigned char *udataValue;
   unsigned int udataValueLength;
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readUDataDTagElement(self, expectedTag, &udataValue, &udataValueLength))
+  if ((error = ndn_BinaryXmlDecoder_readUDataDTagElement(self, expectedTag, &udataValue, &udataValueLength)))
     return error;
   
-  if (error = parseUnsignedDecimalInt(udataValue, udataValueLength, value))
+  if ((error = parseUnsignedDecimalInt(udataValue, udataValueLength, value)))
     return error;
   
   return 0;
@@ -231,7 +231,7 @@
 {
   int gotExpectedTag;
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_peekDTag(self, expectedTag, &gotExpectedTag))
+  if ((error = ndn_BinaryXmlDecoder_peekDTag(self, expectedTag, &gotExpectedTag)))
     return error;
     
   if (!gotExpectedTag) {
@@ -240,7 +240,7 @@
   }
 
   unsigned int unsignedValue;
-  if (error = ndn_BinaryXmlDecoder_readUnsignedIntegerDTagElement(self, expectedTag, &unsignedValue))
+  if ((error = ndn_BinaryXmlDecoder_readUnsignedIntegerDTagElement(self, expectedTag, &unsignedValue)))
     return error;
   
   *value = (int)unsignedValue;
@@ -253,7 +253,7 @@
   ndn_Error error;
   unsigned char *bytes;
   unsigned int bytesLength;
-  if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, 0, &bytes, &bytesLength))
+  if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, 0, &bytes, &bytesLength)))
     return error;
     
   *milliseconds = 1000.0 * ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(bytes, bytesLength) / 4096.0;
@@ -265,7 +265,7 @@
 {
   int gotExpectedTag;
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_peekDTag(self, expectedTag, &gotExpectedTag))
+  if ((error = ndn_BinaryXmlDecoder_peekDTag(self, expectedTag, &gotExpectedTag)))
     return error;
     
   if (!gotExpectedTag) {
@@ -273,7 +273,7 @@
     return 0;
   }
 
-  if (error = ndn_BinaryXmlDecoder_readTimeMillisecondsDTagElement(self, expectedTag, milliseconds))
+  if ((error = ndn_BinaryXmlDecoder_readTimeMillisecondsDTagElement(self, expectedTag, milliseconds)))
     return error;
   
   return 0;
diff --git a/ndn-cpp/c/encoding/binary-xml-element-reader.c b/ndn-cpp/c/encoding/binary-xml-element-reader.c
index 4bbd081..110b496 100644
--- a/ndn-cpp/c/encoding/binary-xml-element-reader.c
+++ b/ndn-cpp/c/encoding/binary-xml-element-reader.c
@@ -14,7 +14,7 @@
     ndn_BinaryXmlStructureDecoder_seek(&self->structureDecoder, 0);
     
     ndn_Error error;
-    if (error = ndn_BinaryXmlStructureDecoder_findElementEnd(&self->structureDecoder, data, dataLength))
+    if ((error = ndn_BinaryXmlStructureDecoder_findElementEnd(&self->structureDecoder, data, dataLength)))
       return error;
     if (self->structureDecoder.gotElementEnd) {
       // Got the remainder of an element.  Report to the caller.
@@ -24,7 +24,7 @@
 #endif
       if (self->usePartialData) {
         // We have partial data from a previous call, so append this data and point to partialData.
-        if (error = ndn_DynamicUCharArray_set(&self->partialData, data, self->structureDecoder.offset, self->partialDataLength))
+        if ((error = ndn_DynamicUCharArray_set(&self->partialData, data, self->structureDecoder.offset, self->partialDataLength)))
           return error;
         self->partialDataLength += dataLength;
                 
@@ -53,7 +53,7 @@
         self->partialDataLength = 0;
       }
       
-      if (error = ndn_DynamicUCharArray_set(&self->partialData, data, dataLength, self->partialDataLength))
+      if ((error = ndn_DynamicUCharArray_set(&self->partialData, data, dataLength, self->partialDataLength)))
         return error;
       self->partialDataLength += dataLength;
       
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;
diff --git a/ndn-cpp/c/encoding/binary-xml-interest.c b/ndn-cpp/c/encoding/binary-xml-interest.c
index 45e855b..7c90a1b 100644
--- a/ndn-cpp/c/encoding/binary-xml-interest.c
+++ b/ndn-cpp/c/encoding/binary-xml-interest.c
@@ -16,7 +16,7 @@
     return 0;
   
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Exclude))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Exclude)))
     return error;
   
   // TODO: Do we want to order the components (except for ANY)?
@@ -25,21 +25,21 @@
     struct ndn_ExcludeEntry *entry = &exclude->entries[i];
     
     if (entry->type == ndn_Exclude_COMPONENT) {
-      if (error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-          (encoder, ndn_BinaryXml_DTag_Component, entry->component, entry->componentLength))
+      if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
+          (encoder, ndn_BinaryXml_DTag_Component, entry->component, entry->componentLength)))
         return error;
     }
     else if (entry->type == ndn_Exclude_ANY) {
-      if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Any))
+      if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Any)))
         return error;
-    	if (error = ndn_BinaryXmlEncoder_writeElementClose(encoder))
+    	if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
         return error;
     }
     else
       return NDN_ERROR_unrecognized_ndn_ExcludeType;
 	}
   
-	if (error = ndn_BinaryXmlEncoder_writeElementClose(encoder))
+	if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
     return error;
   
   return 0;  
@@ -48,20 +48,20 @@
 static ndn_Error decodeExclude(struct ndn_Exclude *exclude, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Exclude))
+  if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Exclude)))
     return error;
     
   exclude->nEntries = 0;
   while (1) {
     int gotExpectedTag;
     
-    if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Component, &gotExpectedTag))
+    if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Component, &gotExpectedTag)))
       return error;    
     if (gotExpectedTag) {
       // Component
       unsigned char *component;
       unsigned int componentLen;
-      if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component, &componentLen))
+      if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component, &componentLen)))
         return error;
     
       // Add the component entry.
@@ -73,13 +73,13 @@
       continue;
     }
     
-    if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Any, &gotExpectedTag))
+    if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Any, &gotExpectedTag)))
       return error;    
     if (gotExpectedTag) {
       // Any
-      if (error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Any))
+      if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Any)))
         return error;
-      if (error = ndn_BinaryXmlDecoder_readElementClose(decoder))
+      if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
         return error;
     
       // Add the any entry.
@@ -91,13 +91,13 @@
       continue;
     }
     
-    if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Bloom, &gotExpectedTag))
+    if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Bloom, &gotExpectedTag)))
       return error;    
     if (gotExpectedTag) {
       // Skip the Bloom and treat it as Any.
       unsigned char *value;
       unsigned int valueLen;
-      if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Bloom, 0, &value, &valueLen))
+      if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Bloom, 0, &value, &valueLen)))
         return error;
     
       // Add the any entry.
@@ -113,7 +113,7 @@
     break;
   }
   
-  if (error = ndn_BinaryXmlDecoder_readElementClose(decoder))
+  if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
     return error;
   
   return 0;
@@ -122,48 +122,48 @@
 ndn_Error ndn_encodeBinaryXmlInterest(struct ndn_Interest *interest, struct ndn_BinaryXmlEncoder *encoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Interest))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Interest)))
     return error;
     
-  if (error = ndn_encodeBinaryXmlName(&interest->name, encoder))
+  if ((error = ndn_encodeBinaryXmlName(&interest->name, encoder)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
-      (encoder, ndn_BinaryXml_DTag_MinSuffixComponents, interest->minSuffixComponents))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
+      (encoder, ndn_BinaryXml_DTag_MinSuffixComponents, interest->minSuffixComponents)))
     return error;
-  if (error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
-      (encoder, ndn_BinaryXml_DTag_MaxSuffixComponents, interest->maxSuffixComponents))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
+      (encoder, ndn_BinaryXml_DTag_MaxSuffixComponents, interest->maxSuffixComponents)))
     return error;
     
   // This will skip encoding if there is no publisherPublicKeyDigest.
-  if (error = ndn_encodeBinaryXmlPublisherPublicKeyDigest(&interest->publisherPublicKeyDigest, encoder))
+  if ((error = ndn_encodeBinaryXmlPublisherPublicKeyDigest(&interest->publisherPublicKeyDigest, encoder)))
     return error;
   
   // This will skip encoding if there is no exclude.
-  if (error = encodeExclude(&interest->exclude, encoder))
+  if ((error = encodeExclude(&interest->exclude, encoder)))
     return error;
 
-  if (error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
-      (encoder, ndn_BinaryXml_DTag_ChildSelector, interest->childSelector))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
+      (encoder, ndn_BinaryXml_DTag_ChildSelector, interest->childSelector)))
     return error;
   if (interest->answerOriginKind >= 0 && interest->answerOriginKind != ndn_Interest_DEFAULT_ANSWER_ORIGIN_KIND) {
-    if (error = ndn_BinaryXmlEncoder_writeUnsignedDecimalIntDTagElement
-        (encoder, ndn_BinaryXml_DTag_AnswerOriginKind, (unsigned int)interest->answerOriginKind))
+    if ((error = ndn_BinaryXmlEncoder_writeUnsignedDecimalIntDTagElement
+        (encoder, ndn_BinaryXml_DTag_AnswerOriginKind, (unsigned int)interest->answerOriginKind)))
       return error;
   }
-  if (error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
-      (encoder, ndn_BinaryXml_DTag_Scope, interest->scope))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement
+      (encoder, ndn_BinaryXml_DTag_Scope, interest->scope)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeOptionalTimeMillisecondsDTagElement
-      (encoder, ndn_BinaryXml_DTag_InterestLifetime, interest->interestLifetimeMilliseconds))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalTimeMillisecondsDTagElement
+      (encoder, ndn_BinaryXml_DTag_InterestLifetime, interest->interestLifetimeMilliseconds)))
     return error;
   
-  if (error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_Nonce, interest->nonce, interest->nonceLength))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
+      (encoder, ndn_BinaryXml_DTag_Nonce, interest->nonce, interest->nonceLength)))
     return error;
   
-	if (error = ndn_BinaryXmlEncoder_writeElementClose(encoder))
+	if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
     return error;
   
   return 0;  
@@ -172,51 +172,51 @@
 ndn_Error ndn_decodeBinaryXmlInterest(struct ndn_Interest *interest, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Interest))
+  if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Interest)))
     return error;
     
-  if (error = ndn_decodeBinaryXmlName(&interest->name, decoder))
+  if ((error = ndn_decodeBinaryXmlName(&interest->name, decoder)))
     return error;
        
-  if (error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
-      (decoder, ndn_BinaryXml_DTag_MinSuffixComponents, &interest->minSuffixComponents))
+  if ((error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
+      (decoder, ndn_BinaryXml_DTag_MinSuffixComponents, &interest->minSuffixComponents)))
     return error;
-  if (error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
-      (decoder, ndn_BinaryXml_DTag_MaxSuffixComponents, &interest->maxSuffixComponents))
+  if ((error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
+      (decoder, ndn_BinaryXml_DTag_MaxSuffixComponents, &interest->maxSuffixComponents)))
     return error;
   
-  if (error = ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest(&interest->publisherPublicKeyDigest, decoder))
+  if ((error = ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest(&interest->publisherPublicKeyDigest, decoder)))
     return error;
   
   int gotExpectedTag;
-  if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Exclude, &gotExpectedTag))
+  if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Exclude, &gotExpectedTag)))
     return error;
   if (gotExpectedTag) {
-    if (error = decodeExclude(&interest->exclude, decoder))
+    if ((error = decodeExclude(&interest->exclude, decoder)))
       return error;
   }
   else
     interest->exclude.nEntries = 0;
   
-  if (error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
-      (decoder, ndn_BinaryXml_DTag_ChildSelector, &interest->childSelector))
+  if ((error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
+      (decoder, ndn_BinaryXml_DTag_ChildSelector, &interest->childSelector)))
     return error;
-  if (error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
-      (decoder, ndn_BinaryXml_DTag_AnswerOriginKind, &interest->answerOriginKind))
+  if ((error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
+      (decoder, ndn_BinaryXml_DTag_AnswerOriginKind, &interest->answerOriginKind)))
     return error;
-  if (error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
-      (decoder, ndn_BinaryXml_DTag_Scope, &interest->scope))
+  if ((error = ndn_BinaryXmlDecoder_readOptionalUnsignedIntegerDTagElement
+      (decoder, ndn_BinaryXml_DTag_Scope, &interest->scope)))
     return error;
   
   if (error= ndn_BinaryXmlDecoder_readOptionalTimeMillisecondsDTagElement
       (decoder, ndn_BinaryXml_DTag_InterestLifetime, &interest->interestLifetimeMilliseconds))
     return error;
   
-  if (error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_Nonce, 0, &interest->nonce, &interest->nonceLength))
+  if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
+      (decoder, ndn_BinaryXml_DTag_Nonce, 0, &interest->nonce, &interest->nonceLength)))
     return error;
 
-  if (error = ndn_BinaryXmlDecoder_readElementClose(decoder))
+  if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
     return error;
   
   return 0;
diff --git a/ndn-cpp/c/encoding/binary-xml-key.c b/ndn-cpp/c/encoding/binary-xml-key.c
index c26adba..554c88d 100644
--- a/ndn-cpp/c/encoding/binary-xml-key.c
+++ b/ndn-cpp/c/encoding/binary-xml-key.c
@@ -14,17 +14,17 @@
     return 0;
 
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_KeyLocator))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_KeyLocator)))
     return error;
 
   if (keyLocator->type == ndn_KeyLocatorType_KEY) {
-    if (error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-        (encoder, ndn_BinaryXml_DTag_Key, keyLocator->keyOrCertificate, keyLocator->keyOrCertificateLength))
+    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
+        (encoder, ndn_BinaryXml_DTag_Key, keyLocator->keyOrCertificate, keyLocator->keyOrCertificateLength)))
       return error;    
   }
   else if (keyLocator->type == ndn_KeyLocatorType_CERTIFICATE) {
-    if (error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-        (encoder, ndn_BinaryXml_DTag_Certificate, keyLocator->keyOrCertificate, keyLocator->keyOrCertificateLength))
+    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
+        (encoder, ndn_BinaryXml_DTag_Certificate, keyLocator->keyOrCertificate, keyLocator->keyOrCertificateLength)))
       return error;    
   }
   else if (keyLocator->type == ndn_KeyLocatorType_KEYNAME) {
@@ -33,7 +33,7 @@
   else
     return NDN_ERROR_unrecognized_ndn_KeyLocatorType;
   
-	if (error = ndn_BinaryXmlEncoder_writeElementClose(encoder))
+	if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
     return error;
   
   return 0;
@@ -42,31 +42,31 @@
 ndn_Error ndn_decodeBinaryXmlKeyLocator(struct ndn_KeyLocator *keyLocator, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_KeyLocator))
+  if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_KeyLocator)))
     return error;
 
   int gotExpectedTag;
-  if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Key, &gotExpectedTag))
+  if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Key, &gotExpectedTag)))
     return error;
   if (gotExpectedTag) {
     keyLocator->type = ndn_KeyLocatorType_KEY;
     
-    if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-        (decoder, ndn_BinaryXml_DTag_Key, 0, &keyLocator->keyOrCertificate, &keyLocator->keyOrCertificateLength))
+    if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
+        (decoder, ndn_BinaryXml_DTag_Key, 0, &keyLocator->keyOrCertificate, &keyLocator->keyOrCertificateLength)))
       return error;
   }
   else {
-    if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Certificate, &gotExpectedTag))
+    if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Certificate, &gotExpectedTag)))
       return error;
     if (gotExpectedTag) {
       keyLocator->type = ndn_KeyLocatorType_CERTIFICATE;
     
-      if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-          (decoder, ndn_BinaryXml_DTag_Certificate, 0, &keyLocator->keyOrCertificate, &keyLocator->keyOrCertificateLength))
+      if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
+          (decoder, ndn_BinaryXml_DTag_Certificate, 0, &keyLocator->keyOrCertificate, &keyLocator->keyOrCertificateLength)))
         return error;
     }
     else {
-      if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_KeyName, &gotExpectedTag))
+      if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_KeyName, &gotExpectedTag)))
         return error;
       if (gotExpectedTag) {
         // TODO: Implement keyName. For now, just use a structure decoder to skip it.
@@ -74,7 +74,7 @@
         ndn_BinaryXmlStructureDecoder_init(&structureDecoder);
         
         ndn_BinaryXmlStructureDecoder_seek(&structureDecoder, decoder->offset);
-        if (error = ndn_BinaryXmlStructureDecoder_findElementEnd(&structureDecoder, decoder->input, decoder->inputLength))
+        if ((error = ndn_BinaryXmlStructureDecoder_findElementEnd(&structureDecoder, decoder->input, decoder->inputLength)))
           return error;
         if (!structureDecoder.gotElementEnd)
           return NDN_ERROR_read_past_the_end_of_the_input;
@@ -85,7 +85,7 @@
     }
   }
 
-  if (error = ndn_BinaryXmlDecoder_readElementClose(decoder))
+  if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
     return error;
   
   return 0;
@@ -95,10 +95,10 @@
 {
   int gotExpectedTag;
   ndn_Error error; 
-  if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_KeyLocator, &gotExpectedTag))
+  if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_KeyLocator, &gotExpectedTag)))
     return error;
   if (gotExpectedTag) {
-    if (error = ndn_decodeBinaryXmlKeyLocator(keyLocator, decoder))
+    if ((error = ndn_decodeBinaryXmlKeyLocator(keyLocator, decoder)))
       return error;
   }
   else
diff --git a/ndn-cpp/c/encoding/binary-xml-name.c b/ndn-cpp/c/encoding/binary-xml-name.c
index ffdea75..6437843 100644
--- a/ndn-cpp/c/encoding/binary-xml-name.c
+++ b/ndn-cpp/c/encoding/binary-xml-name.c
@@ -11,17 +11,17 @@
 ndn_Error ndn_encodeBinaryXmlName(struct ndn_Name *name, struct ndn_BinaryXmlEncoder *encoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Name))
+  if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Name)))
     return error;
   
   unsigned int i;
   for (i = 0; i < name->nComponents; ++i) {
-    if (error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-        (encoder, ndn_BinaryXml_DTag_Component, name->components[i].value, name->components[i].valueLength))
+    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
+        (encoder, ndn_BinaryXml_DTag_Component, name->components[i].value, name->components[i].valueLength)))
       return error;
 	}
   
-	if (error = ndn_BinaryXmlEncoder_writeElementClose(encoder))
+	if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
     return error;
   
   return 0;
@@ -30,13 +30,13 @@
 ndn_Error ndn_decodeBinaryXmlName(struct ndn_Name *name, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Name))
+  if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Name)))
     return error;
     
   name->nComponents = 0;
   while (1) {
     int gotExpectedTag;
-    if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Component, &gotExpectedTag))
+    if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_Component, &gotExpectedTag)))
       return error;
     
     if (!gotExpectedTag)
@@ -45,7 +45,7 @@
     
     unsigned char *component;
     unsigned int componentLen;
-    if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component, &componentLen))
+    if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component, &componentLen)))
       return error;
     
     // Add the component to the name.
@@ -55,7 +55,7 @@
     ++name->nComponents;
   }
   
-  if (error = ndn_BinaryXmlDecoder_readElementClose(decoder))
+  if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
     return error;
   
   return 0;
diff --git a/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.c b/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.c
index dfc95d1..fe9530a 100644
--- a/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.c
+++ b/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.c
@@ -14,9 +14,9 @@
     return 0;
   
   ndn_Error error;
-  if (error = ndn_BinaryXmlEncoder_writeBlobDTagElement
+  if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
       (encoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, publisherPublicKeyDigest->publisherPublicKeyDigest, 
-       publisherPublicKeyDigest->publisherPublicKeyDigestLength))
+       publisherPublicKeyDigest->publisherPublicKeyDigestLength)))
     return error;
   
   return 0;
@@ -26,9 +26,9 @@
   (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error; 
-  if (error = ndn_BinaryXmlDecoder_readBinaryDTagElement
+  if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
       (decoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, 0, &publisherPublicKeyDigest->publisherPublicKeyDigest,
-       &publisherPublicKeyDigest->publisherPublicKeyDigestLength))
+       &publisherPublicKeyDigest->publisherPublicKeyDigestLength)))
     return error;
   
   return 0;
@@ -39,10 +39,10 @@
 {
   int gotExpectedTag;
   ndn_Error error; 
-  if (error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, &gotExpectedTag))
+  if ((error = ndn_BinaryXmlDecoder_peekDTag(decoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, &gotExpectedTag)))
     return error;
   if (gotExpectedTag) {
-    if (error = ndn_decodeBinaryXmlPublisherPublicKeyDigest(publisherPublicKeyDigest, decoder))
+    if ((error = ndn_decodeBinaryXmlPublisherPublicKeyDigest(publisherPublicKeyDigest, decoder)))
       return error;
   }
   else {
diff --git a/ndn-cpp/c/util/dynamic-uchar-array.h b/ndn-cpp/c/util/dynamic-uchar-array.h
index 71b6a2e..ab5dca4 100644
--- a/ndn-cpp/c/util/dynamic-uchar-array.h
+++ b/ndn-cpp/c/util/dynamic-uchar-array.h
@@ -75,7 +75,7 @@
   (struct ndn_DynamicUCharArray *self, unsigned char *value, unsigned int valueLength, unsigned int offset) 
 {
   ndn_Error error;
-  if (error = ndn_DynamicUCharArray_ensureLength(self, valueLength + offset))
+  if ((error = ndn_DynamicUCharArray_ensureLength(self, valueLength + offset)))
     return error;
   ndn_memcpy(self->array + offset, value, valueLength);
 };
diff --git a/ndn-cpp/encoding/binary-xml-decoder.hpp b/ndn-cpp/encoding/binary-xml-decoder.hpp
index d4304b0..ae04831 100644
--- a/ndn-cpp/encoding/binary-xml-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-decoder.hpp
@@ -36,7 +36,7 @@
   {
     int gotExpectedTag;
     ndn_Error error;
-    if (error = ndn_BinaryXmlDecoder_peekDTag(this, expectedTag, &gotExpectedTag))
+    if ((error = ndn_BinaryXmlDecoder_peekDTag(this, expectedTag, &gotExpectedTag)))
       throw std::runtime_error(ndn_getErrorString(error));
     
     return gotExpectedTag;
diff --git a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
index 331f3d3..e83dd5b 100644
--- a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
@@ -32,7 +32,7 @@
   bool findElementEnd(unsigned char *input, unsigned int inputLength) 
   {
     ndn_Error error;
-    if (error = ndn_BinaryXmlStructureDecoder_findElementEnd(this, input, inputLength))
+    if ((error = ndn_BinaryXmlStructureDecoder_findElementEnd(this, input, inputLength)))
       throw std::runtime_error(ndn_getErrorString(error));
     return gotElementEnd();
   }
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index f4ddf78..7556777 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.cpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.cpp
@@ -49,7 +49,7 @@
     
   BinaryXmlDecoder decoder(input, inputLength);  
   ndn_Error error;
-  if (error = ndn_decodeBinaryXmlInterest(&interestStruct, &decoder))
+  if ((error = ndn_decodeBinaryXmlInterest(&interestStruct, &decoder)))
     throw std::runtime_error(ndn_getErrorString(error));
 
   interest.set(interestStruct);
@@ -78,7 +78,7 @@
     
   BinaryXmlDecoder decoder(input, inputLength);  
   ndn_Error error;
-  if (error = ndn_decodeBinaryXmlData(&dataStruct, &decoder))
+  if ((error = ndn_decodeBinaryXmlData(&dataStruct, &decoder)))
     throw std::runtime_error(ndn_getErrorString(error));
 
   data.set(dataStruct);
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));  
 }
 
diff --git a/ndn-cpp/transport/udp-transport.cpp b/ndn-cpp/transport/udp-transport.cpp
index 1416e8e..fcef683 100644
--- a/ndn-cpp/transport/udp-transport.cpp
+++ b/ndn-cpp/transport/udp-transport.cpp
@@ -15,7 +15,7 @@
 void UdpTransport::connect(Face &face)
 {
   ndn_Error error;
-  if (error = ndn_UdpTransport_connect(&transport_, (char *)face.getHost(), face.getPort()))
+  if ((error = ndn_UdpTransport_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 UdpTransport::send(const unsigned char *data, unsigned int dataLength)
 {
   ndn_Error error;
-  if (error = ndn_UdpTransport_send(&transport_, (unsigned char *)data, dataLength))
+  if ((error = ndn_UdpTransport_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_UdpTransport_receive(&transport_, buffer, sizeof(buffer), &nBytes))
+    if ((error = ndn_UdpTransport_receive(&transport_, buffer, sizeof(buffer), &nBytes)))
       throw std::runtime_error(ndn_getErrorString(error));  
 
     ndn_BinaryXmlElementReader_onReceivedData(&elementReader_, buffer, nBytes);
@@ -54,7 +54,7 @@
 void UdpTransport::close()
 {
   ndn_Error error;
-  if (error = ndn_UdpTransport_close(&transport_))
+  if ((error = ndn_UdpTransport_close(&transport_)))
     throw std::runtime_error(ndn_getErrorString(error));  
 }
 
