diff --git a/ndn-cpp/common.cpp b/ndn-cpp/common.cpp
index b4c6e45..b4a1bd8 100644
--- a/ndn-cpp/common.cpp
+++ b/ndn-cpp/common.cpp
@@ -10,7 +10,7 @@
 
 namespace ndn {
 
-string toHex(const vector<unsigned char> &array) 
+string toHex(const vector<unsigned char>& array) 
 {
   ostringstream result;
   result.flags(ios::hex | ios::uppercase);
diff --git a/ndn-cpp/common.hpp b/ndn-cpp/common.hpp
index 56b1aa4..79952a4 100644
--- a/ndn-cpp/common.hpp
+++ b/ndn-cpp/common.hpp
@@ -56,7 +56,7 @@
  * @param value the array of bytes, or 0 to not copy
  * @param valueLength the length of value
  */
-static inline void setVector(std::vector<unsigned char> &vec, const unsigned char *value, unsigned int valueLength) 
+static inline void setVector(std::vector<unsigned char>& vec, const unsigned char *value, unsigned int valueLength) 
 {
   vec.clear();
   if (value)
@@ -68,7 +68,7 @@
  * @param array The array of bytes.
  * @return Hex string.
  */
-std::string toHex(const std::vector<unsigned char> &array);
+std::string toHex(const std::vector<unsigned char>& array);
 
 }
 
diff --git a/ndn-cpp/data.cpp b/ndn-cpp/data.cpp
index 322faff..1028795 100644
--- a/ndn-cpp/data.cpp
+++ b/ndn-cpp/data.cpp
@@ -10,7 +10,7 @@
 
 namespace ndn {
 
-void Signature::get(struct ndn_Signature &signatureStruct) const 
+void Signature::get(struct ndn_Signature& signatureStruct) const 
 {
   signatureStruct.digestAlgorithmLength = digestAlgorithm_.size();
   if (digestAlgorithm_.size() > 0)
@@ -31,14 +31,14 @@
     signatureStruct.signature = 0;
 }
 
-void Signature::set(const struct ndn_Signature &signatureStruct)
+void Signature::set(const struct ndn_Signature& signatureStruct)
 {
   setVector(digestAlgorithm_, signatureStruct.digestAlgorithm, signatureStruct.digestAlgorithmLength);
   setVector(witness_, signatureStruct.witness, signatureStruct.witnessLength);
   setVector(signature_, signatureStruct.signature, signatureStruct.signatureLength);
 }
 
-void SignedInfo::get(struct ndn_SignedInfo &signedInfoStruct) const 
+void SignedInfo::get(struct ndn_SignedInfo& signedInfoStruct) const 
 {
   publisherPublicKeyDigest_.get(signedInfoStruct.publisherPublicKeyDigest);
   signedInfoStruct.timestampMilliseconds = timestampMilliseconds_;
@@ -54,7 +54,7 @@
   keyLocator_.get(signedInfoStruct.keyLocator);
 }
 
-void SignedInfo::set(const struct ndn_SignedInfo &signedInfoStruct)
+void SignedInfo::set(const struct ndn_SignedInfo& signedInfoStruct)
 {
   publisherPublicKeyDigest_.set(signedInfoStruct.publisherPublicKeyDigest);
   timestampMilliseconds_ = signedInfoStruct.timestampMilliseconds;
@@ -64,7 +64,7 @@
   keyLocator_.set(signedInfoStruct.keyLocator);
 }
 
-void Data::get(struct ndn_Data &dataStruct) const 
+void Data::get(struct ndn_Data& dataStruct) const 
 {
   signature_.get(dataStruct.signature);
   name_.get(dataStruct.name);
@@ -77,7 +77,7 @@
     dataStruct.content = 0;
 }
 
-void Data::set(const struct ndn_Data &dataStruct)
+void Data::set(const struct ndn_Data& dataStruct)
 {
   signature_.set(dataStruct.signature);
   name_.set(dataStruct.name);
diff --git a/ndn-cpp/data.hpp b/ndn-cpp/data.hpp
index 24b436a..620da8c 100644
--- a/ndn-cpp/data.hpp
+++ b/ndn-cpp/data.hpp
@@ -21,36 +21,36 @@
    * WARNING: The resulting pointers in signatureStruct are invalid after a further use of this object which could reallocate memory.
    * @param signatureStruct a C ndn_Signature struct where the name components array is already allocated.
    */
-  void get(struct ndn_Signature &signatureStruct) const;
+  void get(struct ndn_Signature& signatureStruct) const;
 
   /**
    * Clear this signature, and set the values by copying from the ndn_Signature struct.
    * @param signatureStruct a C ndn_Signature struct
    */
-  void set(const struct ndn_Signature &signatureStruct);
+  void set(const struct ndn_Signature& signatureStruct);
 
-  const std::vector<unsigned char> &getDigestAlgorithm() const { return digestAlgorithm_; }
-  std::vector<unsigned char> &getDigestAlgorithm() { return digestAlgorithm_; }
+  const std::vector<unsigned char>& getDigestAlgorithm() const { return digestAlgorithm_; }
+  std::vector<unsigned char>& getDigestAlgorithm() { return digestAlgorithm_; }
 
-  const std::vector<unsigned char> &getWitness() const { return witness_; }
-  std::vector<unsigned char> &getWitness() { return witness_; }
+  const std::vector<unsigned char>& getWitness() const { return witness_; }
+  std::vector<unsigned char>& getWitness() { return witness_; }
 
-  const std::vector<unsigned char> &getSignature() const { return signature_; }
-  std::vector<unsigned char> &getSignature() { return signature_; }
+  const std::vector<unsigned char>& getSignature() const { return signature_; }
+  std::vector<unsigned char>& getSignature() { return signature_; }
 
-  void setDigestAlgorithm(const std::vector<unsigned char> &digestAlgorithm) { digestAlgorithm_ = digestAlgorithm; }
+  void setDigestAlgorithm(const std::vector<unsigned char>& digestAlgorithm) { digestAlgorithm_ = digestAlgorithm; }
   void setDigestAlgorithm(const unsigned char *digestAlgorithm, unsigned int digestAlgorithmLength) 
   { 
     setVector(digestAlgorithm_, digestAlgorithm, digestAlgorithmLength); 
   }
 
-  void setWitness(const std::vector<unsigned char> &witness) { witness_ = witness; }
+  void setWitness(const std::vector<unsigned char>& witness) { witness_ = witness; }
   void setWitness(const unsigned char *witness, unsigned int witnessLength) 
   { 
     setVector(witness_, witness, witnessLength); 
   }
 
-  void setSignature(const std::vector<unsigned char> &signature) { signature_ = signature; }
+  void setSignature(const std::vector<unsigned char>& signature) { signature_ = signature; }
   void setSignature(const unsigned char *signature, unsigned int signatureLength) 
   { 
     setVector(signature_, signature, signatureLength); 
@@ -85,16 +85,16 @@
    * WARNING: The resulting pointers in signedInfoStruct are invalid after a further use of this object which could reallocate memory.
    * @param signedInfoStruct a C ndn_SignedInfo struct where the name components array is already allocated.
    */
-  void get(struct ndn_SignedInfo &signedInfoStruct) const;
+  void get(struct ndn_SignedInfo& signedInfoStruct) const;
 
   /**
    * Clear this signed info, and set the values by copying from the ndn_SignedInfo struct.
    * @param signedInfoStruct a C ndn_SignedInfo struct
    */
-  void set(const struct ndn_SignedInfo &signedInfoStruct);
+  void set(const struct ndn_SignedInfo& signedInfoStruct);
 
-  const PublisherPublicKeyDigest &getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
-  PublisherPublicKeyDigest &getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  const PublisherPublicKeyDigest& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+  PublisherPublicKeyDigest& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
   
   double getTimestampMilliseconds() const { return timestampMilliseconds_; }
   
@@ -102,13 +102,13 @@
   
   int getFreshnessSeconds() const { return freshnessSeconds_; }
   
-  const std::vector<unsigned char> &getFinalBlockID() const { return finalBlockID_; }
-  std::vector<unsigned char> &getFinalBlockID() { return finalBlockID_; }
+  const std::vector<unsigned char>& getFinalBlockID() const { return finalBlockID_; }
+  std::vector<unsigned char>& getFinalBlockID() { return finalBlockID_; }
   
-  const KeyLocator &getKeyLocator() const { return keyLocator_; }
-  KeyLocator &getKeyLocator() { return keyLocator_; }
+  const KeyLocator& getKeyLocator() const { return keyLocator_; }
+  KeyLocator& getKeyLocator() { return keyLocator_; }
 
-  void setPublisherPublicKeyDigest(const PublisherPublicKeyDigest &publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
+  void setPublisherPublicKeyDigest(const PublisherPublicKeyDigest& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
   
   void setTimestampMilliseconds(double timestampMilliseconds) { timestampMilliseconds_ = timestampMilliseconds; }
   
@@ -116,13 +116,13 @@
   
   void setFreshnessSeconds(int freshnessSeconds) { freshnessSeconds_ = freshnessSeconds; }
   
-  void setFinalBlockID(const std::vector<unsigned char> &finalBlockID) { finalBlockID_ = finalBlockID; }
+  void setFinalBlockID(const std::vector<unsigned char>& finalBlockID) { finalBlockID_ = finalBlockID; }
   void setFinalBlockID(const unsigned char *finalBlockID, unsigned int finalBlockIdLength) 
   { 
     setVector(finalBlockID_, finalBlockID, finalBlockIdLength); 
   }
   
-  void setKeyLocator(const KeyLocator &keyLocator) { keyLocator_ = keyLocator; }
+  void setKeyLocator(const KeyLocator& keyLocator) { keyLocator_ = keyLocator; }
   
 private:
   PublisherPublicKeyDigest publisherPublicKeyDigest_;
@@ -139,12 +139,12 @@
   {
   }
   
-  Data(const Name &name)
+  Data(const Name& name)
   : name_(name)
   {
   }
   
-  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat &wireFormat) const 
+  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat) const 
   {
     return wireFormat.encodeData(*this);
   }
@@ -152,7 +152,7 @@
   {
     return wireEncode(*WireFormat::getDefaultWireFormat());
   }
-  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat) 
+  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat) 
   {
     wireFormat.decodeData(*this, input, inputLength);
   }
@@ -160,11 +160,11 @@
   {
     wireDecode(input, inputLength, *WireFormat::getDefaultWireFormat());
   }
-  void wireDecode(const std::vector<unsigned char> &input, WireFormat &wireFormat) 
+  void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
-  void wireDecode(const std::vector<unsigned char> &input) 
+  void wireDecode(const std::vector<unsigned char>& input) 
   {
     wireDecode(&input[0], input.size());
   }
@@ -174,33 +174,33 @@
    * WARNING: The resulting pointers in dataStruct are invalid after a further use of this object which could reallocate memory.
    * @param dataStruct a C ndn_Data struct where the name components array is already allocated.
    */
-  void get(struct ndn_Data &dataStruct) const;
+  void get(struct ndn_Data& dataStruct) const;
 
   /**
    * Clear this data object, and set the values by copying from the ndn_Data struct.
    * @param dataStruct a C ndn_Data struct
    */
-  void set(const struct ndn_Data &dataStruct);
+  void set(const struct ndn_Data& dataStruct);
 
-  const Signature &getSignature() const { return signature_; }
-  Signature &getSignature() { return signature_; }
+  const Signature& getSignature() const { return signature_; }
+  Signature& getSignature() { return signature_; }
   
-  const Name &getName() const { return name_; }
-  Name &getName() { return name_; }
+  const Name& getName() const { return name_; }
+  Name& getName() { return name_; }
   
-  const SignedInfo &getSignedInfo() const { return signedInfo_; }
-  SignedInfo &getSignedInfo() { return signedInfo_; }
+  const SignedInfo& getSignedInfo() const { return signedInfo_; }
+  SignedInfo& getSignedInfo() { return signedInfo_; }
   
-  const std::vector<unsigned char> &getContent() const { return content_; }
-  std::vector<unsigned char> &getContent() { return content_; }
+  const std::vector<unsigned char>& getContent() const { return content_; }
+  std::vector<unsigned char>& getContent() { return content_; }
 
-  void setSignature(const Signature &signature) { signature_ = signature; }
+  void setSignature(const Signature& signature) { signature_ = signature; }
   
-  void setName(const Name &name) { name_ = name; }
+  void setName(const Name& name) { name_ = name; }
   
-  void setSignedInfo(const SignedInfo &signedInfo) { signedInfo_ = signedInfo; }
+  void setSignedInfo(const SignedInfo& signedInfo) { signedInfo_ = signedInfo; }
 
-  void setContent(const std::vector<unsigned char> &content) { content_ = content; }
+  void setContent(const std::vector<unsigned char>& content) { content_ = content; }
   void setContent(const unsigned char *content, unsigned int contentLength) 
   { 
     setVector(content_, content, contentLength); 
diff --git a/ndn-cpp/encoding/binary-xml-encoder.hpp b/ndn-cpp/encoding/binary-xml-encoder.hpp
index cee590c..ad41a69 100644
--- a/ndn-cpp/encoding/binary-xml-encoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-encoder.hpp
@@ -31,7 +31,7 @@
    * Resize the output vector to the correct encoding length and return.
    * @return The encoding as a shared_ptr.  Assume that the caller now owns the vector.
    */
-  const ptr_lib::shared_ptr<std::vector<unsigned char> > &getOutput() 
+  const ptr_lib::shared_ptr<std::vector<unsigned char> >& getOutput() 
   {
     output_.get()->resize(offset);
     return output_.get();
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index b331e08..2bb2093 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.cpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.cpp
@@ -24,7 +24,7 @@
   return new BinaryXmlWireFormat();
 }
   
-ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeInterest(const Interest &interest) 
+ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeInterest(const Interest& interest) 
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_ExcludeEntry excludeEntries[100];
@@ -42,7 +42,7 @@
   return encoder.getOutput();
 }
 
-void BinaryXmlWireFormat::decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength)
+void BinaryXmlWireFormat::decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength)
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_ExcludeEntry excludeEntries[100];
@@ -60,7 +60,7 @@
 }
 
 ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeData
-  (const Data &data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
+  (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_NameComponent keyNameComponents[100];
@@ -79,7 +79,7 @@
 }
 
 void BinaryXmlWireFormat::decodeData
-  (Data &data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset)
+  (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset)
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_NameComponent keyNameComponents[100];
@@ -96,7 +96,7 @@
   data.set(dataStruct);
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeForwardingEntry(const ForwardingEntry &forwardingEntry) 
+ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
 {
   struct ndn_NameComponent prefixNameComponents[100];
   struct ndn_ForwardingEntry forwardingEntryStruct;
@@ -112,7 +112,7 @@
   return encoder.getOutput();
 }
 
-void BinaryXmlWireFormat::decodeForwardingEntry(ForwardingEntry &forwardingEntry, const unsigned char *input, unsigned int inputLength)
+void BinaryXmlWireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength)
 {
   struct ndn_NameComponent prefixNameComponents[100];
   struct ndn_ForwardingEntry forwardingEntryStruct;
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.hpp b/ndn-cpp/encoding/binary-xml-wire-format.hpp
index 68be550..aca140d 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.hpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.hpp
@@ -21,7 +21,7 @@
    * @param interest The Interest object to encode.
    * @return A shared_ptr with the vector<unsigned char> containing the encoding.
    */  
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest &interest);
+  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest& interest);
     
   /**
    * Decode input as an interest in binary XML and set the fields of the interest object.
@@ -29,19 +29,19 @@
    * @param input A pointer to the input buffer to decode.
    * @param inputLength The number of bytes in input.
    */
-  virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
+  virtual void decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength);
 
   /**
    * Encode data with binary XML and return the encoding.
    * @param data The Data object to encode.
    * @param signedFieldsBeginOffset Return the offset in the encoding of the beginning of the fields which are signed.
-   * If you are not encoding in order to sign, you can call encodeData(const Data &data) to ignore this returned value.
+   * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
    * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
-   * If you are not encoding in order to sign, you can call encodeData(const Data &data) to ignore this returned value.
+   * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
    * @return A shared_ptr with the vector<unsigned char> containing the encoding.
    */
   virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData
-    (const Data &data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+    (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
   
   /**
    * Decode input as a data packet in binary XML and set the fields in the data object.
@@ -50,20 +50,20 @@
    * @param inputLength The number of bytes in input.
    * @param signedFieldsBeginOffset Return the offset in the input buffer of the beginning of the fields which are signed.
    * If you are not decoding in order to verify, you can call 
-   * decodeData(Data &data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
    * @param signedFieldsEndOffset Return the offset in the input buffer of the end of the fields which are signed.
    * If you are not decoding in order to verify, you can call 
-   * decodeData(Data &data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
    */  
   virtual void decodeData
-    (Data &data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+    (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
 
   /**
    * Encode forwardingEntry in binary XML and return the encoding. 
    * @param forwardingEntry The ForwardingEntry object to encode.
    * @return A shared_ptr with the vector<unsigned char> containing the encoding.
    */
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeForwardingEntry(const ForwardingEntry &forwardingEntry);
+  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
   
   /**
    * Decode input as a forwarding entry in binary XML and set the fields of the forwardingEntry object. 
@@ -71,7 +71,7 @@
    * @param input A pointer to the input buffer to decode.
    * @param inputLength The number of bytes in input.
    */
-  virtual void decodeForwardingEntry(ForwardingEntry &forwardingEntry, const unsigned char *input, unsigned int inputLength);
+  virtual void decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength);
 };
   
 }
diff --git a/ndn-cpp/encoding/wire-format.cpp b/ndn-cpp/encoding/wire-format.cpp
index 036262d..e0a4fc0 100644
--- a/ndn-cpp/encoding/wire-format.cpp
+++ b/ndn-cpp/encoding/wire-format.cpp
@@ -26,31 +26,31 @@
   return defaultWireFormat_;
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeInterest(const Interest &interest) 
+ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeInterest(const Interest& interest) 
 {
   throw logic_error("unimplemented");
 }
-void WireFormat::decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength) 
+void WireFormat::decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength) 
 {
   throw logic_error("unimplemented");
 }
 
 ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeData
