diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-03-13 23:59:14 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-03-13 23:59:14 +0100 |
| commit | cefe021ba42c1b7e50c7893f82f830d1aa652344 (patch) | |
| tree | 282f6e9d8e2b3dc240de7ec75028070a127b7285 /src | |
| parent | af9aa6d104f9a9f41f0d06e4407d7bf7b36fecbf (diff) | |
Some C++11 stuff.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/dcpomatic_cli.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc index d1b8f4ef3..59d85d4c4 100644 --- a/src/tools/dcpomatic_cli.cc +++ b/src/tools/dcpomatic_cli.cc @@ -125,7 +125,7 @@ list_servers () { while (true) { int N = 0; - list<EncodeServerDescription> servers = EncodeServerFinder::instance()->servers(); + auto servers = EncodeServerFinder::instance()->servers(); /* This is a bit fiddly because we want to list configured servers that are down as well as all those (configured and found by broadcast) that are up. @@ -146,11 +146,11 @@ list_servers () the number of threads it is offering. */ optional<int> threads; - list<EncodeServerDescription>::iterator j = servers.begin (); + auto j = servers.begin (); while (j != servers.end ()) { if (i == j->host_name() && j->current_link_version()) { threads = j->threads(); - list<EncodeServerDescription>::iterator tmp = j; + auto tmp = j; ++tmp; servers.erase (j); j = tmp; @@ -281,7 +281,7 @@ main (int argc, char* argv[]) } if (servers) { - FILE* f = fopen_boost (*servers, "r"); + auto f = fopen_boost (*servers, "r"); if (!f) { cerr << "Could not open servers list file " << *servers << "\n"; exit (EXIT_FAILURE); @@ -341,12 +341,11 @@ main (int argc, char* argv[]) dcpomatic_log = film->log (); - ContentList content = film->content (); - for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) { - vector<boost::filesystem::path> paths = (*i)->paths (); - for (vector<boost::filesystem::path>::const_iterator j = paths.begin(); j != paths.end(); ++j) { - if (!boost::filesystem::exists (*j)) { - cerr << argv[0] << ": content file " << *j << " not found.\n"; + for (auto i: film->content()) { + auto paths = i->paths(); + for (auto j: paths) { + if (!boost::filesystem::exists(j)) { + cerr << argv[0] << ": content file " << j << " not found.\n"; exit (EXIT_FAILURE); } } |
