From: Thomas Jarosch Date: Mon, 17 Oct 2011 08:47:42 +0000 (+0200) Subject: Remove unused variables X-Git-Tag: v2.6~39 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=ac4ebb4897e5b88856451a8de60c58a73b4ef7c3;p=libi2ncommon Remove unused variables --- diff --git a/src/ipfunc.cpp b/src/ipfunc.cpp index 7c917ec..95866f4 100644 --- a/src/ipfunc.cpp +++ b/src/ipfunc.cpp @@ -56,24 +56,23 @@ void IP_RANGE::swap(IP_RANGE& other) void IP_RANGE::load(const std::string& ip) { string::size_type delim_pos; - struct in_addr ia_ip1, ia_ip2; - + if ((delim_pos=ip.find('/')) != string::npos || (delim_pos=ip.find('-')) != string::npos) { if (delim_pos+1 >= ip.size()) throw runtime_error("invalid IP given: "+ip); - + if (ip.at(delim_pos) == '/') t=NETWORK; else t=RANGE; - + load(t,ip.substr(0,delim_pos),ip.substr(delim_pos+1)); } else { - load(IP,ip,""); + load(IP,ip,""); } } @@ -143,10 +142,8 @@ void IP_RANGE::load(type t, const std::string& ip, const std::string& mask_or_en void IP_RANGE::load(type t, unsigned int ip, unsigned int mask_or_end) { - struct in_addr ia_ip1, ia_ip2; - this->t=t; - + if (t==IP) { this->ip=ip; @@ -157,10 +154,10 @@ void IP_RANGE::load(type t, unsigned int ip, unsigned int mask_or_end) { this->ip=ip; this->mask=mask_or_end; - + // make sure ip is really the network address this->ip=(this->ip & this->mask); - + // calculate end of the network (=broadcast addr) this->end=((this->mask ^ 0xFFFFFFFF) | this->ip); } @@ -168,7 +165,7 @@ void IP_RANGE::load(type t, unsigned int ip, unsigned int mask_or_end) { this->ip=ip; this->end=mask_or_end; - + // Automatically turn IP if IP & end are swapped if (turn_ip(this->ip) > turn_ip(this->end)) { unsigned int tmp = this->ip;