summaryrefslogtreecommitdiffstats
path: root/src/lib/dns/message.cc
diff options
context:
space:
mode:
authorMukund Sivaraman <muks@isc.org>2013-09-18 20:15:22 +0200
committerMukund Sivaraman <muks@isc.org>2013-09-19 07:34:20 +0200
commit8842945c12181ee427f7dfc1e7c1e1032f9cc25f (patch)
treefe9bb11b1e52fd8ec848b724f63c61967c0dc55f /src/lib/dns/message.cc
parent[master] merged trac3170 to address parallel build issues (diff)
downloadkea-8842945c12181ee427f7dfc1e7c1e1032f9cc25f.tar.xz
kea-8842945c12181ee427f7dfc1e7c1e1032f9cc25f.zip
[3172] static_cast enums before comparing them against ints
Diffstat (limited to 'src/lib/dns/message.cc')
-rw-r--r--src/lib/dns/message.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/dns/message.cc b/src/lib/dns/message.cc
index dba0e7b895..89da4979ff 100644
--- a/src/lib/dns/message.cc
+++ b/src/lib/dns/message.cc
@@ -495,7 +495,7 @@ Message::getTSIGRecord() const {
unsigned int
Message::getRRCount(const Section section) const {
- if (section >= MessageImpl::NUM_SECTIONS) {
+ if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
isc_throw(OutOfRange, "Invalid message section: " << section);
}
return (impl_->counts_[section]);
@@ -511,7 +511,7 @@ Message::addRRset(const Section section, RRsetPtr rrset) {
isc_throw(InvalidMessageOperation,
"addRRset performed in non-render mode");
}
- if (section >= MessageImpl::NUM_SECTIONS) {
+ if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
isc_throw(OutOfRange, "Invalid message section: " << section);
}
@@ -524,7 +524,7 @@ bool
Message::hasRRset(const Section section, const Name& name,
const RRClass& rrclass, const RRType& rrtype)
{
- if (section >= MessageImpl::NUM_SECTIONS) {
+ if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
isc_throw(OutOfRange, "Invalid message section: " << section);
}
@@ -546,7 +546,7 @@ Message::hasRRset(const Section section, const RRsetPtr& rrset) {
bool
Message::removeRRset(const Section section, RRsetIterator& iterator) {
- if (section >= MessageImpl::NUM_SECTIONS) {
+ if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
isc_throw(OutOfRange, "Invalid message section: " << section);
}
@@ -575,7 +575,7 @@ Message::clearSection(const Section section) {
isc_throw(InvalidMessageOperation,
"clearSection performed in non-render mode");
}
- if (section >= MessageImpl::NUM_SECTIONS) {
+ if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
isc_throw(OutOfRange, "Invalid message section: " << section);
}
if (section == Message::SECTION_QUESTION) {
@@ -732,7 +732,7 @@ int
MessageImpl::parseSection(const Message::Section section,
InputBuffer& buffer, Message::ParseOptions options)
{
- assert(section < MessageImpl::NUM_SECTIONS);
+ assert(static_cast<int>(section) < MessageImpl::NUM_SECTIONS);
unsigned int added = 0;
@@ -984,7 +984,7 @@ Message::clear(Mode mode) {
void
Message::appendSection(const Section section, const Message& source) {
- if (section >= MessageImpl::NUM_SECTIONS) {
+ if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
isc_throw(OutOfRange, "Invalid message section: " << section);
}
@@ -1130,7 +1130,7 @@ Message::endQuestion() const {
///
const SectionIterator<RRsetPtr>
Message::beginSection(const Section section) const {
- if (section >= MessageImpl::NUM_SECTIONS) {
+ if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
isc_throw(OutOfRange, "Invalid message section: " << section);
}
if (section == SECTION_QUESTION) {
@@ -1143,7 +1143,7 @@ Message::beginSection(const Section section) const {
const SectionIterator<RRsetPtr>
Message::endSection(const Section section) const {
- if (section >= MessageImpl::NUM_SECTIONS) {
+ if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
isc_throw(OutOfRange, "Invalid message section: " << section);
}
if (section == SECTION_QUESTION) {