Don't redefine a variable.
authorCarl Hetherington <cth@carlh.net>
Thu, 2 Dec 2021 22:54:16 +0000 (23:54 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 3 Dec 2021 20:23:07 +0000 (21:23 +0100)
src/lib/cross_linux.cc
src/lib/cross_windows.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_decoder.cc
src/lib/film.cc
src/lib/kdm_with_metadata.cc
src/lib/player.cc
src/wx/audio_dialog.cc

index ee49d50bc8ef8972da9f13d25b7f90680fc49396..9413ea7f15339792d4b77231bd25d4b79935070e 100644 (file)
@@ -420,7 +420,7 @@ show_in_file_manager (boost::filesystem::path dir, boost::filesystem::path)
                r = system (String::compose("nautilus \"%1\"", dir.string()).c_str());
                return static_cast<bool>(WEXITSTATUS(r));
        } else {
-               int r = system ("which konqueror");
+               r = system ("which konqueror");
                if (WEXITSTATUS(r) == 0) {
                        r = system (String::compose("konqueror \"%1\"", dir.string()).c_str());
                        return static_cast<bool>(WEXITSTATUS(r));
index 49eec3c28ff01b19a18c427f16521eea869a67e8..f369c3462967bd099fcf641372056b42f926226b 100644 (file)
@@ -625,8 +625,8 @@ Drive::get ()
 
                LOG_DISK("Having a look through %1 locked volumes", locked_volumes.size());
                bool locked = false;
-               for (auto const& i: locked_volumes) {
-                       if (i.second == physical_drive) {
+               for (auto const& j: locked_volumes) {
+                       if (j.second == physical_drive) {
                                locked = true;
                        }
                }
index 9017ad605dd9cb021e10e46bfcff307cc34c3f46..bd33d64897d5fd4420cbe772b5211f195997bb3e 100644 (file)
@@ -173,8 +173,8 @@ FFmpegContent::FFmpegContent (vector<shared_ptr<Content>> c)
        auto ref = dynamic_pointer_cast<FFmpegContent> (c[0]);
        DCPOMATIC_ASSERT (ref);
 
-       for (size_t i = 0; i < c.size(); ++i) {
-               auto fc = dynamic_pointer_cast<FFmpegContent>(c[i]);
+       for (size_t j = 0; j < c.size(); ++j) {
+               auto fc = dynamic_pointer_cast<FFmpegContent>(c[j]);
                if (fc->only_text() && fc->only_text()->use() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) {
                        throw JoinError (_("Content to be joined must use the same subtitle stream."));
                }
index ea961a894d5446b5a81731ea86909a14cc918635..4df224ed947457d755232772b8a534d9ed373dfc 100644 (file)
@@ -569,12 +569,12 @@ FFmpegDecoder::decode_and_process_video_packet (AVPacket* packet)
 
        auto images = graph->process (_frame);
 
-       for (auto const& i: images) {
+       for (auto const& j: images) {
 
-               auto image = i.first;
+               auto image = j.first;
 
-               if (i.second != AV_NOPTS_VALUE) {
-                       double const pts = i.second * av_q2d(_format_context->streams[_video_stream.get()]->time_base) + _pts_offset.seconds();
+               if (j.second != AV_NOPTS_VALUE) {
+                       double const pts = j.second * av_q2d(_format_context->streams[_video_stream.get()]->time_base) + _pts_offset.seconds();
 
                        video->emit (
                                film(),
index 5673a661565cc8d851c6955f8fc02d24990143ce..f3a34e2a846c949dcf5cfe16f6682657003598ff 100644 (file)
@@ -730,9 +730,9 @@ Film::read_metadata (optional<boost::filesystem::path> path)
                                /* Invalid region subtag; just ignore it */
                        }
                }
-               if (auto audio_language = isdcf->optional_string_child("AudioLanguage")) {
+               if (auto isdcf_audio_language = isdcf->optional_string_child("AudioLanguage")) {
                        try {
-                               _audio_language = dcp::LanguageTag(*audio_language);
+                               _audio_language = dcp::LanguageTag(*isdcf_audio_language);
                        } catch (...) {
                                /* Invalid language tag; just ignore it */
                        }
@@ -1077,8 +1077,8 @@ Film::isdcf_name (bool if_created_now) const
                }
 
                bool any_text = false;
-               for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
-                       if (dc->reference_text(static_cast<TextType>(i))) {
+               for (int j = 0; j < static_cast<int>(TextType::COUNT); ++j) {
+                       if (dc->reference_text(static_cast<TextType>(j))) {
                                any_text = true;
                        }
                }
@@ -1397,11 +1397,11 @@ Film::maybe_add_content (weak_ptr<Job> j, weak_ptr<Content> c, bool disable_audi
        if (Config::instance()->automatic_audio_analysis() && content->audio && !disable_audio_analysis) {
                auto playlist = make_shared<Playlist>();
                playlist->add (shared_from_this(), content);
-               boost::signals2::connection c;
+               boost::signals2::connection connection;
                JobManager::instance()->analyse_audio (
-                       shared_from_this(), playlist, false, c, bind (&Film::audio_analysis_finished, this)
+                       shared_from_this(), playlist, false, connection, bind (&Film::audio_analysis_finished, this)
                        );
-               _audio_analysis_connections.push_back (c);
+               _audio_analysis_connections.push_back (connection);
        }
 }
 
index 3159b4c7271bceabe706f6d782627a226ccb1a41..5af83d9cf268291f23495a8b0d02c064b2a722af 100644 (file)
@@ -240,33 +240,33 @@ email (
                }
                boost::algorithm::replace_all (body, "$SCREENS", screens.substr (0, screens.length() - 2));
 
-               Emailer email (config->kdm_from(), i.front()->emails(), subject, body);
+               Emailer emailer (config->kdm_from(), i.front()->emails(), subject, body);
 
-               for (auto i: config->kdm_cc()) {
-                       email.add_cc (i);
+               for (auto cc: config->kdm_cc()) {
+                       emailer.add_cc (cc);
                }
                if (!config->kdm_bcc().empty()) {
-                       email.add_bcc (config->kdm_bcc());
+                       emailer.add_bcc (config->kdm_bcc());
                }
 
-               email.add_attachment (zip_file, container_name_format.get(i.front()->name_values(), ".zip"), "application/zip");
+               emailer.add_attachment (zip_file, container_name_format.get(i.front()->name_values(), ".zip"), "application/zip");
 
                try {
-                       email.send (config->mail_server(), config->mail_port(), config->mail_protocol(), config->mail_user(), config->mail_password());
+                       emailer.send (config->mail_server(), config->mail_port(), config->mail_protocol(), config->mail_user(), config->mail_password());
                } catch (...) {
                        boost::filesystem::remove (zip_file);
                        dcpomatic_log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
-                       dcpomatic_log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
+                       dcpomatic_log->log (emailer.email(), LogEntry::TYPE_DEBUG_EMAIL);
                        dcpomatic_log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
-                       dcpomatic_log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
+                       dcpomatic_log->log (emailer.notes(), LogEntry::TYPE_DEBUG_EMAIL);
                        throw;
                }
 
                boost::filesystem::remove (zip_file);
 
                dcpomatic_log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
-               dcpomatic_log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
+               dcpomatic_log->log (emailer.email(), LogEntry::TYPE_DEBUG_EMAIL);
                dcpomatic_log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
-               dcpomatic_log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
+               dcpomatic_log->log (emailer.notes(), LogEntry::TYPE_DEBUG_EMAIL);
        }
 }
index d35292a56d9d362ac79fd8c2d68e5ecb0b8ce4cb..d8c5d4cba5937f0093ee6fda3b0b1ef17ad07f48 100644 (file)
@@ -200,8 +200,8 @@ Player::setup_pieces_unlocked ()
                }
 
                if (_ignore_text) {
-                       for (auto i: decoder->text) {
-                               i->set_ignore (true);
+                       for (auto text: decoder->text) {
+                               text->set_ignore (true);
                        }
                }
 
index 9e0d7a30fc197662d40357f313fea93f7f926082..d1071c3031a24b2a09c02df04ff22be46a7080ae 100644 (file)
@@ -260,10 +260,10 @@ AudioDialog::try_to_load_analysis ()
                        mapped = film->mapped_audio_channels ();
                }
 
-               for (auto i: mapped) {
-                       if (_channel_checkbox[i]) {
-                               _channel_checkbox[i]->SetValue (true);
-                               _plot->set_channel_visible (i, true);
+               for (auto channel: mapped) {
+                       if (_channel_checkbox[channel]) {
+                               _channel_checkbox[channel]->SetValue (true);
+                               _plot->set_channel_visible (channel, true);
                        }
                }
        }
@@ -274,9 +274,9 @@ AudioDialog::try_to_load_analysis ()
        }
 
        if (i == AudioPoint::COUNT) {
-               for (int i = 0; i < AudioPoint::COUNT; ++i) {
-                       _type_checkbox[i]->SetValue (true);
-                       _plot->set_type_visible (i, true);
+               for (int j = 0; j < AudioPoint::COUNT; ++j) {
+                       _type_checkbox[j]->SetValue (true);
+                       _plot->set_type_visible (j, true);
                }
        }
 
@@ -403,12 +403,12 @@ AudioDialog::setup_statistics ()
        }
 
        if (_analysis->overall_true_peak()) {
-               float const peak = _analysis->overall_true_peak().get();
-               float const peak_dB = linear_to_db(peak) + _analysis->gain_correction(_playlist);
+               float const true_peak = _analysis->overall_true_peak().get();
+               float const true_peak_dB = linear_to_db(true_peak) + _analysis->gain_correction(_playlist);
 
-               _true_peak->SetLabel (wxString::Format (_("True peak is %.2fdB"), peak_dB));
+               _true_peak->SetLabel (wxString::Format (_("True peak is %.2fdB"), true_peak_dB));
 
-               if (peak_dB > -3) {
+               if (true_peak_dB > -3) {
                        _true_peak->SetForegroundColour (wxColour (255, 0, 0));
                } else {
                        _true_peak->SetForegroundColour (wxColour (0, 0, 0));