Use some const&
authorCarl Hetherington <cth@carlh.net>
Thu, 2 Dec 2021 19:37:20 +0000 (20:37 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 3 Dec 2021 20:19:28 +0000 (21:19 +0100)
src/lib/audio_analysis.h
src/lib/audio_content.cc
src/lib/audio_content.h
src/lib/content_text.h
src/lib/util.cc
src/lib/util.h

index 038059502b225f44de78208bd32913cfd722b631..29c32fa1c91ec803f44e2ef839f4024f2fe583fc 100644 (file)
@@ -57,11 +57,11 @@ public:
                dcpomatic::DCPTime time;
        };
 
-       void set_sample_peak (std::vector<PeakTime> peak) {
+       void set_sample_peak (std::vector<PeakTime> const& peak) {
                _sample_peak = peak;
        }
 
-       void set_true_peak (std::vector<float> peak) {
+       void set_true_peak (std::vector<float> const& peak) {
                _true_peak = peak;
        }
 
index f2510b494ea3c75149603013a140b68bcf77f620..7f62fdf9805d5c7a5b6672360b1d3235553f66cd 100644 (file)
@@ -156,7 +156,7 @@ AudioContent::technical_summary () const
 
 
 void
-AudioContent::set_mapping (AudioMapping mapping)
+AudioContent::set_mapping (AudioMapping const& mapping)
 {
        ContentChangeSignaller cc (_parent, AudioContentProperty::STREAMS);
 
@@ -343,7 +343,7 @@ AudioContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p
 
 
 void
-AudioContent::set_streams (vector<AudioStreamPtr> streams)
+AudioContent::set_streams (vector<AudioStreamPtr> const& streams)
 {
        ContentChangeSignaller cc (_parent, AudioContentProperty::STREAMS);
 
index 963f759e82fd68e260ab5a7f7f4d16566573cf82..41588fd68cf6e6f3a6e7dde58e036cab98a9c714 100644 (file)
@@ -57,7 +57,7 @@ public:
        void take_settings_from (std::shared_ptr<const AudioContent> c);
 
        AudioMapping mapping () const;
-       void set_mapping (AudioMapping);
+       void set_mapping (AudioMapping const&);
        int resampled_frame_rate (std::shared_ptr<const Film> film) const;
        std::vector<NamedChannel> channel_names () const;
 
@@ -86,7 +86,7 @@ public:
 
        void add_stream (AudioStreamPtr stream);
        void set_stream (AudioStreamPtr stream);
-       void set_streams (std::vector<AudioStreamPtr> streams);
+       void set_streams (std::vector<AudioStreamPtr> const& streams);
        AudioStreamPtr stream () const;
 
        void add_properties (std::shared_ptr<const Film> film, std::list<UserProperty> &) const;
index 5edb9af2083be0993339caefa876dc09e3627e7d..bc5a6ed991f1cfc70bbad3799450a7b5b3d4a356 100644 (file)
@@ -64,7 +64,7 @@ public:
 class ContentStringText : public ContentText
 {
 public:
-       ContentStringText (dcpomatic::ContentTime f, std::list<dcp::SubtitleString> s)
+       ContentStringText (dcpomatic::ContentTime f, std::list<dcp::SubtitleString> const& s)
                : ContentText (f)
                , subs (s)
        {}
index c165a5129bae42bfe646b772d56d246a7102935f..64450f987f70a7a7cc0bdd3eab7c3ace563a6912 100644 (file)
@@ -846,7 +846,7 @@ audio_channel_types (list<int> mapped, int channels)
 }
 
 shared_ptr<AudioBuffers>
-remap (shared_ptr<const AudioBuffers> input, int output_channels, AudioMapping map)
+remap (shared_ptr<const AudioBuffers> input, int output_channels, AudioMapping const& map)
 {
        auto mapped = make_shared<AudioBuffers>(output_channels, input->frames());
        mapped->make_silent ();
index 112451f7bfd7853c7aaf0087e598f11b9a1a00e6..9620c839a7f78aa44183a9dbd7d0231326e80404 100644 (file)
@@ -115,7 +115,7 @@ extern std::string atmos_asset_filename (std::shared_ptr<dcp::AtmosAsset> asset,
 extern float relaxed_string_to_float (std::string);
 extern std::string careful_string_filter (std::string);
 extern std::pair<int, int> audio_channel_types (std::list<int> mapped, int channels);
-extern std::shared_ptr<AudioBuffers> remap (std::shared_ptr<const AudioBuffers> input, int output_channels, AudioMapping map);
+extern std::shared_ptr<AudioBuffers> remap (std::shared_ptr<const AudioBuffers> input, int output_channels, AudioMapping const& map);
 extern Eyes increment_eyes (Eyes e);
 extern void checked_fread (void* ptr, size_t size, FILE* stream, boost::filesystem::path path);
 extern void checked_fwrite (void const * ptr, size_t size, FILE* stream, boost::filesystem::path path);