src: Enabling -Werror in debug mode and some style updates

Several important warnings are still getting suppressed, because of
CryptoPP library

Change-Id: I8fb3d938544ecc38c65529262504dc753124bafd
diff --git a/src/util/regex/regex-backref-matcher.hpp b/src/util/regex/regex-backref-matcher.hpp
index 5ae5f35..e2eabe8 100644
--- a/src/util/regex/regex-backref-matcher.hpp
+++ b/src/util/regex/regex-backref-matcher.hpp
@@ -30,9 +30,6 @@
 protected:
   virtual void 
   compile();
-    
-private:
-  int m_refNum;
 };
 
 } // namespace ndn
diff --git a/src/util/regex/regex-component-matcher.hpp b/src/util/regex/regex-component-matcher.hpp
index b102316..50cb8de 100644
--- a/src/util/regex/regex-component-matcher.hpp
+++ b/src/util/regex/regex-component-matcher.hpp
@@ -72,7 +72,7 @@
   m_pseudoMatcher.clear();
   m_pseudoMatcher.push_back(ptr_lib::make_shared<RegexPseudoMatcher>());
 
-  for (int i = 1; i < m_componentRegex.mark_count(); i++)
+  for (size_t i = 1; i < m_componentRegex.mark_count(); i++)
     {
       ptr_lib::shared_ptr<RegexPseudoMatcher> pMatcher = ptr_lib::make_shared<RegexPseudoMatcher>();
       m_pseudoMatcher.push_back(pMatcher);
@@ -102,7 +102,7 @@
       std::string targetStr = name.get(offset).toEscapedString();
       if(boost::regex_match(targetStr, subResult, m_componentRegex))
         {
-          for (int i = 1; i < m_componentRegex.mark_count(); i++)
+          for (size_t i = 1; i < m_componentRegex.mark_count(); i++)
             {
               m_pseudoMatcher[i]->resetMatchResult();
               m_pseudoMatcher[i]->setMatchResult(subResult[i]);
diff --git a/src/util/regex/regex-component-set-matcher.hpp b/src/util/regex/regex-component-set-matcher.hpp
index ffb4c6d..857c59e 100644
--- a/src/util/regex/regex-component-set-matcher.hpp
+++ b/src/util/regex/regex-component-set-matcher.hpp
@@ -107,9 +107,9 @@
 inline void 
 RegexComponentSetMatcher::compileSingleComponent()
 {
-  int end = extractComponent(1);
+  size_t end = extractComponent(1);
 
-  if(m_expr.size() != end)
+  if (m_expr.size() != end)
     {
       throw RegexMatcher::Error(std::string("Error: RegexComponentSetMatcher.compileSingleComponent: ")
                                 + m_expr);
diff --git a/src/util/regex/regex-matcher.hpp b/src/util/regex/regex-matcher.hpp
index baa8bf3..0d34311 100644
--- a/src/util/regex/regex-matcher.hpp
+++ b/src/util/regex/regex-matcher.hpp
@@ -66,7 +66,7 @@
 
 private:
   bool 
-  recursiveMatch(const int& mId, const Name& name, const int& offset, const int& len);
+  recursiveMatch(size_t mId, const Name& name, size_t offset, size_t len);
 
 
 protected:
@@ -124,7 +124,7 @@
 }
   
 inline bool 
-RegexMatcher::recursiveMatch(const int& mId, const Name& name, const int& offset, const int& len)
+RegexMatcher::recursiveMatch(size_t mId, const Name& name, size_t offset, size_t len)
 {
   // _LOG_TRACE ("Enter RegexMatcher::recursiveMatch");
 
diff --git a/src/util/regex/regex-pattern-list-matcher.hpp b/src/util/regex/regex-pattern-list-matcher.hpp
index 84b5c46..3ae74f1 100644
--- a/src/util/regex/regex-pattern-list-matcher.hpp
+++ b/src/util/regex/regex-pattern-list-matcher.hpp
@@ -32,10 +32,10 @@
   extractPattern(int index, int* next);
     
   int 
-  extractSubPattern(const char left, const char right, int index);
+  extractSubPattern(const char left, const char right, size_t index);
     
   int 
-  extractRepetition(int index);
+  extractRepetition(size_t index);
 
 private:
 
@@ -121,10 +121,10 @@
 }
   
 inline int 
-RegexPatternListMatcher::extractSubPattern(const char left, const char right, int index)
+RegexPatternListMatcher::extractSubPattern(const char left, const char right, size_t index)
 {
-  int lcount = 1;
-  int rcount = 0;
+  size_t lcount = 1;
+  size_t rcount = 0;
 
   while(lcount > rcount){
 
@@ -143,9 +143,9 @@
 }
 
 inline int 
-RegexPatternListMatcher::extractRepetition(int index)
+RegexPatternListMatcher::extractRepetition(size_t index)
 {
-  int exprSize = m_expr.size();
+  size_t exprSize = m_expr.size();
 
   if(index == exprSize)
     return index;
diff --git a/src/util/regex/regex-top-matcher.cpp b/src/util/regex/regex-top-matcher.cpp
index 38f1a5a..d3b8271 100644
--- a/src/util/regex/regex-top-matcher.cpp
+++ b/src/util/regex/regex-top-matcher.cpp
@@ -95,8 +95,8 @@
   else
     expand = m_expand;
 
-  int offset = 0;
-  while(offset < expand.size())
+  size_t offset = 0;
+  while (offset < expand.size())
     {
       std::string item = getItemFromExpand(expand, offset);
       if(item[0] == '<')
@@ -129,9 +129,9 @@
 }
 
 std::string
-RegexTopMatcher::getItemFromExpand(const std::string& expand, int & offset)
+RegexTopMatcher::getItemFromExpand(const std::string& expand, size_t& offset)
 {
-  int begin = offset;
+  size_t begin = offset;
 
   if(expand[offset] == '\\')
     {
@@ -155,8 +155,8 @@
       if(offset >= expand.size())
         throw RegexMatcher::Error("wrong format of expand string!");
         
-      int left = 1;
-      int right = 0;
+      size_t left = 1;
+      size_t right = 0;
       while(right < left)
         {
           if(expand[offset] == '<')
@@ -196,7 +196,7 @@
 RegexTopMatcher::convertSpecialChar(const std::string& str)
 {
   std::string newStr;
-  for(int i = 0; i < str.size(); i++)
+  for(size_t i = 0; i < str.size(); i++)
     {
       char c = str[i];
       switch(c)
diff --git a/src/util/regex/regex-top-matcher.hpp b/src/util/regex/regex-top-matcher.hpp
index fc4a0df..4d9c01e 100644
--- a/src/util/regex/regex-top-matcher.hpp
+++ b/src/util/regex/regex-top-matcher.hpp
@@ -43,7 +43,7 @@
 
 private:
   std::string
-  getItemFromExpand(const std::string& expand, int & offset);
+  getItemFromExpand(const std::string& expand, size_t& offset);
 
   static std::string
   convertSpecialChar(const std::string& str);