Commit 0596cd9d authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2097] cleanup: add trailing _ to private member variables.

this will help prevent accidental direct misuse of these variables
parent 879a7359
......@@ -135,7 +135,7 @@ RdataSet::destroy(util::MemorySegment& mem_sgmt, RRClass rrclass,
rdataset->getRdataCount(),
rdataset->getSigRdataCount()).getSize();
const size_t ext_rrsig_count_len =
rdataset->sig_rdata_count >= MANY_RRSIG_COUNT ? sizeof(uint16_t) : 0;
rdataset->sig_rdata_count_ >= MANY_RRSIG_COUNT ? sizeof(uint16_t) : 0;
rdataset->~RdataSet();
mem_sgmt.deallocate(rdataset,
sizeof(RdataSet) + ext_rrsig_count_len + data_len);
......@@ -159,12 +159,12 @@ convertTTL(RRTTL ttl) {
}
}
RdataSet::RdataSet(RRType type_param, size_t rdata_count_param,
size_t sig_rdata_count_param, RRTTL ttl_param) :
RdataSet::RdataSet(RRType type_param, size_t rdata_count,
size_t sig_rdata_count, RRTTL ttl) :
type(type_param),
sig_rdata_count(sig_rdata_count_param >= MANY_RRSIG_COUNT ?
MANY_RRSIG_COUNT : sig_rdata_count_param),
rdata_count(rdata_count_param), ttl(convertTTL(ttl_param))
sig_rdata_count_(sig_rdata_count >= MANY_RRSIG_COUNT ?
MANY_RRSIG_COUNT : sig_rdata_count),
rdata_count_(rdata_count), ttl_(convertTTL(ttl))
{
// Make sure an RRType object is essentially a plain 16-bit value, so
// our assumption of the size of RdataSet holds. If it's not the case
......
......@@ -60,25 +60,25 @@ public:
RdataSetPtr next;
const dns::RRType type;
private:
const uint16_t sig_rdata_count : 3;
const uint16_t rdata_count : 13;
const uint32_t ttl; ///< TTL of the RdataSet, net byte order
const uint16_t sig_rdata_count_ : 3;
const uint16_t rdata_count_ : 13;
const uint32_t ttl_; ///< TTL of the RdataSet, net byte order
static const size_t MAX_RDATA_COUNT = (1 << 13) - 1;
static const size_t MAX_RRSIG_COUNT = (1 << 16) - 1;
static const size_t MANY_RRSIG_COUNT = (1 << 3) - 1;
public:
size_t getRdataCount() const { return (rdata_count); }
size_t getRdataCount() const { return (rdata_count_); }
size_t getSigRdataCount() const {
if (sig_rdata_count < MANY_RRSIG_COUNT) {
return (sig_rdata_count);
if (sig_rdata_count_ < MANY_RRSIG_COUNT) {
return (sig_rdata_count_);
} else {
return (*getExtSIGCountBuf());
}
}
const void* getTTLData() const { return (&ttl); }
const void* getTTLData() const { return (&ttl_); }
void* getDataBuf() {
if (sig_rdata_count < MANY_RRSIG_COUNT) {
if (sig_rdata_count_ < MANY_RRSIG_COUNT) {
return (this + 1);
} else {
return (getExtSIGCountBuf() + 1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment