Author: brane
Date: Fri Dec 28 12:35:55 2018
New Revision: 1849843

URL: http://svn.apache.org/viewvc?rev=1849843&view=rev
Log:
Fix maintainer-mode warnings in SVN++, some of which were actually errors.

[in subversion/bindings/cxx]
* src/depth.cpp
  (svn_depth_t convert(depth), depth convert(svn_depth_t): Cast enum values
   to the appropriate type for comparison.

* src/revision.cpp
  (svn_opt_revision_kind convert(revision::kind,
   revision::kind convert(svn_opt_revision_kind): Likewise, and add the missing
   debug-mode check for the value of svn_opt_revision_previous.

* tests/test_revision.cpp
  (postconditions_kind): Remove unused local typedef.

Modified:
    subversion/trunk/subversion/bindings/cxx/src/depth.cpp
    subversion/trunk/subversion/bindings/cxx/src/revision.cpp
    subversion/trunk/subversion/bindings/cxx/tests/test_revision.cpp

Modified: subversion/trunk/subversion/bindings/cxx/src/depth.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/depth.cpp?rev=1849843&r1=1849842&r2=1849843&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/depth.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/depth.cpp Fri Dec 28 12:35:55 
2018
@@ -58,32 +58,32 @@ svn_depth_t convert(depth d)
   switch (d)
     {
     case depth::unknown:
-      if (d != svn_depth_unknown)
+      if (svn_depth_t(d) != svn_depth_unknown)
         throw std::range_error("convert svn::depth::unknown");
       break;
 
     case depth::exclude:
-      if (d != svn_depth_exclude)
+      if (svn_depth_t(d) != svn_depth_exclude)
         throw std::range_error("convert svn::depth::exclude");
       break;
 
     case depth::empty:
-      if (d != svn_depth_empty)
+      if (svn_depth_t(d) != svn_depth_empty)
         throw std::range_error("convert svn::depth::empty");
       break;
 
     case depth::files:
-      if (d != svn_depth_files)
+      if (svn_depth_t(d) != svn_depth_files)
         throw std::range_error("convert svn::depth::files");
       break;
 
     case depth::immediates:
-      if (d != svn_depth_immediates)
+      if (svn_depth_t(d) != svn_depth_immediates)
         throw std::range_error("convert svn::depth::immediates");
       break;
 
     case depth::infinity:
-      if (d != svn_depth_infinity)
+      if (svn_depth_t(d) != svn_depth_infinity)
         throw std::range_error("convert svn::depth::infinity");
       break;
 
@@ -100,32 +100,32 @@ depth convert(svn_depth_t d)
   switch (d)
     {
     case svn_depth_unknown:
-      if (d != depth::unknown)
+      if (d != svn_depth_t(depth::unknown))
         throw std::range_error("convert svn_depth_unknown");
       break;
 
     case svn_depth_exclude:
-      if (d != depth::exclude)
+      if (d != svn_depth_t(depth::exclude))
         throw std::range_error("convert svn_depth_exclude");
       break;
 
     case svn_depth_empty:
-      if (d != depth::empty)
+      if (d != svn_depth_t(depth::empty))
         throw std::range_error("convert svn_depth_empty");
       break;
 
     case svn_depth_files:
-      if (d != depth::files)
+      if (d != svn_depth_t(depth::files))
         throw std::range_error("convert svn_depth_files");
       break;
 
     case svn_depth_immediates:
-      if (d != depth::immediates)
+      if (d != svn_depth_t(depth::immediates))
         throw std::range_error("convert svn_depth_immediates");
       break;
 
     case svn_depth_infinity:
-      if (d != depth::infinity)
+      if (d != svn_depth_t(depth::infinity))
         throw std::range_error("convert svn_depth_infinity");
       break;
 

Modified: subversion/trunk/subversion/bindings/cxx/src/revision.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/cxx/src/revision.cpp?rev=1849843&r1=1849842&r2=1849843&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/src/revision.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/src/revision.cpp Fri Dec 28 
12:35:55 2018
@@ -36,37 +36,42 @@ svn_opt_revision_kind convert(revision::
   switch (kind)
     {
     case revision::kind::unspecified:
-      if (kind != svn_opt_revision_unspecified)
+      if (svn_opt_revision_kind(kind) != svn_opt_revision_unspecified)
         throw std::range_error("convert svn::revision::kind::unspecified");
       break;
 
     case revision::kind::number:
-      if (kind != svn_opt_revision_number)
+      if (svn_opt_revision_kind(kind) != svn_opt_revision_number)
         throw std::range_error("convert svn::revision::kind::number");
       break;
 
     case revision::kind::date:
-      if (kind != svn_opt_revision_date)
+      if (svn_opt_revision_kind(kind) != svn_opt_revision_date)
         throw std::range_error("convert svn::revision::kind::date");
       break;
 
     case revision::kind::committed:
-      if (kind != svn_opt_revision_committed)
+      if (svn_opt_revision_kind(kind) != svn_opt_revision_committed)
         throw std::range_error("convert svn::revision::kind::committed");
       break;
 
+    case revision::kind::previous:
+      if (svn_opt_revision_kind(kind) != svn_opt_revision_previous)
+        throw std::range_error("convert svn::revision::kind::previous");
+      break;
+
     case revision::kind::base:
-      if (kind != svn_opt_revision_base)
+      if (svn_opt_revision_kind(kind) != svn_opt_revision_base)
         throw std::range_error("convert svn::revision::kind::base");
       break;
 
     case revision::kind::working:
-      if (kind != svn_opt_revision_working)
+      if (svn_opt_revision_kind(kind) != svn_opt_revision_working)
         throw std::range_error("convert svn::revision::kind::working");
       break;
 
     case revision::kind::head:
-      if (kind != svn_opt_revision_head)
+      if (svn_opt_revision_kind(kind) != svn_opt_revision_head)
         throw std::range_error("convert svn::revision::kind::head");
       break;
 
@@ -83,37 +88,42 @@ revision::kind convert(svn_opt_revision_
   switch (kind)
     {
     case svn_opt_revision_unspecified:
-      if (kind != revision::kind::unspecified)
+      if (kind != svn_opt_revision_kind(revision::kind::unspecified))
         throw std::range_error("convert svn_opt_revision_unspecified");
       break;
 
     case svn_opt_revision_number:
-      if (kind != revision::kind::number)
+      if (kind != svn_opt_revision_kind(revision::kind::number))
         throw std::range_error("convert svn_opt_revision_number");
       break;
 
     case svn_opt_revision_date:
-      if (kind != revision::kind::date)
+      if (kind != svn_opt_revision_kind(revision::kind::date))
         throw std::range_error("convert svn_opt_revision_date");
       break;
 
     case svn_opt_revision_committed:
-      if (kind != revision::kind::committed)
+      if (kind != svn_opt_revision_kind(revision::kind::committed))
         throw std::range_error("convert svn_opt_revision_committed");
       break;
 
+    case svn_opt_revision_previous:
+      if (kind != svn_opt_revision_kind(revision::kind::previous))
+        throw std::range_error("convert svn_opt_revision_previous");
+      break;
+
     case svn_opt_revision_base:
-      if (kind != revision::kind::base)
+      if (kind != svn_opt_revision_kind(revision::kind::base))
         throw std::range_error("convert svn_opt_revision_base");
       break;
 
     case svn_opt_revision_working:
-      if (kind != revision::kind::working)
+      if (kind != svn_opt_revision_kind(revision::kind::working))
         throw std::range_error("convert svn_opt_revision_working");
       break;
 
     case svn_opt_revision_head:
-      if (kind != revision::kind::head)
+      if (kind != svn_opt_revision_kind(revision::kind::head))
         throw std::range_error("convert svn_opt_revision_head");
       break;
 

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=1849843&r1=1849842&r2=1849843&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/cxx/tests/test_revision.cpp (original)
+++ subversion/trunk/subversion/bindings/cxx/tests/test_revision.cpp Fri Dec 28 
12:35:55 2018
@@ -89,8 +89,6 @@ BOOST_AUTO_TEST_CASE(preconditions)
 BOOST_AUTO_TEST_CASE(postconditions_kind)
 {
   using kind = svn::revision::kind;
-  using usec = svn::revision::usec;
-
   BOOST_TEST((svn::revision(kind::unspecified).get_kind() == 
kind::unspecified));
   BOOST_TEST((svn::revision(kind::committed)  .get_kind() == kind::committed));
   BOOST_TEST((svn::revision(kind::previous)   .get_kind() == kind::previous));


Reply via email to