Fixing warnings from clang compiler
Change-Id: Id1b41ec47ede6defdab14f48b2e8d875d2d5d77b
diff --git a/src/c/encoding/binary-xml-data.c b/src/c/encoding/binary-xml-data.c
index 0f28ff5..b38fcdc 100644
--- a/src/c/encoding/binary-xml-data.c
+++ b/src/c/encoding/binary-xml-data.c
@@ -10,6 +10,7 @@
#include "binary-xml-name.h"
#include "binary-xml-publisher-public-key-digest.h"
#include "binary-xml-data.h"
+#include "binary-xml-key.h"
static ndn_Error encodeSignature(struct ndn_Signature *signature, struct ndn_BinaryXmlEncoder *encoder)
{
@@ -77,15 +78,15 @@
struct ndn_Blob typeBytes;
typeBytes.length = 3;
if (metaInfo->type == ndn_ContentType_ENCR)
- typeBytes.value = "\x10\xD0\x91";
+ typeBytes.value = (uint8_t *)"\x10\xD0\x91";
else if (metaInfo->type == ndn_ContentType_GONE)
- typeBytes.value = "\x18\xE3\x44";
+ typeBytes.value = (uint8_t *)"\x18\xE3\x44";
else if (metaInfo->type == ndn_ContentType_KEY)
- typeBytes.value = "\x28\x46\x3F";
+ typeBytes.value = (uint8_t *)"\x28\x46\x3F";
else if (metaInfo->type == ndn_ContentType_LINK)
- typeBytes.value = "\x2C\x83\x4A";
+ typeBytes.value = (uint8_t *)"\x2C\x83\x4A";
else if (metaInfo->type == ndn_ContentType_NACK)
- typeBytes.value = "\x34\x00\x8A";
+ typeBytes.value = (uint8_t *)"\x34\x00\x8A";
else
return NDN_ERROR_unrecognized_ndn_ContentType;
@@ -120,8 +121,8 @@
if ((error = ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest(&signature->publisherPublicKeyDigest, decoder)))
return error;
- if (error= ndn_BinaryXmlDecoder_readOptionalTimeMillisecondsDTagElement
- (decoder, ndn_BinaryXml_DTag_Timestamp, &metaInfo->timestampMilliseconds))
+ if ((error = ndn_BinaryXmlDecoder_readOptionalTimeMillisecondsDTagElement
+ (decoder, ndn_BinaryXml_DTag_Timestamp, &metaInfo->timestampMilliseconds)))
return error;
struct ndn_Blob typeBytes;
@@ -133,17 +134,17 @@
metaInfo->type = ndn_ContentType_DATA;
else if (typeBytes.length == 3) {
// All the recognized content types are 3 bytes.
- if (ndn_memcmp(typeBytes.value, "\x0C\x04\xC0", typeBytes.length) == 0)
+ if (ndn_memcmp(typeBytes.value, (uint8_t *)"\x0C\x04\xC0", typeBytes.length) == 0)
metaInfo->type = ndn_ContentType_DATA;
- else if (ndn_memcmp(typeBytes.value, "\x10\xD0\x91", typeBytes.length) == 0)
+ else if (ndn_memcmp(typeBytes.value, (uint8_t *)"\x10\xD0\x91", typeBytes.length) == 0)
metaInfo->type = ndn_ContentType_ENCR;
- else if (ndn_memcmp(typeBytes.value, "\x18\xE3\x44", typeBytes.length) == 0)
+ else if (ndn_memcmp(typeBytes.value, (uint8_t *)"\x18\xE3\x44", typeBytes.length) == 0)
metaInfo->type = ndn_ContentType_GONE;
- else if (ndn_memcmp(typeBytes.value, "\x28\x46\x3F", typeBytes.length) == 0)
+ else if (ndn_memcmp(typeBytes.value, (uint8_t *)"\x28\x46\x3F", typeBytes.length) == 0)
metaInfo->type = ndn_ContentType_KEY;
- else if (ndn_memcmp(typeBytes.value, "\x2C\x83\x4A", typeBytes.length) == 0)
+ else if (ndn_memcmp(typeBytes.value, (uint8_t *)"\x2C\x83\x4A", typeBytes.length) == 0)
metaInfo->type = ndn_ContentType_LINK;
- else if (ndn_memcmp(typeBytes.value, "\x34\x00\x8A", typeBytes.length) == 0)
+ else if (ndn_memcmp(typeBytes.value, (uint8_t *)"\x34\x00\x8A", typeBytes.length) == 0)
metaInfo->type = ndn_ContentType_NACK;
else
return NDN_ERROR_unrecognized_ndn_ContentType;
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-forwarding-entry.c b/src/c/encoding/binary-xml-forwarding-entry.c
index 271029b..d7ed52a 100644
--- a/src/c/encoding/binary-xml-forwarding-entry.c
+++ b/src/c/encoding/binary-xml-forwarding-entry.c
@@ -7,6 +7,9 @@
#include "binary-xml.h"
#include "binary-xml-forwarding-entry.h"
+#include "binary-xml-name.h"
+#include "binary-xml-key.h"
+#include "binary-xml-publisher-public-key-digest.h"
ndn_Error ndn_encodeBinaryXmlForwardingEntry(struct ndn_ForwardingEntry *forwardingEntry, struct ndn_BinaryXmlEncoder *encoder)
{
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/c/encoding/binary-xml-key.c b/src/c/encoding/binary-xml-key.c
index d9cce61..bc55911 100644
--- a/src/c/encoding/binary-xml-key.c
+++ b/src/c/encoding/binary-xml-key.c
@@ -8,6 +8,7 @@
#include "binary-xml.h"
#include "binary-xml-structure-decoder.h"
#include "binary-xml-key.h"
+#include "binary-xml-name.h"
static ndn_Error decodeKeyNameData(struct ndn_KeyLocator *keyLocator, struct ndn_BinaryXmlDecoder *decoder)
{