Cleanup: use some lambdas.
authorCarl Hetherington <cth@carlh.net>
Tue, 11 Oct 2022 20:38:14 +0000 (22:38 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 11 Oct 2022 20:38:14 +0000 (22:38 +0200)
tools/dcpverify.cc

index f29393ed2baac88cfa45980cefabbb19dcb43e81..4d670b8e3544d94c6dbc7284aaa75ff5ad246019 100644 (file)
@@ -60,25 +60,6 @@ help (string n)
             << "  -q, --quiet             don't report progress\n";
 }
 
-void
-stage (bool quiet, string s, optional<boost::filesystem::path> path)
-{
-       if (quiet) {
-               return;
-       }
-
-       if (path) {
-               cout << s << ": " << path->string() << "\n";
-       } else {
-               cout << s << "\n";
-       }
-}
-
-void
-progress ()
-{
-
-}
 
 int
 main (int argc, char* argv[])
@@ -135,9 +116,23 @@ main (int argc, char* argv[])
                exit (EXIT_FAILURE);
        }
 
+       auto stage = [quiet](string s, optional<boost::filesystem::path> path) {
+               if (quiet) {
+                       return;
+               }
+
+               if (path) {
+                       cout << s << ": " << path->string() << "\n";
+               } else {
+                       cout << s << "\n";
+               }
+       };
+
+       auto progress = [](float) {};
+
        vector<boost::filesystem::path> directories;
        directories.push_back (argv[optind]);
-       auto notes = dcp::verify (directories, bind(&stage, quiet, _1, _2), bind(&progress));
+       auto notes = dcp::verify(directories, stage, progress);
        dcp::filter_notes (notes, ignore_missing_assets);
 
        bool failed = false;