]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: eliminate compiler warnings 13729/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 1 Mar 2017 15:34:58 +0000 (10:34 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 1 Mar 2017 15:34:58 +0000 (10:34 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/test_librbd.cc
src/test/rbd_mirror/test_mock_InstanceWatcher.cc
src/tools/rbd/ArgumentTypes.cc
src/tools/rbd/ArgumentTypes.h
src/tools/rbd/Shell.cc

index 41711c95f13f647c63bef7462da4a3c21a29031d..3dcf44290e816c31fba89b2c133e85cd19106496 100644 (file)
@@ -1489,7 +1489,7 @@ void aio_writesame_test_data(rbd_image_t image, const char *test_data, uint64_t
     off += data_len;
     left -= data_len;
   }
-  ASSERT_EQ(0, left);
+  ASSERT_EQ(0U, left);
   free(result);
   printf("verified\n");
 
@@ -1528,7 +1528,7 @@ void writesame_test_data(rbd_image_t image, const char *test_data, uint64_t off,
     off += data_len;
     left -= data_len;
   }
-  ASSERT_EQ(0, left);
+  ASSERT_EQ(0U, left);
   free(result);
   printf("verified\n");
 
@@ -2103,14 +2103,15 @@ void aio_writesame_test_data(librbd::Image& image, const char *test_data, off_t
     off += data_len;
     left -= data_len;
   }
-  ASSERT_EQ(0, left);
+  ASSERT_EQ(0U, left);
   printf("verified\n");
 
   *passed = true;
 }
 
-void writesame_test_data(librbd::Image& image, const char *test_data, off_t off, size_t len,
-                         size_t data_len, uint32_t iohint, bool *passed)
+void writesame_test_data(librbd::Image& image, const char *test_data, off_t off,
+                         ssize_t len, size_t data_len, uint32_t iohint,
+                         bool *passed)
 {
   ssize_t written;
   ceph::bufferlist bl;
@@ -2144,7 +2145,7 @@ void writesame_test_data(librbd::Image& image, const char *test_data, off_t off,
     off += data_len;
     left -= data_len;
   }
-  ASSERT_EQ(0, left);
+  ASSERT_EQ(0U, left);
   printf("verified\n");
 
   *passed = true;
index f2f451a52980eabff883f1540136c987a406f8fa..87aa65f3b3b77805d981d66ef88853d14286c2d8 100644 (file)
@@ -56,7 +56,6 @@ ManagedLock<MockTestImageCtx> *ManagedLock<MockTestImageCtx>::s_instance = nullp
 
 // template definitions
 #include "tools/rbd_mirror/InstanceWatcher.cc"
-template class rbd::mirror::InstanceWatcher<librbd::MockTestImageCtx>;
 
 namespace rbd {
 namespace mirror {
index 0bb92f98453ceed02f35d453dda9001c2cf790fe..9e11bdc77cf7dcdbabbb35d2ee5dffe9985ac394 100644 (file)
@@ -511,5 +511,15 @@ void validate(boost::any& v, const std::vector<std::string>& values,
   v = boost::any(format);
 }
 
+void validate(boost::any& v, const std::vector<std::string>& values,
+              Secret *target_type, int) {
+  std::cerr << "rbd: --secret is deprecated, use --keyfile" << std::endl;
+
+  po::validators::check_first_occurrence(v);
+  const std::string &s = po::validators::get_single_string(values);
+  g_conf->set_val_or_die("keyfile", s.c_str());
+  v = boost::any(s);
+}
+
 } // namespace argument_types
 } // namespace rbd
index c18ceb2ddb4cc55d84766dfdabe9e4afa5741c79..b8e555a0b77031e1f36a6a45969fd5f6456188fa 100644 (file)
@@ -116,8 +116,7 @@ struct JournalObjectSize {};
 
 struct ExportFormat {};
 
-void validate(boost::any& v, const std::vector<std::string>& values,
-              ExportFormat *target_type, int);
+struct Secret {};
 
 void add_export_format_option(boost::program_options::options_description *opt);
 
@@ -197,6 +196,8 @@ void add_no_error_option(boost::program_options::options_description *opt);
 std::string get_short_features_help(bool append_suffix);
 std::string get_long_features_help();
 
+void validate(boost::any& v, const std::vector<std::string>& values,
+              ExportFormat *target_type, int);
 void validate(boost::any& v, const std::vector<std::string>& values,
               ImageSize *target_type, int);
 void validate(boost::any& v, const std::vector<std::string>& values,
@@ -213,6 +214,9 @@ void validate(boost::any& v, const std::vector<std::string>& values,
               Format *target_type, int);
 void validate(boost::any& v, const std::vector<std::string>& values,
               JournalObjectSize *target_type, int);
+void validate(boost::any& v, const std::vector<std::string>& values,
+              Secret *target_type, int);
+
 
 std::ostream &operator<<(std::ostream &os, const ImageFeatures &features);
 
index a08734d3b3926af8041cffa65a4715c371f2b29e..0ad75dab3c33e41c757be0c8177a65be0906c62d 100644 (file)
@@ -23,18 +23,6 @@ static const std::string APP_NAME("rbd");
 static const std::string HELP_SPEC("help");
 static const std::string BASH_COMPLETION_SPEC("bash-completion");
 
-struct Secret {};
-
-void validate(boost::any& v, const std::vector<std::string>& values,
-              Secret *target_type, int) {
-  std::cerr << "rbd: --secret is deprecated, use --keyfile" << std::endl;
-
-  po::validators::check_first_occurrence(v);
-  const std::string &s = po::validators::get_single_string(values);
-  g_conf->set_val_or_die("keyfile", s.c_str());
-  v = boost::any(s);
-}
-
 std::string format_command_spec(const Shell::CommandSpec &spec) {
   return joinify<std::string>(spec.begin(), spec.end(), " ");
 }
@@ -252,7 +240,7 @@ void Shell::get_global_options(po::options_description *opts) {
     ("user", po::value<std::string>(), "client id (without 'client.' prefix)")
     ("name,n", po::value<std::string>(), "client name")
     ("mon_host,m", po::value<std::string>(), "monitor host")
-    ("secret", po::value<Secret>(), "path to secret key (deprecated)")
+    ("secret", po::value<at::Secret>(), "path to secret key (deprecated)")
     ("keyfile,K", po::value<std::string>(), "path to secret key")
     ("keyring,k", po::value<std::string>(), "path to keyring");
 }