From: JINMEI Tatuya Date: Thu, 28 Jun 2012 02:34:39 +0000 (+0530) Subject: [1774] Use uint8_t for name offsets X-Git-Tag: trac2351_base~215 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8acfde4201f10d86ee53d2c60701b222896fe088;p=thirdparty%2Fkea.git [1774] Use uint8_t for name offsets --- diff --git a/src/lib/dns/name.cc b/src/lib/dns/name.cc index 0a92d290de..7e2ed4c962 100644 --- a/src/lib/dns/name.cc +++ b/src/lib/dns/name.cc @@ -147,7 +147,7 @@ Name::Name(const std::string &namestring, bool downcase) { bool is_root = false; ft_state state = ft_init; - std::vector offsets; + std::vector offsets; offsets.reserve(Name::MAX_LABELS); offsets.push_back(0); @@ -310,7 +310,7 @@ typedef enum { } Name::Name(InputBuffer& buffer, bool downcase) { - std::vector offsets; + std::vector offsets; offsets.reserve(Name::MAX_LABELS); /* @@ -663,8 +663,8 @@ Name::reverse() const { retname.ndata_.reserve(length_); // Copy the original name, label by label, from tail to head. - vector::const_reverse_iterator rit0 = offsets_.rbegin(); - vector::const_reverse_iterator rit1 = rit0 + 1; + vector::const_reverse_iterator rit0 = offsets_.rbegin(); + vector::const_reverse_iterator rit1 = rit0 + 1; NameString::const_iterator n0 = ndata_.begin(); retname.offsets_.push_back(0); while (rit1 != offsets_.rend()) { diff --git a/src/lib/dns/name.h b/src/lib/dns/name.h index 84c243a21c..5ad0ba9f81 100644 --- a/src/lib/dns/name.h +++ b/src/lib/dns/name.h @@ -683,7 +683,7 @@ public: private: NameString ndata_; - std::vector offsets_; + std::vector offsets_; unsigned int length_; unsigned int labelcount_; };