To avoid warnings on some compilers added extra parens to if ((error = func()))
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