Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
450
Issues
450
List
Boards
Labels
Service Desk
Milestones
Merge Requests
75
Merge Requests
75
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
10d9ff6b
Commit
10d9ff6b
authored
Aug 08, 2013
by
Mukund Sivaraman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[master] Fix const_reverse_iterator comparison with operator!= on Solaris GCC
parent
73372e3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
+28
-9
src/bin/d2/d2_cfg_mgr.cc
src/bin/d2/d2_cfg_mgr.cc
+28
-9
No files found.
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