Fix from clang compiler warnings: Use explicit parentheses.
diff --git a/src/c/encoding/binary-xml-encoder.c b/src/c/encoding/binary-xml-encoder.c
index 961c274..e27cbbc 100644
--- a/src/c/encoding/binary-xml-encoder.c
+++ b/src/c/encoding/binary-xml-encoder.c
@@ -183,7 +183,7 @@
// Bottom 4 bits of value go in last byte with tag.
self->output->array[self->offset + nEncodingBytes - 1] =
- (ndn_BinaryXml_TT_MASK & type |
+ ((ndn_BinaryXml_TT_MASK & type) |
((ndn_BinaryXml_TT_VALUE_MASK & value) << ndn_BinaryXml_TT_BITS)) |
ndn_BinaryXml_TT_FINAL; // set top bit for last byte
value >>= ndn_BinaryXml_TT_VALUE_BITS;
diff --git a/src/c/encoding/binary-xml-interest.c b/src/c/encoding/binary-xml-interest.c
index 48d3fe0..00da3e4 100644
--- a/src/c/encoding/binary-xml-interest.c
+++ b/src/c/encoding/binary-xml-interest.c
@@ -205,8 +205,8 @@
(decoder, ndn_BinaryXml_DTag_Scope, &interest->scope)))
return error;
- if (error= ndn_BinaryXmlDecoder_readOptionalTimeMillisecondsDTagElement
- (decoder, ndn_BinaryXml_DTag_InterestLifetime, &interest->interestLifetimeMilliseconds))
+ if ((error = ndn_BinaryXmlDecoder_readOptionalTimeMillisecondsDTagElement
+ (decoder, ndn_BinaryXml_DTag_InterestLifetime, &interest->interestLifetimeMilliseconds)))
return error;
if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
diff --git a/src/name.cpp b/src/name.cpp
index 640fdeb..3d4519a 100644
--- a/src/name.cpp
+++ b/src/name.cpp
@@ -382,9 +382,9 @@
for (size_t i = 0; i < value.size(); ++i) {
uint8_t x = value[i];
// Check for 0-9, A-Z, a-z, (+), (-), (.), (_)
- if (x >= 0x30 && x <= 0x39 || x >= 0x41 && x <= 0x5a ||
- x >= 0x61 && x <= 0x7a || x == 0x2b || x == 0x2d ||
- x == 0x2e || x == 0x5f)
+ if ((x >= 0x30 && x <= 0x39) || (x >= 0x41 && x <= 0x5a) ||
+ (x >= 0x61 && x <= 0x7a) || x == 0x2b || x == 0x2d ||
+ x == 0x2e || x == 0x5f)
result << x;
else {
result << '%';