summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-10-11 22:38:14 +0200
committerCarl Hetherington <cth@carlh.net>2022-10-11 22:38:14 +0200
commit11c94137d9432698954c0e7b53208ddeb929efcf (patch)
treecdc47d3e1a9f4cc81c22d55d1a449db8b2dcdbad
parent3005571cd08c3bdd233fd073b6ae956b9d98b570 (diff)
Cleanup: use some lambdas.
-rw-r--r--tools/dcpverify.cc35
1 files changed, 15 insertions, 20 deletions
diff --git a/tools/dcpverify.cc b/tools/dcpverify.cc
index f29393ed..4d670b8e 100644
--- a/tools/dcpverify.cc
+++ b/tools/dcpverify.cc
@@ -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;