From 11c94137d9432698954c0e7b53208ddeb929efcf Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 11 Oct 2022 22:38:14 +0200 Subject: Cleanup: use some lambdas. --- tools/dcpverify.cc | 35 +++++++++++++++-------------------- 1 file 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 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 path) { + if (quiet) { + return; + } + + if (path) { + cout << s << ": " << path->string() << "\n"; + } else { + cout << s << "\n"; + } + }; + + auto progress = [](float) {}; + vector 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; -- cgit v1.2.3