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
445
Issues
445
List
Boards
Labels
Service Desk
Milestones
Merge Requests
71
Merge Requests
71
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
6add052a
Commit
6add052a
authored
Oct 06, 2019
by
Francis Dupont
Committed by
Tomek Mrugalski
Oct 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[497-kea-uses-deprecated-header] Fixed boost/{integer,math}/common_factor.h
parent
8fc3b82c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
m4macros/ax_boost_for_kea.m4
m4macros/ax_boost_for_kea.m4
+2
-0
src/lib/asiolink/Makefile.am
src/lib/asiolink/Makefile.am
+1
-1
src/lib/util/encode/base_n.cc
src/lib/util/encode/base_n.cc
+13
-5
No files found.
m4macros/ax_boost_for_kea.m4
View file @
6add052a
...
...
@@ -79,6 +79,8 @@ AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp boost/interprocess/sync
AC_CHECK_HEADERS(boost/asio/coroutine.hpp,,AC_MSG_RESULT(not found, using built-in header.))
AC_CHECK_HEADERS(boost/integer/common_factor.hpp)
# Verify that the path does not include standard headers by mistake.
# There are two regex.h headers: one is a standard system header (usually
# in /usr/include) and the second one is provided by boost. If you specify the
...
...
src/lib/asiolink/Makefile.am
View file @
6add052a
...
...
@@ -3,7 +3,7 @@ SUBDIRS = . testutils tests
AM_CPPFLAGS
=
-I
$(top_srcdir)
/src/lib
-I
$(top_builddir)
/src/lib
AM_CPPFLAGS
+=
$(BOOST_INCLUDES)
AM_CXXFLAGS
=
$(KEA_CXXFLAGS)
AM_CXXFLAGS
=
$(KEA_CXXFLAGS)
-Wno-non-virtual-dtor
CLEANFILES
=
*
.gcno
*
.gcda
...
...
src/lib/util/encode/base_n.cc
View file @
6add052a
// Copyright (C) 2010-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
9
Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
...
...
@@ -18,7 +18,11 @@
#include <boost/archive/iterators/base64_from_binary.hpp>
#include <boost/archive/iterators/binary_from_base64.hpp>
#include <boost/archive/iterators/transform_width.hpp>
#ifdef HAVE_BOOST_INTEGER_COMMON_FACTOR_HPP
#include <boost/integer/common_factor.hpp>
#else
#include <boost/math/common_factor.hpp>
#endif
#include <stdint.h>
#include <stdexcept>
...
...
@@ -68,7 +72,7 @@ class IncompleteBaseInput : public std::exception {
//
// Its dereference operator
// retrieves BitsIn bits from the result of "*Base" (if necessary it
// internally calls ++Base)
// internally calls ++Base)
//
// A conceptual description of how the encoding and decoding work is as
// follows:
...
...
@@ -93,7 +97,7 @@ namespace {
// Common constants used for all baseN encoding.
const
char
BASE_PADDING_CHAR
=
'='
;
const
uint8_t
BINARY_ZERO_CODE
=
0
;
// EncodeNormalizer is an input iterator intended to be used as a filter
// between the binary stream and baseXX_from_binary translator (via
// transform_width). An EncodeNormalizer object is configured with two
...
...
@@ -267,7 +271,11 @@ struct BaseNTransformer {
// without padding. It's the least common multiple of 8 and BitsPerChunk,
// e.g. 24 for base64.
static
const
int
BITS_PER_GROUP
=
#ifdef HAVE_BOOST_INTEGER_COMMON_FACTOR_HPP
boost
::
integer
::
static_lcm
<
BitsPerChunk
,
8
>::
value
;
#else
boost
::
math
::
static_lcm
<
BitsPerChunk
,
8
>::
value
;
#endif
// MAX_PADDING_CHARS is the maximum number of padding characters
// that can appear in a valid baseN encoded text.
...
...
@@ -281,7 +289,7 @@ struct BaseNTransformer {
static
const
int
MAX_PADDING_CHARS
=
BITS_PER_GROUP
/
BitsPerChunk
-
(
8
/
BitsPerChunk
+
((
8
%
BitsPerChunk
)
==
0
?
0
:
1
));
};
};
template
<
int
BitsPerChunk
,
char
BaseZeroCode
,
typename
Encoder
,
typename
Decoder
>
...
...
@@ -341,7 +349,7 @@ BaseNTransformer<BitsPerChunk, BaseZeroCode, Encoder, Decoder>::decode(
// 0000...0 0......0 000...
// 0 7 8 15 16.... (bits)
// The number of bits for the '==...' part is padchars * BitsPerChunk.
// So the total number of padding bits is the smallest multiple of 8
// So the total number of padding bits is the smallest multiple of 8
// that is >= padchars * BitsPerChunk.
// (Below, note the common idiom of the bitwise AND with ~7. It clears the
// lowest three bits, so has the effect of rounding the result down to the
...
...
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