Author: brane
Date: Fri Jan 4 16:10:53 2019
New Revision: 1850398
URL: http://svn.apache.org/viewvc?rev=1850398&view=rev
Log:
Make SVN++ compile and work without warnings in maintainer mode on Linux/g++.
* build.conf (svnxx-tests): Repeat the library dependencies of libsvnxx,
since our generator isn't smart enough to inherit its dependencies
at link time.
[in subversion/bindings/cxx]
* include/svnxx/exception.hpp (message::message): Fix -Wshadow.
* src/aprwrap/pool.hpp (pool::safe_alloc): Likewise.
* src/exception.cpp
(checked_call..error_deleter): Likewise.
(handle_one_error..message_builder::message_builder): Likewise.
* tests/test_revision.cpp (assignment): Do not rely on the system_clock's
time_point precision being smaller than the time we store in svn::revision.
Cast it to the nearest second instead.
* tests/test_strings.cpp (generate_string_data): Fix -Wsign-compare.
Modified:
subversion/trunk/build.conf
subversion/trunk/subversion/bindings/cxx/include/svnxx/exception.hpp
subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp
subversion/trunk/subversion/bindings/cxx/src/exception.cpp
subversion/trunk/subversion/bindings/cxx/tests/test_revision.cpp
subversion/trunk/subversion/bindings/cxx/tests/test_strings.cpp
Modified: subversion/trunk/build.conf
URL:
http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1850398&r1=1850397&r2=1850398&view=diff
==============================================================================
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Fri Jan 4 16:10:53 2019
@@ -747,7 +747,9 @@ description = Unit tests for Subversion
when = SVN_BUILD_SVNXX_TESTS
type = exe
path = subversion/bindings/cxx
-libs = libsvnxx apr
+libs = libsvnxx
+ libsvn_repos libsvn_client libsvn_wc libsvn_ra libsvn_delta libsvn_diff
+ libsvn_subr libsvn_fs aprutil apriconv apr
sources = tests/*.cpp
install = svnxx-tests
compile-cmd = $(COMPILE_SVNXX_TEST)
Modified: subversion/trunk/subversion/bindings/cxx/include/svnxx/exception.hpp
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/include/svnxx/exception.hpp?rev=1850398&r1=1850397&r2=1850398&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/include/svnxx/exception.hpp
(original)
+++ subversion/trunk/subversion/bindings/cxx/include/svnxx/exception.hpp Fri
Jan 4 16:10:53 2019
@@ -176,10 +176,10 @@ public:
protected:
message(int errval, const char* errname,
- const std::string& message, bool trace)
+ const std::string& message_, bool trace)
: m_errno(errval),
m_errname(errname),
- m_message(message),
+ m_message(message_),
m_trace(trace)
{}
Modified: subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp?rev=1850398&r1=1850397&r2=1850398&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/aprwrap/pool.hpp Fri Jan 4
16:10:53 2019
@@ -70,11 +70,11 @@ class pool : pool_ptr
using allocator = std::function<void*(apr_pool_t*,apr_size_t)>;
template<typename T>
- T* safe_alloc(std::size_t count, allocator alloc)
+ T* safe_alloc(std::size_t count, allocator allocate)
{
if (count > APR_SIZE_MAX / sizeof(T))
throw allocation_size_overflowed();
- return static_cast<T*>(alloc(get(), count * sizeof(T)));
+ return static_cast<T*>(allocate(get(), count * sizeof(T)));
}
public:
Modified: subversion/trunk/subversion/bindings/cxx/src/exception.cpp
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/exception.cpp?rev=1850398&r1=1850397&r2=1850398&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/exception.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/exception.cpp Fri Jan 4
16:10:53 2019
@@ -65,9 +65,9 @@ void checked_call(svn_error_t* const err
};
static const auto error_deleter =
- [](svn_error_t* err) noexcept
+ [](svn_error_t* err_) noexcept
{
- svn_error_clear(err);
+ svn_error_clear(err_);
};
for (auto next = err; next; next = next->child)
@@ -145,8 +145,8 @@ void handle_one_error(std::vector<error:
struct message_builder final : public error::message
{
message_builder(apr_status_t errval, const char* errname,
- const std::string& message, bool trace)
- : error::message(static_cast<int>(errval), errname, message, trace)
+ const std::string& message_, bool trace)
+ : error::message(static_cast<int>(errval), errname, message_, trace)
{}
};
Modified: subversion/trunk/subversion/bindings/cxx/tests/test_revision.cpp
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/tests/test_revision.cpp?rev=1850398&r1=1850397&r2=1850398&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/tests/test_revision.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/tests/test_revision.cpp Fri Jan 4
16:10:53 2019
@@ -132,9 +132,9 @@ BOOST_AUTO_TEST_CASE(postconditions_date
BOOST_AUTO_TEST_CASE(assignment)
{
+ using namespace std::chrono;
using kind = svn::revision::kind;
- using clock = std::chrono::system_clock;
- const auto timestamp = clock::now();
+ const auto timestamp = time_point_cast<seconds>(system_clock::now());
svn::revision r;
BOOST_TEST((r.get_kind() == kind::unspecified));
@@ -148,7 +148,7 @@ BOOST_AUTO_TEST_CASE(assignment)
r = svn::revision(timestamp);
BOOST_TEST((r.get_kind() == kind::date));
- BOOST_TEST((r.get_date<clock::duration>() == timestamp));
+ BOOST_TEST((r.get_date<system_clock::duration>() == timestamp));
BOOST_TEST((r.get_date<svn::revision::usec>() == timestamp));
}
Modified: subversion/trunk/subversion/bindings/cxx/tests/test_strings.cpp
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/tests/test_strings.cpp?rev=1850398&r1=1850397&r2=1850398&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/tests/test_strings.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/tests/test_strings.cpp Fri Jan 4
16:10:53 2019
@@ -142,11 +142,12 @@ inline std::vector<std::basic_string<C>>
std::u32string val;
val.reserve(len);
- for (int j = 0; j < len; ++j)
+ for (unsigned j = 0; j < len; ++j)
{
repeat:
auto c = cgen(mt);
- if (c >= cp::surrogate_min && c <= cp::surrogate_max)
+ if (uint_least32_t(c) >= cp::surrogate_min
+ && uint_least32_t(c) <= cp::surrogate_max)
goto repeat;
val.push_back(c);
}