-  (const Data &data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
+  (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
 {
   throw logic_error("unimplemented");
 }
 void WireFormat::decodeData
-  (Data &data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
+  (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
 {
   throw logic_error("unimplemented");
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeForwardingEntry(const ForwardingEntry &forwardingEntry) 
+ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
 {
   throw logic_error("unimplemented");
 }
-void WireFormat::decodeForwardingEntry(ForwardingEntry &forwardingEntry, const unsigned char *input, unsigned int inputLength) 
+void WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength) 
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/encoding/wire-format.hpp b/ndn-cpp/encoding/wire-format.hpp
index bfd1a1d..b0b2ea4 100644
--- a/ndn-cpp/encoding/wire-format.hpp
+++ b/ndn-cpp/encoding/wire-format.hpp
@@ -23,7 +23,7 @@
    * @return A shared_ptr with the vector<unsigned char> containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest &interest);
+  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest& interest);
   
   /**
    * Decode input as an interest and set the fields of the interest object.  Your derived class should override.
@@ -32,20 +32,20 @@
    * @param inputLength The number of bytes in input.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
+  virtual void decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength);
 
   /**
    * Encode data and return the encoding.  Your derived class should override.
    * @param data The Data object to encode.
    * @param signedFieldsBeginOffset Return the offset in the encoding of the beginning of the fields which are signed.
-   * If you are not encoding in order to sign, you can call encodeData(const Data &data) to ignore this returned value.
+   * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
    * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
-   * If you are not encoding in order to sign, you can call encodeData(const Data &data) to ignore this returned value.
+   * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
    * @return A shared_ptr with the vector<unsigned char> containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
   virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData
-    (const Data &data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+    (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
 
   /**
    * Encode data and return the encoding.
@@ -53,7 +53,7 @@
    * @return A shared_ptr with the vector<unsigned char> containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData(const Data &data)
+  ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData(const Data& data)
   {
     unsigned int dummyBeginOffset, dummyEndOffset;
     return encodeData(data, &dummyBeginOffset, &dummyEndOffset);
@@ -66,16 +66,16 @@
    * @param inputLength The number of bytes in input.
    * @param signedFieldsBeginOffset Return the offset in the input buffer of the beginning of the fields which are signed.
    * If you are not decoding in order to verify, you can call 
-   * decodeData(Data &data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
    * @param signedFieldsEndOffset Return the offset in the input buffer of the end of the fields which are signed.
    * If you are not decoding in order to verify, you can call 
-   * decodeData(Data &data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
    * @throw logic_error for unimplemented if the derived class does not override.
    */  
   virtual void decodeData
-    (Data &data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+    (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
 
-  void decodeData(Data &data, const unsigned char *input, unsigned int inputLength)
+  void decodeData(Data& data, const unsigned char *input, unsigned int inputLength)
   {
     unsigned int dummyBeginOffset, dummyEndOffset;
     decodeData(data, input, inputLength, &dummyBeginOffset, &dummyEndOffset);
@@ -87,7 +87,7 @@
    * @return A shared_ptr with the vector<unsigned char> containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeForwardingEntry(const ForwardingEntry &forwardingEntry);
+  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
   
   /**
    * Decode input as a forwarding entry and set the fields of the forwardingEntry object.  Your derived class should override.
@@ -96,7 +96,7 @@
    * @param inputLength The number of bytes in input.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual void decodeForwardingEntry(ForwardingEntry &forwardingEntry, const unsigned char *input, unsigned int inputLength);
+  virtual void decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength);
 
   /**
    * Set the static default WireFormat used by default encoding and decoding methods.
diff --git a/ndn-cpp/face.cpp b/ndn-cpp/face.cpp
index a2503fe..9b24dda 100644
--- a/ndn-cpp/face.cpp
+++ b/ndn-cpp/face.cpp
@@ -9,7 +9,7 @@
 
 namespace ndn {
   
-void Face::expressInterest(const Name &name, const Interest *interestTemplate, const OnData &onData, const OnTimeout &onTimeout)
+void Face::expressInterest(const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout)
 {
   if (interestTemplate)
     node_.expressInterest(Interest
diff --git a/ndn-cpp/face.hpp b/ndn-cpp/face.hpp
index 9dce469..550c30e 100644
--- a/ndn-cpp/face.hpp
+++ b/ndn-cpp/face.hpp
@@ -21,7 +21,7 @@
    * @param transport A shared_ptr to a Transport object used for communication.
    * @param transport A shared_ptr to a Transport::ConnectionInfo to be used to connect to the transport.
    */
-  Face(const ptr_lib::shared_ptr<Transport> &transport, const ptr_lib::shared_ptr<const Transport::ConnectionInfo> &connectionInfo)
+  Face(const ptr_lib::shared_ptr<Transport>& transport, const ptr_lib::shared_ptr<const Transport::ConnectionInfo>& connectionInfo)
   : node_(transport, connectionInfo)
   {
   }
@@ -45,7 +45,7 @@
    * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
    * This copies the function object, so you may need to use func_lib::ref() as appropriate.
    */
-  void expressInterest(const Interest &interest, const OnData &onData, const OnTimeout &onTimeout = OnTimeout())
+  void expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout = OnTimeout())
   {
     node_.expressInterest(interest, onData, onTimeout);
   }
@@ -60,7 +60,7 @@
    * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
    * This copies the function object, so you may need to use func_lib::ref() as appropriate.
    */
-  void expressInterest(const Name &name, const Interest *interestTemplate, const OnData &onData, const OnTimeout &onTimeout = OnTimeout());
+  void expressInterest(const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout = OnTimeout());
 
   /**
    * Encode name as an Interest, using a default interest lifetime.
@@ -71,7 +71,7 @@
    * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
    * This copies the function object, so you may need to use func_lib::ref() as appropriate.
    */
-  void expressInterest(const Name &name, const OnData &onData, const OnTimeout &onTimeout = OnTimeout()) 
+  void expressInterest(const Name& name, const OnData& onData, const OnTimeout& onTimeout = OnTimeout()) 
   {
     expressInterest(name, 0, onData, onTimeout);
   }
@@ -83,7 +83,7 @@
    * use func_lib::ref() as appropriate.
    * @param flags The flags for finer control of which interests are forward to the application.
    */
-  void registerPrefix(const Name &prefix, const OnInterest &onInterest, int flags = 0)
+  void registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags = 0)
   {
     node_.registerPrefix(prefix, onInterest, flags);
   }
diff --git a/ndn-cpp/forwarding-entry.cpp b/ndn-cpp/forwarding-entry.cpp
index 0e8c6d7..116a542 100644
--- a/ndn-cpp/forwarding-entry.cpp
+++ b/ndn-cpp/forwarding-entry.cpp
@@ -10,7 +10,7 @@
 
 namespace ndn {
   
-void ForwardingEntry::set(const struct ndn_ForwardingEntry &forwardingEntryStruct) 
+void ForwardingEntry::set(const struct ndn_ForwardingEntry& forwardingEntryStruct) 
 {
   if (forwardingEntryStruct.action && forwardingEntryStruct.actionLength > 0)
     action_ = string(forwardingEntryStruct.action, forwardingEntryStruct.action + forwardingEntryStruct.actionLength);
@@ -24,7 +24,7 @@
   freshnessSeconds_ = forwardingEntryStruct.freshnessSeconds;
 }
 
-void ForwardingEntry::get(struct ndn_ForwardingEntry &forwardingEntryStruct) const 
+void ForwardingEntry::get(struct ndn_ForwardingEntry& forwardingEntryStruct) const 
 {
   prefix_.get(forwardingEntryStruct.prefix);
   publisherPublicKeyDigest_.get(forwardingEntryStruct.publisherPublicKeyDigest);
diff --git a/ndn-cpp/forwarding-entry.hpp b/ndn-cpp/forwarding-entry.hpp
index 8c652a7..9919f49 100644
--- a/ndn-cpp/forwarding-entry.hpp
+++ b/ndn-cpp/forwarding-entry.hpp
@@ -19,7 +19,7 @@
 class ForwardingEntry {
 public:    
   ForwardingEntry
-    (const std::string &action, const Name &prefix, const PublisherPublicKeyDigest publisherPublicKeyDigest,
+    (const std::string& action, const Name& prefix, const PublisherPublicKeyDigest publisherPublicKeyDigest,
      int faceId, int forwardingFlags, int freshnessSeconds) 
   : action_(action), prefix_(prefix), publisherPublicKeyDigest_(publisherPublicKeyDigest), 
     faceId_(faceId), forwardingFlags_(forwardingFlags), freshnessSeconds_(freshnessSeconds)
@@ -31,7 +31,7 @@
   {
   }
   
-  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat &wireFormat) const 
+  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat) const 
   {
     return wireFormat.encodeForwardingEntry(*this);
   }
@@ -39,7 +39,7 @@
   {
     return wireEncode(*WireFormat::getDefaultWireFormat());
   }
-  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat) 
+  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat) 
   {
     wireFormat.decodeForwardingEntry(*this, input, inputLength);
   }
@@ -47,11 +47,11 @@
   {
     wireDecode(input, inputLength, *WireFormat::getDefaultWireFormat());
   }
-  void wireDecode(const std::vector<unsigned char> &input, WireFormat &wireFormat) 
+  void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
-  void wireDecode(const std::vector<unsigned char> &input) 
+  void wireDecode(const std::vector<unsigned char>& input) 
   {
     wireDecode(&input[0], input.size());
   }
@@ -61,15 +61,15 @@
    * WARNING: The resulting pointers in forwardingEntryStruct are invalid after a further use of this object which could reallocate memory.
    * @param forwardingEntryStruct a C ndn_ForwardingEntry struct where the prefix name components array is already allocated.
    */
-  void get(struct ndn_ForwardingEntry &forwardingEntryStruct) const;
+  void get(struct ndn_ForwardingEntry& forwardingEntryStruct) const;
 
-  const std::string &getAction() const { return action_; }
+  const std::string& getAction() const { return action_; }
   
-  Name &getPrefix() { return prefix_; }
-  const Name &getPrefix() const { return prefix_; }
+  Name& getPrefix() { return prefix_; }
+  const Name& getPrefix() const { return prefix_; }
   
-  PublisherPublicKeyDigest &getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
-  const PublisherPublicKeyDigest &getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+  PublisherPublicKeyDigest& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  const PublisherPublicKeyDigest& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
   
   int getFaceId() const { return faceId_; }
 
@@ -81,9 +81,9 @@
    * Clear this forwarding entry, and set the values by copying from forwardingEntryStruct.
    * @param forwardingEntryStruct a C ndn_ForwardingEntry struct.
    */
-  void set(const struct ndn_ForwardingEntry &forwardingEntryStruct);
+  void set(const struct ndn_ForwardingEntry& forwardingEntryStruct);
 
-  void setAction(const std::string &value) { action_ = value; }
+  void setAction(const std::string& value) { action_ = value; }
   
   void setFaceId(int value) { faceId_ = value; }
       
diff --git a/ndn-cpp/interest.cpp b/ndn-cpp/interest.cpp
index f84dd7a..39e3358 100644
--- a/ndn-cpp/interest.cpp
+++ b/ndn-cpp/interest.cpp
@@ -11,7 +11,7 @@
 
 namespace ndn {
   
-void Exclude::get(struct ndn_Exclude &excludeStruct) const
+void Exclude::get(struct ndn_Exclude& excludeStruct) const
 {
   if (excludeStruct.maxEntries < entries_.size())
     throw runtime_error("excludeStruct.maxEntries must be >= this exclude getEntryCount()");
@@ -21,7 +21,7 @@
     entries_[i].get(excludeStruct.entries[i]);  
 }
 
-void Exclude::set(const struct ndn_Exclude &excludeStruct)
+void Exclude::set(const struct ndn_Exclude& excludeStruct)
 {
   entries_.clear();
   for (unsigned int i = 0; i < excludeStruct.nEntries; ++i) {
@@ -55,7 +55,7 @@
   return result.str();  
 }
 
-void Interest::set(const struct ndn_Interest &interestStruct) 
+void Interest::set(const struct ndn_Interest& interestStruct) 
 {
   name_.set(interestStruct.name);
   minSuffixComponents_ = interestStruct.minSuffixComponents;
@@ -71,7 +71,7 @@
   setVector(nonce_, interestStruct.nonce, interestStruct.nonceLength);
 }
 
-void Interest::get(struct ndn_Interest &interestStruct) const 
+void Interest::get(struct ndn_Interest& interestStruct) const 
 {
   name_.get(interestStruct.name);
   interestStruct.minSuffixComponents = minSuffixComponents_;
diff --git a/ndn-cpp/interest.hpp b/ndn-cpp/interest.hpp
index e4aeeb1..b3397af 100644
--- a/ndn-cpp/interest.hpp
+++ b/ndn-cpp/interest.hpp
@@ -38,7 +38,7 @@
    * WARNING: The resulting pointer in excludeEntryStruct is invalid after a further use of this object which could reallocate memory.
    * @param excludeEntryStruct the C ndn_NameComponent struct to receive the pointer
    */
-  void get(struct ndn_ExcludeEntry &excludeEntryStruct) const 
+  void get(struct ndn_ExcludeEntry& excludeEntryStruct) const 
   {
     excludeEntryStruct.type = type_;
     if (type_ == ndn_Exclude_COMPONENT)
@@ -47,7 +47,7 @@
   
   ndn_ExcludeType getType() const { return type_; }
   
-  const Name::Component &getComponent() const { return component_; }
+  const Name::Component& getComponent() const { return component_; }
   
 private:
   ndn_ExcludeType type_;
@@ -69,20 +69,20 @@
     return entries_.size();
   }
   
-  const ExcludeEntry &getEntry(unsigned int i) const { return entries_[i]; }
+  const ExcludeEntry& getEntry(unsigned int i) const { return entries_[i]; }
   
   /**
    * Set the excludeStruct to point to the entries in this Exclude, without copying any memory.
    * WARNING: The resulting pointers in excludeStruct are invalid after a further use of this object which could reallocate memory.
    * @param excludeStruct a C ndn_Exclude struct where the entries array is already allocated
    */
-  void get(struct ndn_Exclude &excludeStruct) const;
+  void get(struct ndn_Exclude& excludeStruct) const;
   
   /**
    * Clear this Exclude, and set the entries by copying from the ndn_Exclude struct.
    * @param excludeStruct a C ndn_Exclude struct
    */
-  void set(const struct ndn_Exclude &excludeStruct);
+  void set(const struct ndn_Exclude& excludeStruct);
 
   /**
    * Add a new entry of type ndn_Exclude_ANY
@@ -122,9 +122,9 @@
  */
 class Interest {
 public:    
-  Interest(const Name &name, int minSuffixComponents, int maxSuffixComponents, 
-    const PublisherPublicKeyDigest &publisherPublicKeyDigest, const Exclude &exclude, int childSelector, int answerOriginKind, 
-    int scope, double interestLifetimeMilliseconds, const std::vector<unsigned char> &nonce) 
+  Interest(const Name& name, int minSuffixComponents, int maxSuffixComponents, 
+    const PublisherPublicKeyDigest& publisherPublicKeyDigest, const Exclude& exclude, int childSelector, int answerOriginKind, 
+    int scope, double interestLifetimeMilliseconds, const std::vector<unsigned char>& nonce) 
   : name_(name), minSuffixComponents_(minSuffixComponents), maxSuffixComponents_(maxSuffixComponents),
   publisherPublicKeyDigest_(publisherPublicKeyDigest), exclude_(exclude), childSelector_(childSelector), 
   answerOriginKind_(answerOriginKind), scope_(scope), interestLifetimeMilliseconds_(interestLifetimeMilliseconds),
@@ -132,8 +132,8 @@
   {
   }
 
-  Interest(const Name &name, int minSuffixComponents, int maxSuffixComponents, 
-    const PublisherPublicKeyDigest &publisherPublicKeyDigest, const Exclude &exclude, int childSelector, int answerOriginKind, 
+  Interest(const Name& name, int minSuffixComponents, int maxSuffixComponents, 
+    const PublisherPublicKeyDigest& publisherPublicKeyDigest, const Exclude& exclude, int childSelector, int answerOriginKind, 
     int scope, double interestLifetimeMilliseconds) 
   : name_(name), minSuffixComponents_(minSuffixComponents), maxSuffixComponents_(maxSuffixComponents),
   publisherPublicKeyDigest_(publisherPublicKeyDigest), exclude_(exclude), childSelector_(childSelector), 
@@ -141,14 +141,14 @@
   {
   }
 
-  Interest(const Name &name, double interestLifetimeMilliseconds) 
+  Interest(const Name& name, double interestLifetimeMilliseconds) 
   : name_(name)
   {
     construct();
     interestLifetimeMilliseconds_ = interestLifetimeMilliseconds;
   }
 
-  Interest(const Name &name) 
+  Interest(const Name& name) 
   : name_(name)
   {
     construct();
@@ -159,7 +159,7 @@
     construct();
   }
   
-  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat &wireFormat) const 
+  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat) const 
   {
     return wireFormat.encodeInterest(*this);
   }
@@ -167,7 +167,7 @@
   {
     return wireEncode(*WireFormat::getDefaultWireFormat());
   }
-  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat) 
+  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat) 
   {
     wireFormat.decodeInterest(*this, input, inputLength);
   }
@@ -175,11 +175,11 @@
   {
     wireDecode(input, inputLength, *WireFormat::getDefaultWireFormat());
   }
-  void wireDecode(const std::vector<unsigned char> &input, WireFormat &wireFormat) 
+  void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
-  void wireDecode(const std::vector<unsigned char> &input) 
+  void wireDecode(const std::vector<unsigned char>& input) 
   {
     wireDecode(&input[0], input.size());
   }
@@ -189,20 +189,20 @@
    * WARNING: The resulting pointers in interestStruct are invalid after a further use of this object which could reallocate memory.
    * @param interestStruct a C ndn_Interest struct where the name components array is already allocated.
    */
-  void get(struct ndn_Interest &interestStruct) const;
+  void get(struct ndn_Interest& interestStruct) const;
 
-  Name &getName() { return name_; }
-  const Name &getName() const { return name_; }
+  Name& getName() { return name_; }
+  const Name& getName() const { return name_; }
   
   int getMinSuffixComponents() const { return minSuffixComponents_; }
   
   int getMaxSuffixComponents() const { return maxSuffixComponents_; }
   
-  PublisherPublicKeyDigest &getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
-  const PublisherPublicKeyDigest &getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+  PublisherPublicKeyDigest& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  const PublisherPublicKeyDigest& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
 
-  Exclude &getExclude() { return exclude_; }
-  const Exclude &getExclude() const { return exclude_; }
+  Exclude& getExclude() { return exclude_; }
+  const Exclude& getExclude() const { return exclude_; }
   
   int getChildSelector() const { return childSelector_; }
 
@@ -212,13 +212,13 @@
 
   double getInterestLifetimeMilliseconds() const { return interestLifetimeMilliseconds_; }
 
-  const std::vector<unsigned char> &getNonce() const { return nonce_; }
+  const std::vector<unsigned char>& getNonce() const { return nonce_; }
   
   /**
    * Clear this interest, and set the values by copying from the interest struct.
    * @param interestStruct a C ndn_Interest struct
    */
-  void set(const struct ndn_Interest &interestStruct);
+  void set(const struct ndn_Interest& interestStruct);
   
   void setMinSuffixComponents(int value) { minSuffixComponents_ = value; }
   
@@ -232,7 +232,7 @@
 
   void setInterestLifetimeMilliseconds(double value) { interestLifetimeMilliseconds_ = value; }
 
-  void setNonce(const std::vector<unsigned char> &value) { nonce_ = value; }
+  void setNonce(const std::vector<unsigned char>& value) { nonce_ = value; }
   
 private:
   void construct() 
diff --git a/ndn-cpp/key.cpp b/ndn-cpp/key.cpp
index 7548968..6cdae60 100644
--- a/ndn-cpp/key.cpp
+++ b/ndn-cpp/key.cpp
@@ -10,7 +10,7 @@
 
 namespace ndn {
 
-void KeyLocator::get(struct ndn_KeyLocator &keyLocatorStruct) const 
+void KeyLocator::get(struct ndn_KeyLocator& keyLocatorStruct) const 
 {
   keyLocatorStruct.type = type_;
   
@@ -24,7 +24,7 @@
   keyLocatorStruct.keyNameType = keyNameType_;
 }
 
-void KeyLocator::set(const struct ndn_KeyLocator &keyLocatorStruct)
+void KeyLocator::set(const struct ndn_KeyLocator& keyLocatorStruct)
 {
   type_ = keyLocatorStruct.type;
   setVector(keyData_, keyLocatorStruct.keyData, keyLocatorStruct.keyDataLength);
diff --git a/ndn-cpp/key.hpp b/ndn-cpp/key.hpp
index 6fa2f05..a3784f6 100644
--- a/ndn-cpp/key.hpp
+++ b/ndn-cpp/key.hpp
@@ -24,26 +24,26 @@
    * WARNING: The resulting pointers in keyLocatorStruct are invalid after a further use of this object which could reallocate memory.
    * @param keyLocatorStruct a C ndn_KeyLocator struct where the name components array is already allocated.
    */
-  void get(struct ndn_KeyLocator &keyLocatorStruct) const;
+  void get(struct ndn_KeyLocator& keyLocatorStruct) const;
   
   /**
    * Clear this key locator, and set the values by copying from the ndn_KeyLocator struct.
    * @param keyLocatorStruct a C ndn_KeyLocator struct
    */
-  void set(const struct ndn_KeyLocator &keyLocatorStruct);
+  void set(const struct ndn_KeyLocator& keyLocatorStruct);
 
   ndn_KeyLocatorType getType() const { return type_; }
   
-  const std::vector<unsigned char> &getKeyData() const { return keyData_; }
+  const std::vector<unsigned char>& getKeyData() const { return keyData_; }
 
-  const Name &getKeyName() const { return keyName_; }
-  Name &getKeyName() { return keyName_; }
+  const Name& getKeyName() const { return keyName_; }
+  Name& getKeyName() { return keyName_; }
 
   ndn_KeyNameType getKeyNameType() const { return keyNameType_; }
 
   void setType(ndn_KeyLocatorType type) { type_ = type; }
   
-  void setKeyData(const std::vector<unsigned char> &keyData) { keyData_ = keyData; }
+  void setKeyData(const std::vector<unsigned char>& keyData) { keyData_ = keyData; }
   void setKeyData(const unsigned char *keyData, unsigned int keyDataLength) 
   { 
     setVector(keyData_, keyData, keyDataLength); 
@@ -52,12 +52,12 @@
   /**
    * @deprecated Use getKeyData().
    */
-  const std::vector<unsigned char> &getKeyOrCertificate() const { return getKeyData(); }
+  const std::vector<unsigned char>& getKeyOrCertificate() const { return getKeyData(); }
 
   /**
    * @deprecated Use setKeyData.
    */
-  void setKeyOrCertificate(const std::vector<unsigned char> &keyData) { setKeyData(keyData); }
+  void setKeyOrCertificate(const std::vector<unsigned char>& keyData) { setKeyData(keyData); }
   
   /**
    * @deprecated Use setKeyData.
diff --git a/ndn-cpp/name.cpp b/ndn-cpp/name.cpp
index bb2b144..488fcd5 100644
--- a/ndn-cpp/name.cpp
+++ b/ndn-cpp/name.cpp
@@ -17,7 +17,7 @@
  * Modify str in place to erase whitespace on the left.
  * @param str
  */
-static inline void trimLeft(string &str)
+static inline void trimLeft(string& str)
 {
   size_t found = str.find_first_not_of(WHITESPACE_CHARS);
   if (found != string::npos) {
@@ -33,7 +33,7 @@
  * Modify str in place to erase whitespace on the right.
  * @param str
  */
-static inline void trimRight(string &str)
+static inline void trimRight(string& str)
 {
   size_t found = str.find_last_not_of(WHITESPACE_CHARS);
   if (found != string::npos) {
@@ -49,7 +49,7 @@
  * Modify str in place to erase whitespace on the left and right.
  * @param str
  */
-static void trim(string &str)
+static void trim(string& str)
 {
   trimLeft(str);
   trimRight(str);
@@ -76,7 +76,7 @@
  * Return a copy of str, converting each escaped "%XX" to the char value.
  * @param str
  */
-static string unescape(const string &str)
+static string unescape(const string& str)
 {
   ostringstream result;
   
@@ -200,7 +200,7 @@
   }
 }
 
-void Name::get(struct ndn_Name &nameStruct) const
+void Name::get(struct ndn_Name& nameStruct) const
 {
   if (nameStruct.maxComponents < components_.size())
     throw runtime_error("nameStruct.maxComponents must be >= this name getNComponents()");
@@ -210,7 +210,7 @@
     components_[i].get(nameStruct.components[i]);
 }
   
-void Name::set(const struct ndn_Name &nameStruct) 
+void Name::set(const struct ndn_Name& nameStruct) 
 {
   clear();
   for (unsigned int i = 0; i < nameStruct.nComponents; ++i)
@@ -231,7 +231,7 @@
   return result.str();
 }
 
-bool Name::match(const Name &name) const
+bool Name::match(const Name& name) const
 {
   // Imitate ndn_Name_match.
   
@@ -252,7 +252,7 @@
 	return true;
 }
 
-void Name::toEscapedString(const vector<unsigned char> &value, ostringstream &result)
+void Name::toEscapedString(const vector<unsigned char>& value, ostringstream& result)
 {
   bool gotNonDot = false;
   for (unsigned i = 0; i < value.size(); ++i) {
diff --git a/ndn-cpp/name.hpp b/ndn-cpp/name.hpp
index dc59f06..f43a924 100644
--- a/ndn-cpp/name.hpp
+++ b/ndn-cpp/name.hpp
@@ -29,7 +29,7 @@
      * Create a new Name::Component, copying the given value.
      * @param value The value byte array.
      */
-    Component(const std::vector<unsigned char> &value) 
+    Component(const std::vector<unsigned char>& value) 
     : value_(value)
     {
     }
@@ -49,7 +49,7 @@
      * WARNING: The resulting pointer in componentStruct is invalid after a further use of this object which could reallocate memory.
      * @param componentStruct The C ndn_NameComponent struct to receive the pointer.
      */
-    void get(struct ndn_NameComponent &componentStruct) const 
+    void get(struct ndn_NameComponent& componentStruct) const 
     {
       componentStruct.valueLength = value_.size(); 
       if (value_.size() > 0)
@@ -66,7 +66,7 @@
      */
     bool setFromEscapedString(const char *first, const char *last);
   
-    const std::vector<unsigned char> &getValue() const { return value_; }
+    const std::vector<unsigned char>& getValue() const { return value_; }
     
     /**
      * Set this component to the encoded segment number.
@@ -88,7 +88,7 @@
    * Create a new Name, copying the name components.
    * @param components A vector of Component
    */
-  Name(const std::vector<Component> &components)
+  Name(const std::vector<Component>& components)
   : components_(components)
   {
   }
@@ -107,13 +107,13 @@
    * WARNING: The resulting pointers in nameStruct are invalid after a further use of this object which could reallocate memory.
    * @param nameStruct A C ndn_Name struct where the components array is already allocated.
    */
-  void get(struct ndn_Name &nameStruct) const;
+  void get(struct ndn_Name& nameStruct) const;
   
   /**
    * Clear this name, and set the components by copying from the name struct.
    * @param nameStruct A C ndn_Name struct
    */
-  void set(const struct ndn_Name &nameStruct);
+  void set(const struct ndn_Name& nameStruct);
   
   /**
    * Parse the uri according to the NDN URI Scheme and set the name with the components.
@@ -131,7 +131,7 @@
   /**
    * Add a new component, copying from value.
    */
-  void addComponent(const std::vector<unsigned char> &value) {
+  void addComponent(const std::vector<unsigned char>& value) {
     components_.push_back(value);
   }
   
@@ -150,7 +150,7 @@
     return components_.size();
   }
   
-  const Component &getComponent(unsigned int i) const { return components_[i]; }
+  const Component& getComponent(unsigned int i) const { return components_[i]; }
   
   /**
    * Encode this name as a URI.
@@ -181,7 +181,7 @@
    * @param name The Name to check.
    * @return true if this matches the given name, otherwise false.  This always returns true if this name is empty.
    */
-  bool match(const Name &name) const;
+  bool match(const Name& name) const;
   
   /**
    * Write the value to result, escaping characters according to the NDN URI Scheme.
@@ -189,7 +189,7 @@
    * @param value the buffer with the value to escape
    * @param result the string stream to write to.
    */
-  static void toEscapedString(const std::vector<unsigned char> &value, std::ostringstream &result);
+  static void toEscapedString(const std::vector<unsigned char>& value, std::ostringstream& result);
 
 private:
   std::vector<Component> components_;
diff --git a/ndn-cpp/node.cpp b/ndn-cpp/node.cpp
index 996fb64..1107a11 100644
--- a/ndn-cpp/node.cpp
+++ b/ndn-cpp/node.cpp
@@ -23,13 +23,13 @@
   return t.tv_sec * 1000.0 + t.tv_usec / 1000.0;
 }
 
-Node::Node(const ptr_lib::shared_ptr<Transport> &transport, const ptr_lib::shared_ptr<const Transport::ConnectionInfo> &connectionInfo)
+Node::Node(const ptr_lib::shared_ptr<Transport>& transport, const ptr_lib::shared_ptr<const Transport::ConnectionInfo>& connectionInfo)
 : transport_(transport), connectionInfo_(connectionInfo),
   ndndIdFetcherInterest_(Name("/%C1.M.S.localhost/%C1.M.SRV/ndnd/KEY"), 4000.0)
 {
 }
 
-void Node::expressInterest(const Interest &interest, const OnData &onData, const OnTimeout &onTimeout)
+void Node::expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout)
 {
   // TODO: Properly check if we are already connected to the expected host.
   if (!transport_->getIsConnected())
@@ -41,7 +41,7 @@
   transport_->send(*encoding);
 }
 
-void Node::registerPrefix(const Name &prefix, const OnInterest &onInterest, int flags)
+void Node::registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags)
 {
   if (ndndId_.size() == 0) {
     // First fetch the ndndId of the connected hub.
@@ -53,7 +53,7 @@
     registerPrefixHelper(prefix, onInterest, flags);
 }
 
-void Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest> &interest, const ptr_lib::shared_ptr<Data> &ndndIdData)
+void Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& ndndIdData)
 {
   if (ndndIdData->getSignedInfo().getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() > 0) {
     // Set the ndndId_ and continue.
@@ -64,12 +64,12 @@
   // TODO: else need to log not getting the ndndId.
 }
 
-void Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest> &timedOutInterest)
+void Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest>& timedOutInterest)
 {
   // TODO: Log the timeout.
 }
 
-void Node::registerPrefixHelper(const Name &prefix, const OnInterest &onInterest, int flags)
+void Node::registerPrefixHelper(const Name& prefix, const OnInterest& onInterest, int flags)
 {
   // Create a ForwardingEntry.
   ForwardingEntry forwardingEntry("selfreg", prefix, PublisherPublicKeyDigest(), -1, 3, 2147483647);
@@ -150,7 +150,7 @@
   transport_->close();
 }
 
-int Node::getEntryIndexForExpressedInterest(const Name &name)
+int Node::getEntryIndexForExpressedInterest(const Name& name)
 {
   // TODO: Doesn't this belong in the Name class?
   vector<struct ndn_NameComponent> nameComponents;
@@ -173,7 +173,7 @@
 	return iResult;
 }
   
-Node::PrefixEntry *Node::getEntryForRegisteredPrefix(const Name &name)
+Node::PrefixEntry *Node::getEntryForRegisteredPrefix(const Name& name)
 {
   int iResult = -1;
     
@@ -192,7 +192,7 @@
     return 0;
 }
 
-Node::PitEntry::PitEntry(const ptr_lib::shared_ptr<const Interest> &interest, const OnData &onData, const OnTimeout &onTimeout)
+Node::PitEntry::PitEntry(const ptr_lib::shared_ptr<const Interest>& interest, const OnData& onData, const OnTimeout& onTimeout)
 : interest_(interest), onData_(onData), onTimeout_(onTimeout)
 {
   // Set up timeoutTime_.
diff --git a/ndn-cpp/node.hpp b/ndn-cpp/node.hpp
index b82ba8a..9efb742 100644
--- a/ndn-cpp/node.hpp
+++ b/ndn-cpp/node.hpp
@@ -17,18 +17,18 @@
 /**
  * An OnData function object is used to pass a callback to expressInterest.
  */
-typedef func_lib::function<void(const ptr_lib::shared_ptr<const Interest> &, const ptr_lib::shared_ptr<Data> &)> OnData;
+typedef func_lib::function<void(const ptr_lib::shared_ptr<const Interest>& , const ptr_lib::shared_ptr<Data>& )> OnData;
 
 /**
  * An OnTimeout function object is used to pass a callback to expressInterest.
  */
-typedef func_lib::function<void(const ptr_lib::shared_ptr<const Interest> &)> OnTimeout;
+typedef func_lib::function<void(const ptr_lib::shared_ptr<const Interest>& )> OnTimeout;
 
 /**
  * An OnInterest function object is used to pass a callback to registerPrefix.
  */
 typedef func_lib::function<void
-  (const ptr_lib::shared_ptr<const Name> &, const ptr_lib::shared_ptr<const Interest> &, Transport &)> OnInterest;
+  (const ptr_lib::shared_ptr<const Name>& , const ptr_lib::shared_ptr<const Interest>& , Transport& )> OnInterest;
 
 class Face;
   
@@ -39,7 +39,7 @@
    * @param transport A shared_ptr to a Transport object used for communication.
    * @param transport A shared_ptr to a Transport::ConnectionInfo to be used to connect to the transport.
    */
-  Node(const ptr_lib::shared_ptr<Transport> &transport, const ptr_lib::shared_ptr<const Transport::ConnectionInfo> &connectionInfo);
+  Node(const ptr_lib::shared_ptr<Transport>& transport, const ptr_lib::shared_ptr<const Transport::ConnectionInfo>& connectionInfo);
   
   /**
    * Send the Interest through the transport, read the entire response and call onData(interest, data).
@@ -49,7 +49,7 @@
    * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
    * This copies the function object, so you may need to use func_lib::ref() as appropriate.
    */
-  void expressInterest(const Interest &interest, const OnData &onData, const OnTimeout &onTimeout);
+  void expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout);
   
   /**
    * Register prefix with the connected NDN hub and call onInterest when a matching interest is received.
@@ -58,7 +58,7 @@
    * use func_lib::ref() as appropriate.
    * @param flags The flags for finer control of which interests are forward to the application.
    */
-  void registerPrefix(const Name &prefix, const OnInterest &onInterest, int flags);
+  void registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags);
 
   /**
    * Process any data to receive.  For each element received, call onReceivedElement.
@@ -69,9 +69,9 @@
    */
   void processEvents();
   
-  const ptr_lib::shared_ptr<Transport> &getTransport() { return transport_; }
+  const ptr_lib::shared_ptr<Transport>& getTransport() { return transport_; }
   
-  const ptr_lib::shared_ptr<const Transport::ConnectionInfo> &getConnectionInfo() { return connectionInfo_; }
+  const ptr_lib::shared_ptr<const Transport::ConnectionInfo>& getConnectionInfo() { return connectionInfo_; }
 
   void onReceivedElement(const unsigned char *element, unsigned int elementLength);
   
@@ -86,11 +86,11 @@
      * @param onData A function object to call when a matching data packet is received.
      * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
      */
-    PitEntry(const ptr_lib::shared_ptr<const Interest> &interest, const OnData &onData, const OnTimeout &onTimeout);
+    PitEntry(const ptr_lib::shared_ptr<const Interest>& interest, const OnData& onData, const OnTimeout& onTimeout);
     
-    const ptr_lib::shared_ptr<const Interest> &getInterest() { return interest_; }
+    const ptr_lib::shared_ptr<const Interest>& getInterest() { return interest_; }
     
-    const OnData &getOnData() { return onData_; }
+    const OnData& getOnData() { return onData_; }
     
     /**
      * Get the struct ndn_Interest for the interest_.
@@ -100,7 +100,7 @@
      * @return A reference to the ndn_Interest struct.
      * WARNING: The resulting pointers in are invalid uses getInterest() to manipulate the object which could reallocate memory.
      */
-    const struct ndn_Interest &getInterestStruct()
+    const struct ndn_Interest& getInterestStruct()
     {
       return interestStruct_;
     }
@@ -131,14 +131,14 @@
      * @param prefix A shared_ptr for the prefix.
      * @param onInterest A function object to call when a matching data packet is received.
      */
-    PrefixEntry(const ptr_lib::shared_ptr<const Name> &prefix, const OnInterest &onInterest)
+    PrefixEntry(const ptr_lib::shared_ptr<const Name>& prefix, const OnInterest& onInterest)
     : prefix_(prefix), onInterest_(onInterest)
     {
     }
     
-    const ptr_lib::shared_ptr<const Name> &getPrefix() { return prefix_; }
+    const ptr_lib::shared_ptr<const Name>& getPrefix() { return prefix_; }
     
-    const OnInterest &getOnInterest() { return onInterest_; }
+    const OnInterest& getOnInterest() { return onInterest_; }
     
   private:
     ptr_lib::shared_ptr<const Name> prefix_;
@@ -162,22 +162,22 @@
      * @param interest
      * @param data
      */
-    void operator()(const ptr_lib::shared_ptr<const Interest> &interest, const ptr_lib::shared_ptr<Data> &ndndIdData);
+    void operator()(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& ndndIdData);
 
     /**
      * We timed out fetching the ndnd ID.
      * @param interest
      */
-    void operator()(const ptr_lib::shared_ptr<const Interest> &timedOutInterest);
+    void operator()(const ptr_lib::shared_ptr<const Interest>& timedOutInterest);
     
     class Info {
     public:
-      Info(Node *node, const Name &prefix, const OnInterest &onInterest, int flags)
+      Info(Node *node, const Name& prefix, const OnInterest& onInterest, int flags)
       : node_(*node), prefix_(prefix), onInterest_(onInterest), flags_(flags)
       {      
       }
       
-      Node &node_;
+      Node& node_;
       Name prefix_;
       const OnInterest onInterest_;
       int flags_;
@@ -193,14 +193,14 @@
    * @param name The name to find the interest for (from the incoming data packet).
    * @return The index in pit_ of the pit entry, or -1 if not found.
    */
-  int getEntryIndexForExpressedInterest(const Name &name);
+  int getEntryIndexForExpressedInterest(const Name& name);
   
   /**
    * Find the first entry from the registeredPrefixTable_ where the entry prefix is the longest that matches name.
    * @param name The name to find the PrefixEntry for (from the incoming interest packet).
    * @return A pointer to the entry, or 0 if not found.
    */
-  PrefixEntry *getEntryForRegisteredPrefix(const Name &name);
+  PrefixEntry *getEntryForRegisteredPrefix(const Name& name);
   
   /**
    * Do the work of registerPrefix once we know we are connected with an ndndId_.
@@ -208,7 +208,7 @@
    * @param onInterest
    * @param flags
    */
-  void registerPrefixHelper(const Name &prefix, const OnInterest &onInterest, int flags);
+  void registerPrefixHelper(const Name& prefix, const OnInterest& onInterest, int flags);
   
   ptr_lib::shared_ptr<Transport> transport_;
   ptr_lib::shared_ptr<const Transport::ConnectionInfo> connectionInfo_;
diff --git a/ndn-cpp/publisher-public-key-digest.hpp b/ndn-cpp/publisher-public-key-digest.hpp
index 02009b9..3b8dd56 100644
--- a/ndn-cpp/publisher-public-key-digest.hpp
+++ b/ndn-cpp/publisher-public-key-digest.hpp
@@ -26,7 +26,7 @@
    * WARNING: The resulting pointers in publisherPublicKeyDigestStruct are invalid after a further use of this object which could reallocate memory.
    * @param publisherPublicKeyDigestStruct a C ndn_PublisherPublicKeyDigest struct to receive the pointer
    */
-  void get(struct ndn_PublisherPublicKeyDigest &publisherPublicKeyDigestStruct) const 
+  void get(struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) const 
   {
     publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength = publisherPublicKeyDigest_.size();
     if (publisherPublicKeyDigest_.size() > 0)
@@ -39,16 +39,16 @@
    * Clear this PublisherPublicKeyDigest, and copy from the ndn_PublisherPublicKeyDigest struct.
    * @param excludeStruct a C ndn_Exclude struct
    */
-  void set(const struct ndn_PublisherPublicKeyDigest &publisherPublicKeyDigestStruct) 
+  void set(const struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) 
   {
     setVector(publisherPublicKeyDigest_, publisherPublicKeyDigestStruct.publisherPublicKeyDigest, 
               publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength);
   }
 
-  const std::vector<unsigned char> &getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
-  std::vector<unsigned char> &getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  const std::vector<unsigned char>& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+  std::vector<unsigned char>& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
 
-  void setPublisherPublicKeyDigest(const std::vector<unsigned char> &publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
+  void setPublisherPublicKeyDigest(const std::vector<unsigned char>& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
   void setPublisherPublicKeyDigest(const unsigned char *publisherPublicKeyDigest, unsigned int publisherPublicKeyDigestLength) 
   { 
     setVector(publisherPublicKeyDigest_, publisherPublicKeyDigest, publisherPublicKeyDigestLength); 
diff --git a/ndn-cpp/security/key-chain.cpp b/ndn-cpp/security/key-chain.cpp
index 65d61bb..9ba15f0 100644
--- a/ndn-cpp/security/key-chain.cpp
+++ b/ndn-cpp/security/key-chain.cpp
@@ -65,7 +65,7 @@
  * @param dataLength
  * @param digest
  */
-void setSha256(const unsigned char *data, unsigned int dataLength, vector<unsigned char> &digest)
+void setSha256(const unsigned char *data, unsigned int dataLength, vector<unsigned char>& digest)
 {
   unsigned char digestBuffer[SHA256_DIGEST_LENGTH];
   ndn_digestSha256(data, dataLength, digestBuffer);
@@ -77,7 +77,7 @@
  * @param data The Data object with the fields to digest.
  * @param digest A pointer to a buffer of size SHA256_DIGEST_LENGTH to receive the data.
  */
-static void digestDataFieldsSha256(const Data &data, WireFormat &wireFormat, unsigned char *digest)
+static void digestDataFieldsSha256(const Data& data, WireFormat& wireFormat, unsigned char *digest)
 {
   unsigned int signedFieldsBeginOffset, signedFieldsEndOffset;
   ptr_lib::shared_ptr<vector<unsigned char> > encoding = wireFormat.encodeData(data, &signedFieldsBeginOffset, &signedFieldsEndOffset);
@@ -86,8 +86,8 @@
 }
 
 void KeyChain::sign
-  (Data &data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
-   const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat &wireFormat)
+  (Data& data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
+   const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat& wireFormat)
 {
   // Set the public key.
   setSha256(publicKeyDer, publicKeyDerLength, data.getSignedInfo().getPublisherPublicKeyDigest().getPublisherPublicKeyDigest());
@@ -116,18 +116,18 @@
   data.getSignature().setSignature(signature, signatureLength);
 }
 
-void KeyChain::defaultSign(Data &data, WireFormat &wireFormat)
+void KeyChain::defaultSign(Data& data, WireFormat& wireFormat)
 {
   sign(data, DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER), DEFAULT_PRIVATE_KEY_DER, sizeof(DEFAULT_PRIVATE_KEY_DER), wireFormat);
 }
 
-void KeyChain::defaultSign(Data &data)
+void KeyChain::defaultSign(Data& data)
 {
   sign(data, DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER), DEFAULT_PRIVATE_KEY_DER, sizeof(DEFAULT_PRIVATE_KEY_DER),
        *WireFormat::getDefaultWireFormat());
 }
 
-bool KeyChain::selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat)
+bool KeyChain::selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat)
 {
   // Decode the data packet and digest the data fields.
   Data data;
diff --git a/ndn-cpp/security/key-chain.hpp b/ndn-cpp/security/key-chain.hpp
index 662e6a4..0d3873e 100644
--- a/ndn-cpp/security/key-chain.hpp
+++ b/ndn-cpp/security/key-chain.hpp
@@ -25,21 +25,21 @@
    * @param wireFormat The WireFormat for calling encodeData.
    */
   static void sign
-    (Data &data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
-     const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat &wireFormat);
+    (Data& data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
+     const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat& wireFormat);
 
   /**
    * Call sign with the default public and private keys.
    * @param data
    * @param wireFormat The WireFormat for calling encodeData.
    */
-  static void defaultSign(Data &data, WireFormat &wireFormat);
+  static void defaultSign(Data& data, WireFormat& wireFormat);
 
   /**
    * Call sign with the default public and private keys.  For wireFormat, use WireFormat::getDefaultWireFormat().
    * @param data
    */
-  static void defaultSign(Data &data);
+  static void defaultSign(Data& data);
   
   /**
    * Use the WireFormat to decode the input as a Data packet and use the public key in the key locator to 
@@ -51,7 +51,7 @@
    * @return true if the public key in the Data object verifies the object, false if not or if the Data object
    * doesn't have a public key.
    */
-  static bool selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat);
+  static bool selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat);
   
   static bool selfVerifyData(const unsigned char *input, unsigned int inputLength)
   {
diff --git a/ndn-cpp/transport/tcp-transport.cpp b/ndn-cpp/transport/tcp-transport.cpp
index 7c55d04..8d6810b 100644
--- a/ndn-cpp/transport/tcp-transport.cpp
+++ b/ndn-cpp/transport/tcp-transport.cpp
@@ -16,9 +16,9 @@
 {  
 }
 
-void TcpTransport::connect(const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener)
+void TcpTransport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener)
 {
-  const TcpTransport::ConnectionInfo &tcpConnectionInfo = dynamic_cast<const TcpTransport::ConnectionInfo &>(connectionInfo);
+  const TcpTransport::ConnectionInfo& tcpConnectionInfo = dynamic_cast<const TcpTransport::ConnectionInfo&>(connectionInfo);
   
   ndn_Error error;
   if ((error = ndn_TcpTransport_connect(&transport_, (char *)tcpConnectionInfo.getHost().c_str(), tcpConnectionInfo.getPort())))
diff --git a/ndn-cpp/transport/tcp-transport.hpp b/ndn-cpp/transport/tcp-transport.hpp
index b9c12bb..a13a1da 100644
--- a/ndn-cpp/transport/tcp-transport.hpp
+++ b/ndn-cpp/transport/tcp-transport.hpp
@@ -34,7 +34,7 @@
      * Get the host given to the constructor.
      * @return A string reference for the host.
      */
-    const std::string &getHost() const { return host_; }
+    const std::string& getHost() const { return host_; }
     
     /**
      * Get the port given to the constructor.
@@ -61,7 +61,7 @@
    * @param connectionInfo A reference to a TcpTransport::ConnectionInfo.
    * @param elementListener Not a shared_ptr because we assume that it will remain valid during the life of this object.
    */
-  virtual void connect(const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener);
+  virtual void connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener);
   
   /**
    * Set data to the host
diff --git a/ndn-cpp/transport/transport.cpp b/ndn-cpp/transport/transport.cpp
index 1636e4e..ad76dc2 100644
--- a/ndn-cpp/transport/transport.cpp
+++ b/ndn-cpp/transport/transport.cpp
@@ -14,7 +14,7 @@
 {  
 }
 
-void Transport::connect(const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener) 
+void Transport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener) 
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/transport/transport.hpp b/ndn-cpp/transport/transport.hpp
index b27039a..2e78b6e 100644
--- a/ndn-cpp/transport/transport.hpp
+++ b/ndn-cpp/transport/transport.hpp
@@ -27,7 +27,7 @@
    * @param connectionInfo A reference to an object of a subclass of ConnectionInfo.
    * @param elementListener Not a shared_ptr because we assume that it will remain valid during the life of this object.
    */
-  virtual void connect(const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener);
+  virtual void connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener);
   
   /**
    * Set data to the host
@@ -36,7 +36,7 @@
    */
   virtual void send(const unsigned char *data, unsigned int dataLength);
   
-  void send(const std::vector<unsigned char> &data)
+  void send(const std::vector<unsigned char>& data)
   {
     send(&data[0], data.size());
   }
diff --git a/ndn-cpp/transport/udp-transport.cpp b/ndn-cpp/transport/udp-transport.cpp
index e877a1f..2ac010a 100644
--- a/ndn-cpp/transport/udp-transport.cpp
+++ b/ndn-cpp/transport/udp-transport.cpp
@@ -16,9 +16,9 @@
 {  
 }
 
-void UdpTransport::connect(const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener)
+void UdpTransport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener)
 {
-  const UdpTransport::ConnectionInfo &udpConnectionInfo = dynamic_cast<const UdpTransport::ConnectionInfo &>(connectionInfo);
+  const UdpTransport::ConnectionInfo& udpConnectionInfo = dynamic_cast<const UdpTransport::ConnectionInfo&>(connectionInfo);
   
   ndn_Error error;
   if ((error = ndn_UdpTransport_connect(&transport_, (char *)udpConnectionInfo.getHost().c_str(), udpConnectionInfo.getPort())))
diff --git a/ndn-cpp/transport/udp-transport.hpp b/ndn-cpp/transport/udp-transport.hpp
index 3df6f93..3004088 100644
--- a/ndn-cpp/transport/udp-transport.hpp
+++ b/ndn-cpp/transport/udp-transport.hpp
@@ -34,7 +34,7 @@
      * Get the host given to the constructor.
      * @return A string reference for the host.
      */
-    const std::string &getHost() const { return host_; }
+    const std::string& getHost() const { return host_; }
     
     /**
      * Get the port given to the constructor.
@@ -61,7 +61,7 @@
    * @param connectionInfo A reference to a TcpTransport::ConnectionInfo.
    * @param elementListener Not a shared_ptr because we assume that it will remain valid during the life of this object.
    */
-  virtual void connect(const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener);
+  virtual void connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener);
   
   /**
    * Set data to the host
diff --git a/ndn-cpp/util/dynamic-uchar-vector.hpp b/ndn-cpp/util/dynamic-uchar-vector.hpp
index b24229b..07294fc 100644
--- a/ndn-cpp/util/dynamic-uchar-vector.hpp
+++ b/ndn-cpp/util/dynamic-uchar-vector.hpp
@@ -28,7 +28,7 @@
    * Get the shared_ptr to the allocated vector.
    * @return The shared_ptr to the allocated vector. 
    */
-  const ptr_lib::shared_ptr<std::vector<unsigned char> > &get() { return vector_; }
+  const ptr_lib::shared_ptr<std::vector<unsigned char> >& get() { return vector_; }
   
 private:
   /**
diff --git a/tests/test-encode-decode-data.cpp b/tests/test-encode-decode-data.cpp
index 0b4aa26..d550a16 100644
--- a/tests/test-encode-decode-data.cpp
+++ b/tests/test-encode-decode-data.cpp
@@ -59,7 +59,7 @@
 1
 };
 
-static void dumpData(const Data &data)
+static void dumpData(const Data& data)
 {
   cout << "name: " << data.getName().to_uri() << endl;
   if (data.getContent().size() > 0) {
@@ -173,7 +173,7 @@
     dumpData(freshData);
     ptr_lib::shared_ptr<vector<unsigned char> > freshEncoding = freshData.wireEncode();
     cout << "Freshly-signed Data signature verification: " << (KeyChain::selfVerifyData(&freshEncoding->front(), freshEncoding->size()) ? "VERIFIED" : "FAILED") << endl;
-  } catch (exception &e) {
+  } catch (exception& e) {
     cout << "exception: " << e.what() << endl;
   }
   return 0;
diff --git a/tests/test-encode-decode-forwarding-entry.cpp b/tests/test-encode-decode-forwarding-entry.cpp
index 89a7a80..dfa780e 100644
--- a/tests/test-encode-decode-forwarding-entry.cpp
+++ b/tests/test-encode-decode-forwarding-entry.cpp
@@ -57,12 +57,12 @@
 1
 };
 
-static inline string toString(const vector<unsigned char> &v)
+static inline string toString(const vector<unsigned char>& v)
 {
   return string(&v[0], &v[0] + v.size());
 }
 
-static void dumpForwardingEntry(const ForwardingEntry &forwardingEntry) 
+static void dumpForwardingEntry(const ForwardingEntry& forwardingEntry) 
 {
   cout << "action: " << forwardingEntry.getAction() << endl;
   cout << "prefix: " << forwardingEntry.getPrefix().to_uri() << endl;
@@ -89,7 +89,7 @@
  * Show the interest name and scope, and expect the name to have 4 components where the last component is a data packet 
  * whose content is a forwarding entry.
  */
-static void dumpInterestWithForwardingEntry(const Interest &interest)
+static void dumpInterestWithForwardingEntry(const Interest& interest)
 {
   if (interest.getName().getComponentCount() != 4) {
     cout << "Error: expected the interest name to have 4 components.  Got: " << interest.getName().to_uri() << endl;
@@ -129,7 +129,7 @@
     reDecodedInterest.wireDecode(*encoding);
     cout << "Re-decoded Interest:" << endl;
     dumpInterestWithForwardingEntry(reDecodedInterest);
-  } catch (exception &e) {
+  } catch (exception& e) {
     cout << "exception: " << e.what() << endl;
   }
   return 0;
diff --git a/tests/test-encode-decode-interest.cpp b/tests/test-encode-decode-interest.cpp
index 26d8269..ad638ce 100644
--- a/tests/test-encode-decode-interest.cpp
+++ b/tests/test-encode-decode-interest.cpp
@@ -30,7 +30,7 @@
 1
 };
 
-static void dumpInterest(const Interest &interest)
+static void dumpInterest(const Interest& interest)
 {
   cout << "name: " << interest.getName().to_uri() << endl;
   cout << "minSuffixComponents: ";
@@ -86,7 +86,7 @@
     reDecodedInterest.wireDecode(*encoding);
     cout << "Re-decoded Interest:" << endl;
     dumpInterest(reDecodedInterest);
-  } catch (exception &e) {
+  } catch (exception& e) {
     cout << "exception: " << e.what() << endl;
   }
   return 0;
diff --git a/tests/test-get-async.cpp b/tests/test-get-async.cpp
index da02c81..3c55b31 100644
--- a/tests/test-get-async.cpp
+++ b/tests/test-get-async.cpp
@@ -24,7 +24,7 @@
     callbackCount_ = 0;
   }
   
-  void onData(const ptr_lib::shared_ptr<const Interest> &interest, const ptr_lib::shared_ptr<Data> &data)
+  void onData(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& data)
   {
     ++callbackCount_;
     cout << "Got data packet with name " << data->getName().to_uri() << endl;
@@ -33,7 +33,7 @@
     cout << endl;  
   }
 
-  void onTimeout(const ptr_lib::shared_ptr<const Interest> &interest)
+  void onTimeout(const ptr_lib::shared_ptr<const Interest>& interest)
   {
     ++callbackCount_;
     cout << "Time out for interest " << interest->getName().toUri() << endl;    
@@ -69,7 +69,7 @@
       // We need to sleep for a few milliseconds so we don't use 100% of the CPU.
       usleep(10000);
     }
-  } catch (std::exception &e) {
+  } catch (std::exception& e) {
     cout << "exception: " << e.what() << endl;
   }
   return 0;
diff --git a/tests/test-publish-async.cpp b/tests/test-publish-async.cpp
index 5358169..e28871c 100644
--- a/tests/test-publish-async.cpp
+++ b/tests/test-publish-async.cpp
@@ -23,7 +23,7 @@
   }
   
   void operator()
-     (const ptr_lib::shared_ptr<const Name> &prefix, const ptr_lib::shared_ptr<const Interest> &interest, Transport &transport) {
+     (const ptr_lib::shared_ptr<const Name>& prefix, const ptr_lib::shared_ptr<const Interest>& interest, Transport& transport) {
     ++interestCount_;
     
     // Make and sign a Data packet.
@@ -58,7 +58,7 @@
       // We need to sleep for a few milliseconds so we don't use 100% of the CPU.
       usleep(10000);
     }
-  } catch (std::exception &e) {
+  } catch (std::exception& e) {
     cout << "exception: " << e.what() << endl;
   }
   return 0;
