Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
10d9ff6b
Commit
10d9ff6b
authored
Aug 08, 2013
by
Mukund Sivaraman
Browse files
[master] Fix const_reverse_iterator comparison with operator!= on Solaris GCC
parent
73372e3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/d2/d2_cfg_mgr.cc
View file @
10d9ff6b
...
...
@@ -21,6 +21,12 @@
namespace
isc
{
namespace
d2
{
namespace
{
typedef
std
::
vector
<
uint8_t
>
ByteAddress
;
}
// end of unnamed namespace
// *********************** D2CfgContext *************************
D2CfgContext
::
D2CfgContext
()
...
...
@@ -117,13 +123,20 @@ D2CfgMgr::reverseV4Address(const isc::asiolink::IOAddress& ioaddr) {
}
// Get the address in byte vector form.
std
::
vector
<
uint8_t
>
bytes
=
ioaddr
.
toBytes
();
const
ByteAddress
bytes
=
ioaddr
.
toBytes
();
// Walk backwards through vector outputting each octet and a dot.
std
::
ostringstream
stream
;
std
::
vector
<
uint8_t
>::
const_reverse_iterator
rit
;
for
(
rit
=
bytes
.
rbegin
();
rit
!=
bytes
.
rend
();
++
rit
)
{
// We have to set the following variable to get
// const_reverse_iterator type of rend(), otherwise Solaris GCC
// complains on operator!= by trying to use the non-const variant.
const
ByteAddress
::
const_reverse_iterator
end
=
bytes
.
rend
();
for
(
ByteAddress
::
const_reverse_iterator
rit
=
bytes
.
rbegin
();
rit
!=
end
;
++
rit
)
{
stream
<<
static_cast
<
unsigned
int
>
(
*
rit
)
<<
"."
;
}
...
...
@@ -140,14 +153,21 @@ D2CfgMgr::reverseV6Address(const isc::asiolink::IOAddress& ioaddr) {
}
// Turn the address into a string of digits.
std
::
vector
<
uint8_t
>
bytes
=
ioaddr
.
toBytes
();
std
::
string
digits
;
digits
=
isc
::
util
::
encode
::
encodeHex
(
bytes
);
const
ByteAddress
bytes
=
ioaddr
.
toBytes
();
const
std
::
string
digits
=
isc
::
util
::
encode
::
encodeHex
(
bytes
);
// Walk backwards through string outputting each digits and a dot.
std
::
ostringstream
stream
;
std
::
string
::
const_reverse_iterator
rit
;
for
(
rit
=
digits
.
rbegin
();
rit
!=
digits
.
rend
();
++
rit
)
{
// We have to set the following variable to get
// const_reverse_iterator type of rend(), otherwise Solaris GCC
// complains on operator!= by trying to use the non-const variant.
const
std
::
string
::
const_reverse_iterator
end
=
digits
.
rend
();
for
(
std
::
string
::
const_reverse_iterator
rit
=
digits
.
rbegin
();
rit
!=
end
;
++
rit
)
{
stream
<<
static_cast
<
char
>
(
*
rit
)
<<
"."
;
}
...
...
@@ -192,4 +212,3 @@ D2CfgMgr::createConfigParser(const std::string& config_id) {
};
// end of isc::dhcp namespace
};
// end of isc namespace
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment