Merge branch 'warnings' into v2.15.x.
authorCarl Hetherington <cth@carlh.net>
Mon, 27 Jul 2020 19:47:26 +0000 (21:47 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 27 Jul 2020 19:47:26 +0000 (21:47 +0200)
Clean up our handling of compiler warnings in a variety of ways,
and use #pragma rather than -Wno to only disable warnings where
necessary.

139 files changed:
cscript
src/lib/analyse_audio_job.h
src/lib/analytics.cc
src/lib/atmos_content.cc
src/lib/audio_analysis.cc
src/lib/audio_mapping.cc
src/lib/audio_point.cc
src/lib/cinema_sound_processor.cc
src/lib/colour_conversion.cc
src/lib/cross.h
src/lib/cross_common.cc
src/lib/cross_linux.cc
src/lib/cross_osx.cc
src/lib/dcp_text_track.h
src/lib/dcp_video.cc
src/lib/dkdm_wrapper.cc
src/lib/edid.cc
src/lib/encode_server.cc
src/lib/exceptions.h
src/lib/ffmpeg.cc
src/lib/ffmpeg.h
src/lib/ffmpeg_audio_stream.cc
src/lib/ffmpeg_decoder.cc
src/lib/ffmpeg_examiner.cc
src/lib/ffmpeg_file_encoder.cc
src/lib/ffmpeg_image_proxy.cc
src/lib/ffmpeg_stream.cc
src/lib/ffmpeg_subtitle_stream.cc
src/lib/font.cc
src/lib/isdcf_metadata.cc
src/lib/j2k_encoder.cc
src/lib/j2k_image_proxy.cc
src/lib/json_server.cc
src/lib/kdm_recipient.h
src/lib/raw_image_proxy.cc
src/lib/render_text.cc
src/lib/rgba.cc
src/lib/scp_uploader.cc
src/lib/spl.cc
src/lib/spl_entry.cc
src/lib/subtitle_analysis.cc
src/lib/types.cc
src/lib/util.cc
src/lib/video_filter_graph.cc
src/lib/warnings.h [new file with mode: 0644]
src/lib/wscript
src/tools/dcpomatic.cc
src/tools/dcpomatic_disk.cc
src/tools/dcpomatic_disk_writer.cc
src/tools/dcpomatic_kdm.cc
src/tools/dcpomatic_player.cc
src/tools/dcpomatic_playlist.cc
src/tools/dcpomatic_server.cc
src/wx/about_dialog.cc
src/wx/about_dialog.h
src/wx/audio_dialog.h
src/wx/audio_mapping_view.cc
src/wx/audio_mapping_view.h
src/wx/audio_plot.h
src/wx/closed_captions_dialog.h
src/wx/config_dialog.h
src/wx/content_advanced_dialog.h
src/wx/content_sub_panel.h
src/wx/content_view.h
src/wx/controls.h
src/wx/custom_scale_dialog.cc
src/wx/custom_scale_dialog.h
src/wx/dir_picker_ctrl.cc
src/wx/dir_picker_ctrl.h
src/wx/disk_warning_dialog.h
src/wx/dkdm_output_panel.cc
src/wx/download_certificate_dialog.h
src/wx/download_certificate_panel.h
src/wx/drive_wipe_warning_dialog.h
src/wx/export_dialog.cc
src/wx/file_picker_ctrl.cc
src/wx/file_picker_ctrl.h
src/wx/film_editor.h
src/wx/film_name_location_dialog.h
src/wx/film_viewer.h
src/wx/filter_dialog.h
src/wx/focus_manager.cc
src/wx/fonts_dialog.h
src/wx/gl_video_view.cc
src/wx/gl_video_view.h
src/wx/hints_dialog.cc
src/wx/hints_dialog.h
src/wx/html_dialog.cc
src/wx/html_dialog.h
src/wx/i18n_hook.h
src/wx/initial_setup_dialog.h
src/wx/instant_i18n_dialog.h
src/wx/job_manager_view.h
src/wx/kdm_cpl_panel.h
src/wx/kdm_output_panel.cc
src/wx/kdm_timing_panel.cc
src/wx/kdm_timing_panel.h
src/wx/markers_dialog.h
src/wx/message_dialog.h
src/wx/nag_dialog.h
src/wx/name_format_editor.h
src/wx/password_entry.h
src/wx/player_information.h
src/wx/player_stress_tester.h
src/wx/question_dialog.h
src/wx/recipient_dialog.cc
src/wx/recipients_panel.h
src/wx/repeat_dialog.h
src/wx/report_problem_dialog.h
src/wx/rgba_colour_picker.cc
src/wx/rgba_colour_picker.h
src/wx/screen_dialog.cc
src/wx/screens_panel.h
src/wx/self_dkdm_dialog.cc
src/wx/self_dkdm_dialog.h
src/wx/servers_list_dialog.h
src/wx/simple_video_view.h
src/wx/subtitle_appearance_dialog.cc
src/wx/subtitle_appearance_dialog.h
src/wx/system_font_dialog.h
src/wx/table_dialog.h
src/wx/templates_dialog.h
src/wx/text_view.h
src/wx/time_picker.h
src/wx/timeline_content_view.h
src/wx/try_unmount_dialog.h
src/wx/update_dialog.cc
src/wx/update_dialog.h
src/wx/verify_dcp_dialog.cc
src/wx/verify_dcp_dialog.h
src/wx/video_waveform_dialog.h
src/wx/video_waveform_plot.h
src/wx/wx_signal_manager.cc
src/wx/wx_util.cc
src/wx/wx_util.h
test/ffmpeg_encoder_test.cc
test/stream_test.cc
test/test.h
wscript

diff --git a/cscript b/cscript
index 052aa6c7c645b654109daf6b1138a45933630ecd..7f262bf81f8a8ed88f1964ef9468bea37a72d879 100644 (file)
--- a/cscript
+++ b/cscript
@@ -392,7 +392,7 @@ def dependencies(target, options):
 option_defaults = { "gui": True, "variant": None }
 
 def configure_options(target, options):
-    opt = ''
+    opt = ' --warnings-are-errors'
 
     if not (target.platform == 'linux' and target.distro == 'ubuntu' and target.version == '18.04'):
         # Currently we only build tests on Ubuntu 18.04
index f7cc3e2567ffa39dd82205f3a48d664c119efd24..8f88b0fa143d42c88d68f678c809a5c906fe1f9a 100644 (file)
@@ -66,8 +66,8 @@ private:
        dcpomatic::DCPTime _start;
        bool _from_zero;
 
-       int64_t _done;
-       int64_t _samples_per_point;
+       Frame _done;
+       Frame _samples_per_point;
        AudioPoint* _current;
 
        float* _sample_peak;
index 34f67116e3a7355ea42dc6ee5cf1c0ad6ae1491b..f20b213e4ab13f511d73f351df99ef7b4533bc92 100644 (file)
 #include "analytics.h"
 #include "exceptions.h"
 #include "compose.hpp"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
 
index 2e59b92b7f288d1653189efd9399a2d7803730b1..0543437a30ca06e7a44ea6a3fbf0249fec2d96ab 100644 (file)
 
 
 #include "atmos_content.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 
 using std::string;
index 446fcccef1607323d7851dbffe98114cda5fb841..f69bcd362db164e23c31e01d73bdf3399f01b9e9 100644 (file)
 #include "util.h"
 #include "playlist.h"
 #include "audio_content.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
 #include <boost/foreach.hpp>
 #include <stdint.h>
index 05dfb7e897de8bb1c23cdfdb01c9390519cd3d52..94efbe49bff57a416e87dcc284d6d3a11d6df7e7 100644 (file)
 */
 
 #include "audio_mapping.h"
-#include "util.h"
-#include "digester.h"
 #include "audio_processor.h"
+#include "digester.h"
+#include "util.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/regex.hpp>
 #include <iostream>
 
index b5ea2c31e6b0a81616536b05a2dd8bfe3911255b..722673b961337a5057a42beb8bc5164fd0f5058d 100644 (file)
 */
 
 #include "audio_point.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 using std::string;
 using dcp::raw_convert;
index 1a3ba5a0f0af61fcd9b9d412a4b6111e4ffc82ca..bd60f7d710e2acef17813225baa62fe8a09e7d4d 100644 (file)
@@ -107,7 +107,7 @@ CinemaSoundProcessor::as_index (CinemaSoundProcessor const * s)
 CinemaSoundProcessor const *
 CinemaSoundProcessor::from_index (int i)
 {
-       DCPOMATIC_ASSERT (i <= int(_cinema_sound_processors.size ()));
+       DCPOMATIC_ASSERT (i >= 0 && i < int(_cinema_sound_processors.size()));
        return _cinema_sound_processors[i];
 }
 
index 2e052060e2b247ad9f26dbd51c54399b952f9c91..22404c2796d165fe0716ea461ac36ad3a0e187fd 100644 (file)
@@ -22,6 +22,7 @@
 #include "colour_conversion.h"
 #include "util.h"
 #include "digester.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <dcp/chromaticity.h>
 #include <dcp/gamma_transfer_function.h>
@@ -29,7 +30,9 @@
 #include <dcp/identity_transfer_function.h>
 #include <dcp/s_gamut3_transfer_function.h>
 #include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 #include <iostream>
 
index 4d3d2b2c79f21ca7891d0383a3912a68bea1cc44..64cb2e6b83f5bb8952fb1d2c4c10d629e7515385 100644 (file)
 class Log;
 struct AVIOContext;
 
-void dcpomatic_sleep_seconds (int);
-void dcpomatic_sleep_milliseconds (int);
+extern void dcpomatic_sleep_seconds (int);
+extern void dcpomatic_sleep_milliseconds (int);
 extern std::string cpu_info ();
 extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path);
 extern std::list<std::pair<std::string, std::string> > mount_info ();
 extern boost::filesystem::path openssl_path ();
+extern void make_foreground_application ();
 #ifdef DCPOMATIC_DISK
 extern boost::filesystem::path disk_writer_path ();
 #endif
index cf220fe53f4b9377dc5d4fe391d8d6ab483efd8b..edc806b584fed235a947e53a46751725bac7424c 100644 (file)
 #include "cross.h"
 #include "compose.hpp"
 #include "dcpomatic_log.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <boost/foreach.hpp>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
 #include "i18n.h"
index 25fd3490e2bf40374995a5169edebd054afc3607..e17f188b9f8aacece46cfa29eb7cd884ab3d9797 100644 (file)
@@ -113,7 +113,10 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
 {
        string ffprobe = "ffprobe \"" + content.string() + "\" 2> \"" + out.string() + "\"";
        LOG_GENERAL (N_("Probing with %1"), ffprobe);
-        system (ffprobe.c_str ());
+       int const r = system (ffprobe.c_str());
+       if (r == -1 || (WIFEXITED(r) && WEXITSTATUS(r) != 0)) {
+               LOG_GENERAL (N_("Could not run ffprobe (system returned %1"), r);
+       }
 }
 
 list<pair<string, string> >
@@ -376,9 +379,10 @@ unprivileged ()
        uid_t ruid, euid, suid;
        if (getresuid(&ruid, &euid, &suid) == -1) {
                cerr << "getresuid() failed.\n";
-               exit (EXIT_FAILURE);
        }
-       seteuid (ruid);
+       if (seteuid(ruid) == -1) {
+               cerr << "seteuid() failed.\n";
+       }
 }
 
 PrivilegeEscalator::~PrivilegeEscalator ()
@@ -388,7 +392,10 @@ PrivilegeEscalator::~PrivilegeEscalator ()
 
 PrivilegeEscalator::PrivilegeEscalator ()
 {
-       seteuid (0);
+       int const r = seteuid(0);
+       if (r < 0) {
+               throw PrivilegeError (String::compose("seteuid() call failed with %1", errno));
+       }
 }
 
 boost::filesystem::path
index 574cc8660887b059185dc5d120fa18fb6d114af7..e91d3df16c4a6e982bcd871aee39d3b2de77ed1e 100644 (file)
@@ -24,6 +24,7 @@
 #include "dcpomatic_log.h"
 #include "config.h"
 #include "exceptions.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <glib.h>
 extern "C" {
@@ -35,6 +36,7 @@ extern "C" {
 #if BOOST_VERSION >= 106100
 #include <boost/dll/runtime_symbol_info.hpp>
 #endif
+#include <ApplicationServices/ApplicationServices.h>
 #include <sys/sysctl.h>
 #include <mach-o/dyld.h>
 #include <IOKit/pwr_mgt/IOPMLib.h>
@@ -180,10 +182,7 @@ Waker::nudge ()
 Waker::Waker ()
 {
        boost::mutex::scoped_lock lm (_mutex);
-       /* We should use this */
-        // IOPMAssertionCreateWithName (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR ("Encoding DCP"), &_assertion_id);
-       /* but it's not available on 10.5, so we use this */
-        IOPMAssertionCreate (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, &_assertion_id);
+       IOPMAssertionCreateWithName (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR ("Encoding DCP"), &_assertion_id);
 }
 
 Waker::~Waker ()
@@ -246,7 +245,7 @@ home_directory ()
 }
 
 string
-command_and_read (string cmd)
+command_and_read (string)
 {
        return "";
 }
@@ -516,7 +515,7 @@ config_path ()
 }
 
 
-void done_callback(DADiskRef disk, DADissenterRef dissenter, void* context)
+void done_callback(DADiskRef, DADissenterRef dissenter, void* context)
 {
        LOG_DISK_NC("Unmount finished");
        bool* success = reinterpret_cast<bool*> (context);
@@ -566,3 +565,14 @@ disk_write_finished ()
 
 }
 
+
+void
+make_foreground_application ()
+{
+       ProcessSerialNumber serial;
+DCPOMATIC_DISABLE_WARNINGS
+       GetCurrentProcess (&serial);
+DCPOMATIC_ENABLE_WARNINGS
+       TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+}
+
index 913e77fa59cdb08f0500ebdf862a6dc2df8a4a88..e6a146b3b1b1f8f919f7a0e7aa5d69e0565e654c 100644 (file)
 #ifndef DCPOMATIC_DCP_TEXT_TRACK_H
 #define DCPOMATIC_DCP_TEXT_TRACK_H
 
+#include "warnings.h"
 #include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class DCPTextTrack
 {
index 7b06f8cfca3cd6975b3a63c63d00598b4004fb12..d6b9d4f278fb20a9437cbaecbce9e860dd6f26be 100644 (file)
 #include "cross.h"
 #include "player_video.h"
 #include "compose.hpp"
+#include "warnings.h"
 #include <libcxml/cxml.h>
 #include <dcp/raw_convert.h>
 #include <dcp/openjpeg_image.h>
 #include <dcp/rgb_xyz.h>
 #include <dcp/j2k.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/asio.hpp>
 #include <boost/thread.hpp>
 #include <stdint.h>
index 0dd37b464c6db6453a1bfc2d56459b48321dca9a..6638bc315bb3936c9e4933abbf3065580c93ecb2 100644 (file)
 #include "compose.hpp"
 #include "dkdm_wrapper.h"
 #include "dcpomatic_assert.h"
+#include "warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 
 using std::string;
index 3df65d325ca6ce1ec7767c5f1162c07fdbfea2f5..a530b8e3825f8c10523bf8209b2d9253a23a81d9 100644 (file)
 
 #include "compose.hpp"
 #include "edid.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
index c242cb216acac2a45d4a98f3d63d823fc53a2329..c30fc8f30323ae52682682e2332c9fcb0e09300a 100644 (file)
 #include "dcpomatic_log.h"
 #include "encoded_log_entry.h"
 #include "version.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/algorithm/string.hpp>
 #include <boost/scoped_array.hpp>
 #include <boost/foreach.hpp>
@@ -236,9 +239,11 @@ EncodeServer::run ()
        }
 
        for (int i = 0; i < _num_threads; ++i) {
-               boost::thread* t = _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
 #ifdef DCPOMATIC_LINUX
+               boost::thread* t = _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
                pthread_setname_np (t->native_handle(), "encode-server-worker");
+#else
+               _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
 #endif
        }
 
index 98534bb32d410db108c2d8bd8f00fe220822074f..05cda9659f2c63a5b104d6fccbe896e0294e4457 100644 (file)
@@ -369,4 +369,14 @@ private:
        std::string _message;
        int _number;
 };
+
+
+class PrivilegeError : public std::runtime_error
+{
+public:
+       explicit PrivilegeError (std::string s)
+                       : std::runtime_error (s)
+               {}
+};
+
 #endif
index 8eb19816c0828b44b1dfc82bc030f19d37378ea5..0802fa159822f43f7895e2a03bc40b3afe6b06e5 100644 (file)
@@ -70,9 +70,11 @@ FFmpeg::~FFmpeg ()
 {
        boost::mutex::scoped_lock lm (_mutex);
 
+DCPOMATIC_DISABLE_WARNINGS
        for (uint32_t i = 0; i < _format_context->nb_streams; ++i) {
                avcodec_close (_format_context->streams[i]->codec);
        }
+DCPOMATIC_ENABLE_WARNINGS
 
        av_frame_free (&_frame);
        avformat_close_input (&_format_context);
@@ -146,6 +148,7 @@ FFmpeg::setup_general ()
 
        optional<int> video_stream_undefined_frame_rate;
 
+DCPOMATIC_DISABLE_WARNINGS
        for (uint32_t i = 0; i < _format_context->nb_streams; ++i) {
                AVStream* s = _format_context->streams[i];
                if (s->codec->codec_type == AVMEDIA_TYPE_VIDEO && avcodec_find_decoder(s->codec->codec_id)) {
@@ -158,6 +161,7 @@ FFmpeg::setup_general ()
                        }
                }
        }
+DCPOMATIC_ENABLE_WARNINGS
 
        /* Files from iTunes sometimes have two video streams, one with the avg_frame_rate.num and .den set
           to zero.  Only use such a stream if there is no alternative.
@@ -204,6 +208,7 @@ FFmpeg::setup_decoders ()
 {
        boost::mutex::scoped_lock lm (_mutex);
 
+DCPOMATIC_DISABLE_WARNINGS
        for (uint32_t i = 0; i < _format_context->nb_streams; ++i) {
                AVCodecContext* context = _format_context->streams[i]->codec;
 
@@ -230,8 +235,10 @@ FFmpeg::setup_decoders ()
                        dcpomatic_log->log (String::compose ("No codec found for stream %1", i), LogEntry::TYPE_WARNING);
                }
        }
+DCPOMATIC_ENABLE_WARNINGS
 }
 
+DCPOMATIC_DISABLE_WARNINGS
 AVCodecContext *
 FFmpeg::video_codec_context () const
 {
@@ -251,6 +258,7 @@ FFmpeg::subtitle_codec_context () const
 
        return _ffmpeg_content->subtitle_stream()->stream(_format_context)->codec;
 }
+DCPOMATIC_ENABLE_WARNINGS
 
 int
 FFmpeg::avio_read (uint8_t* buffer, int const amount)
index 10517055c26cf842619699a901bc561ff00a8fde..e6399c076655742f4438bb87676dad87f8e06781 100644 (file)
 
 #include "file_group.h"
 #include "ffmpeg_subtitle_period.h"
+#include "warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 extern "C" {
 #include <libavcodec/avcodec.h>
 }
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/thread/mutex.hpp>
 
index 1fc008d51a22cc5a621ea499fdf6d48d7f3528bb..32828f13a84878e3dda72ae54a997fa983ae11e1 100644 (file)
 
 #include "ffmpeg_audio_stream.h"
 #include <dcp/raw_convert.h>
+#include "warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <libcxml/cxml.h>
 
 using std::string;
index cfaf0361b9ab79da14f4f4ae841a5bd8a243cf9d..04c97ed3ba4d6b98cb87b706ec7ae47dea44ca6d 100644 (file)
@@ -206,9 +206,11 @@ FFmpegDecoder::deinterleave_audio (shared_ptr<FFmpegAudioStream> stream) const
 {
        DCPOMATIC_ASSERT (bytes_per_audio_sample (stream));
 
+DCPOMATIC_DISABLE_WARNINGS
        int const size = av_samples_get_buffer_size (
                0, stream->stream(_format_context)->codec->channels, _frame->nb_samples, audio_sample_format (stream), 1
                );
+DCPOMATIC_ENABLE_WARNINGS
 
        /* XXX: can't we just use _frame->nb_samples directly here? */
        /* XXX: can't we use swr_convert() to do the format conversion? */
@@ -339,7 +341,9 @@ FFmpegDecoder::deinterleave_audio (shared_ptr<FFmpegAudioStream> stream) const
 AVSampleFormat
 FFmpegDecoder::audio_sample_format (shared_ptr<FFmpegAudioStream> stream) const
 {
+DCPOMATIC_DISABLE_WARNINGS
        return stream->stream (_format_context)->codec->sample_fmt;
+DCPOMATIC_ENABLE_WARNINGS
 }
 
 int
@@ -401,9 +405,11 @@ FFmpegDecoder::seek (ContentTime time, bool accurate)
                avcodec_flush_buffers (video_codec_context());
        }
 
+DCPOMATIC_DISABLE_WARNINGS
        BOOST_FOREACH (shared_ptr<FFmpegAudioStream> i, ffmpeg_content()->ffmpeg_audio_streams()) {
                avcodec_flush_buffers (i->stream(_format_context)->codec);
        }
+DCPOMATIC_ENABLE_WARNINGS
 
        if (subtitle_codec_context ()) {
                avcodec_flush_buffers (subtitle_codec_context ());
@@ -434,6 +440,7 @@ FFmpegDecoder::decode_audio_packet ()
                return;
        }
 
+DCPOMATIC_DISABLE_WARNINGS
        while (copy_packet.size > 0) {
 
                int frame_finished;
@@ -493,6 +500,7 @@ FFmpegDecoder::decode_audio_packet ()
                                        to_string(_pts_offset)
                                        );
                        }
+DCPOMATIC_ENABLE_WARNINGS
 
                        /* Give this data provided there is some, and its time is sane */
                        if (ct >= ContentTime() && data->frames() > 0) {
@@ -511,9 +519,11 @@ FFmpegDecoder::decode_video_packet ()
        DCPOMATIC_ASSERT (_video_stream);
 
        int frame_finished;
+DCPOMATIC_DISABLE_WARNINGS
        if (avcodec_decode_video2 (video_codec_context(), _frame, &frame_finished, &_packet) < 0 || !frame_finished) {
                return false;
        }
+DCPOMATIC_ENABLE_WARNINGS
 
        boost::mutex::scoped_lock lm (_filter_graphs_mutex);
 
index 3fb9a53e4618f49e6f4aedb82780e9f10de541b3..cc6a62ff68e180af2118e0e0a23c30e0a6392e52 100644 (file)
 
 */
 
+#include "ffmpeg_examiner.h"
+#include "ffmpeg_content.h"
+#include "job.h"
+#include "ffmpeg_audio_stream.h"
+#include "ffmpeg_subtitle_stream.h"
+#include "util.h"
+#include "warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 extern "C" {
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
@@ -26,12 +34,7 @@ extern "C" {
 #include <libavutil/eval.h>
 #include <libavutil/display.h>
 }
-#include "ffmpeg_examiner.h"
-#include "ffmpeg_content.h"
-#include "job.h"
-#include "ffmpeg_audio_stream.h"
-#include "ffmpeg_subtitle_stream.h"
-#include "util.h"
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 #include <iostream>
 
@@ -44,6 +47,7 @@ using boost::shared_ptr;
 using boost::optional;
 using namespace dcpomatic;
 
+
 /** @param job job that the examiner is operating in, or 0 */
 FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Job> job)
        : FFmpeg (c)
@@ -54,6 +58,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo
 
        for (uint32_t i = 0; i < _format_context->nb_streams; ++i) {
                AVStream* s = _format_context->streams[i];
+DCPOMATIC_DISABLE_WARNINGS
                if (s->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
 
                        /* This is a hack; sometimes it seems that _audio_codec_context->channel_layout isn't set up,
@@ -119,6 +124,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo
                }
 
                AVCodecContext* context = _format_context->streams[_packet.stream_index]->codec;
+DCPOMATIC_ENABLE_WARNINGS
 
                if (_video_stream && _packet.stream_index == _video_stream.get()) {
                        video_packet (context);
@@ -175,6 +181,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo
 #endif
 }
 
+
 void
 FFmpegExaminer::video_packet (AVCodecContext* context)
 {
@@ -185,7 +192,9 @@ FFmpegExaminer::video_packet (AVCodecContext* context)
        }
 
        int frame_finished;
+DCPOMATIC_DISABLE_WARNINGS
        if (avcodec_decode_video2 (context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) {
+DCPOMATIC_ENABLE_WARNINGS
                if (!_first_video) {
                        _first_video = frame_time (_format_context->streams[_video_stream.get()]);
                }
@@ -197,6 +206,7 @@ FFmpegExaminer::video_packet (AVCodecContext* context)
        }
 }
 
+
 void
 FFmpegExaminer::audio_packet (AVCodecContext* context, shared_ptr<FFmpegAudioStream> stream)
 {
@@ -205,17 +215,22 @@ FFmpegExaminer::audio_packet (AVCodecContext* context, shared_ptr<FFmpegAudioStr
        }
 
        int frame_finished;
+DCPOMATIC_DISABLE_WARNINGS
        if (avcodec_decode_audio4 (context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) {
+DCPOMATIC_ENABLE_WARNINGS
                stream->first_audio = frame_time (stream->stream (_format_context));
        }
 }
 
+
 optional<ContentTime>
 FFmpegExaminer::frame_time (AVStream* s) const
 {
        optional<ContentTime> t;
 
+DCPOMATIC_DISABLE_WARNINGS
        int64_t const bet = av_frame_get_best_effort_timestamp (_frame);
+DCPOMATIC_ENABLE_WARNINGS
        if (bet != AV_NOPTS_VALUE) {
                t = ContentTime::from_seconds (bet * av_q2d (s->time_base));
        }
@@ -223,6 +238,7 @@ FFmpegExaminer::frame_time (AVStream* s) const
        return t;
 }
 
+
 optional<double>
 FFmpegExaminer::video_frame_rate () const
 {
index 44ef3f0726d6be3d5b71e0046b1389e8f4e7641d..f8bd14e760280392dead846d66178e997465b5a9 100644 (file)
@@ -113,11 +113,13 @@ FFmpegFileEncoder::FFmpegFileEncoder (
                throw runtime_error ("could not create FFmpeg output audio stream");
        }
 
+DCPOMATIC_DISABLE_WARNINGS
        _video_stream->id = _video_stream_index;
        _video_stream->codec = _video_codec_context;
 
        _audio_stream->id = _audio_stream_index;
        _audio_stream->codec = _audio_codec_context;
+DCPOMATIC_ENABLE_WARNINGS
 
        if (avcodec_open2 (_video_codec_context, _video_codec, &_video_options) < 0) {
                throw runtime_error ("could not open FFmpeg video codec");
@@ -239,7 +241,9 @@ FFmpegFileEncoder::flush ()
                packet.size = 0;
 
                int got_packet;
+DCPOMATIC_DISABLE_WARNINGS
                avcodec_encode_video2 (_video_codec_context, &packet, 0, &got_packet);
+DCPOMATIC_ENABLE_WARNINGS
                if (got_packet) {
                        packet.stream_index = 0;
                        av_interleaved_write_frame (_format_context, &packet);
@@ -252,7 +256,9 @@ FFmpegFileEncoder::flush ()
                packet.data = 0;
                packet.size = 0;
 
+DCPOMATIC_DISABLE_WARNINGS
                avcodec_encode_audio2 (_audio_codec_context, &packet, 0, &got_packet);
+DCPOMATIC_ENABLE_WARNINGS
                if (got_packet) {
                        packet.stream_index = 0;
                        av_interleaved_write_frame (_format_context, &packet);
@@ -307,9 +313,11 @@ FFmpegFileEncoder::video (shared_ptr<PlayerVideo> video, DCPTime time)
        packet.size = 0;
 
        int got_packet;
+DCPOMATIC_DISABLE_WARNINGS
        if (avcodec_encode_video2 (_video_codec_context, &packet, frame, &got_packet) < 0) {
                throw EncodeError ("FFmpeg video encode failed");
        }
+DCPOMATIC_ENABLE_WARNINGS
 
        if (got_packet && packet.size) {
                packet.stream_index = _video_stream_index;
@@ -403,9 +411,11 @@ FFmpegFileEncoder::audio_frame (int size)
        packet.size = 0;
 
        int got_packet;
+DCPOMATIC_DISABLE_WARNINGS
        if (avcodec_encode_audio2 (_audio_codec_context, &packet, frame, &got_packet) < 0) {
                throw EncodeError ("FFmpeg audio encode failed");
        }
+DCPOMATIC_ENABLE_WARNINGS
 
        if (got_packet && packet.size) {
                packet.stream_index = _audio_stream_index;
index db6059266dc472e13b8908a67f5baf0b2a800618..f2b72059b9a013f59bad2c66e7ad56baa1dc207d 100644 (file)
 #include "image.h"
 #include "compose.hpp"
 #include "util.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 extern "C" {
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
 }
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
 #include "i18n.h"
@@ -83,7 +86,7 @@ avio_seek_wrapper (void* data, int64_t offset, int whence)
 int
 FFmpegImageProxy::avio_read (uint8_t* buffer, int const amount)
 {
-       int const to_do = min(int64_t(amount), _data.size() - _pos);
+       int const to_do = min(static_cast<int64_t>(amount), static_cast<int64_t>(_data.size()) - _pos);
        if (to_do == 0) {
                return AVERROR_EOF;
        }
@@ -112,6 +115,7 @@ FFmpegImageProxy::avio_seek (int64_t const pos, int whence)
        return _pos;
 }
 
+DCPOMATIC_DISABLE_WARNINGS
 
 ImageProxy::Result
 FFmpegImageProxy::image (optional<dcp::Size>) const
@@ -196,6 +200,8 @@ FFmpegImageProxy::image (optional<dcp::Size>) const
        return Result (_image, 0);
 }
 
+DCPOMATIC_ENABLE_WARNINGS
+
 void
 FFmpegImageProxy::add_metadata (xmlpp::Node* node) const
 {
index 86108ce4d1ea24ab38bf5ed29634344608376e1f..60327ab0d9d87c0f199215da1f05dda10dd67dd8 100644 (file)
 
 #include "ffmpeg_stream.h"
 #include "dcpomatic_assert.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 extern "C" {
 #include <libavformat/avformat.h>
 }
index da8bafc0af788a3c76328b6b7ef5a54445f2c1f1..72698fa51cc49b2a947abde2fedf87ed2d461cd8 100644 (file)
 */
 
 #include "ffmpeg_subtitle_stream.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 #include <iostream>
 
index 019c9ab076fe8f83e362c8030f2542b4beceb1df..a52957376298d9873570b1c33b458bbaaba46711 100644 (file)
 
 #include "font.h"
 #include "dcpomatic_assert.h"
+#include "warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 
 using std::string;
index c333325a126f52b1b8321ecf83809d70b2e93827..f4b25662648788856ffb2de692d2a8738b6ff12d 100644 (file)
 */
 
 #include "isdcf_metadata.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
 #include "i18n.h"
index 49805007394467ecee4836aa95c85c39ce92fa13..d8d8209c91145f78f2039f84ec1f9fb009df0a5c 100644 (file)
@@ -389,11 +389,15 @@ J2KEncoder::servers_list_changed ()
 
        if (!Config::instance()->only_servers_encode ()) {
                for (int i = 0; i < Config::instance()->master_encoding_threads (); ++i) {
-                       boost::thread* t = _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional<EncodeServerDescription>()));
 #ifdef DCPOMATIC_LINUX
+                       boost::thread* t = _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional<EncodeServerDescription>()));
                        pthread_setname_np (t->native_handle(), "encode-worker");
 #endif
+#ifdef DCPOMATIC_OSX
+                       _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional<EncodeServerDescription>()));
+#endif
 #ifdef DCPOMATIC_WINDOWS
+                       boost::thread* t = _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional<EncodeServerDescription>()));
                        if (windows_xp) {
                                SetThreadAffinityMask (t->native_handle(), 1 << i);
                        }
index acf8bb05235e7018216824bfd484f0fa533b5d6a..08ebc343c26ce7cf8e9407582d215f80f2914e0b 100644 (file)
@@ -22,6 +22,7 @@
 #include "dcpomatic_socket.h"
 #include "image.h"
 #include "dcpomatic_assert.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <dcp/openjpeg_image.h>
 #include <dcp/mono_picture_frame.h>
@@ -30,7 +31,9 @@
 #include <dcp/rgb_xyz.h>
 #include <dcp/j2k.h>
 #include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
 #include "i18n.h"
index 3f43a75eb8ee332a53d0a1bac1cb0e2ecc6e1dd0..4cff27b6f60a71e6439432cf8ce1650262d03a6a 100644 (file)
@@ -52,9 +52,11 @@ enum State {
 
 JSONServer::JSONServer (int port)
 {
-       thread* t = new thread (boost::bind (&JSONServer::run, this, port));
 #ifdef DCPOMATIC_LINUX
+       thread* t = new thread (boost::bind (&JSONServer::run, this, port));
        pthread_setname_np (t->native_handle(), "json-server");
+#else
+       new thread (boost::bind (&JSONServer::run, this, port));
 #endif
 }
 
index b68b4b7c75e2cabc20783fd2dbeadf3f3243058c..e92fc3c48d5bb8e17ded5c01052383abd5c6dbe2 100644 (file)
 #ifndef DCPOMATIC_KDM_RECIPIENT_H
 #define DCPOMATIC_KDM_RECIPIENT_H
 
+#include "warnings.h"
 #include <dcp/certificate.h>
 #include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/optional.hpp>
 #include <string>
 
index 2509bd0d46f460390e6fb5b72b54c51d0b59bf9c..09902c3a29b5c0a5844b83fe50f932e5039b34e0 100644 (file)
 
 #include "raw_image_proxy.h"
 #include "image.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <dcp/util.h>
 #include <libcxml/cxml.h>
 extern "C" {
 #include <libavutil/pixfmt.h>
 }
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 #include "i18n.h"
 
index de33f9380b1b09dfd4a9cde380874aba93e9251f..b0a958c16d194cd15b0a65d5ec72030a29a8f519 100644 (file)
 #include "cross.h"
 #include "font.h"
 #include "dcpomatic_assert.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <fontconfig/fontconfig.h>
 #include <cairomm/cairomm.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <pangomm.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <pango/pangocairo.h>
 #ifndef DCPOMATIC_HAVE_SHOW_IN_CAIRO_CONTEXT
 #include <pango/pangocairo.h>
index 6d58d97d188af6a455b8545988fcd83ab06c8639..1076af4335574a65c165cdbe81415cb8cfe073bc 100644 (file)
 */
 
 #include "rgba.h"
+#include "warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/lexical_cast.hpp>
 
 using std::string;
index d6fa67592b35a3e1a3195105afa7116380bef892..9bb0f1e555b1a900567cca4527d276b4ba6cf83a 100644 (file)
@@ -24,6 +24,7 @@
 #include "config.h"
 #include "cross.h"
 #include "compose.hpp"
+#include "warnings.h"
 #include <sys/stat.h>
 
 #include "i18n.h"
@@ -51,10 +52,12 @@ SCPUploader::SCPUploader (function<void (string)> set_status, function<void (flo
                throw NetworkError (String::compose (_("Could not connect to server %1 (%2)"), Config::instance()->tms_ip(), ssh_get_error (_session)));
        }
 
+DCPOMATIC_DISABLE_WARNINGS
        r = ssh_is_server_known (_session);
        if (r == SSH_SERVER_ERROR) {
                throw NetworkError (String::compose (_("SSH error (%1)"), ssh_get_error (_session)));
        }
+DCPOMATIC_ENABLE_WARNINGS
 
        r = ssh_userauth_password (_session, 0, Config::instance()->tms_password().c_str ());
        if (r != SSH_AUTH_SUCCESS) {
index ccf809f8bc5523f2e98dd81f4b9a84bfe40cb157..7692df0cab1680d9800423c629eed32003e6e5db 100644 (file)
 
 */
 
-#include "spl.h"
 #include "content_store.h"
+#include "spl.h"
+#include "warnings.h"
 #include <libcxml/cxml.h>
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 #include <iostream>
 
index 5b011a04654ec747dfe44a97e58c28039e1d3752..3cb1a9a363b5adecd833bce9d7aca8d84ddefc8a 100644 (file)
 #include "spl_entry.h"
 #include "dcp_content.h"
 #include "dcpomatic_assert.h"
+#include "warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
index f8254f00d62fa791742d097812445801e727a7d6..e6e8f310f4993ab375df09f6e5494dac5264f400 100644 (file)
 
 #include "subtitle_analysis.h"
 #include "exceptions.h"
+#include "warnings.h"
 #include <libcxml/cxml.h>
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 using std::string;
 using dcp::raw_convert;
index d2df7f1a8332219714a927bf15317a155f660420..df57f2d47143a470b1ed88ae11a6e0ac699abf4b 100644 (file)
 #include "types.h"
 #include "compose.hpp"
 #include "dcpomatic_assert.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <dcp/cpl.h>
 #include <dcp/dcp.h>
 #include <dcp/reel_mxf.h>
 #include <dcp/reel_asset.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <libcxml/cxml.h>
 #include <boost/foreach.hpp>
 
index 74951fc64e1ef9bb076e5959cdd43dddd140e25f..7ba9242fae5d795b6a9a1a0d7cf77cdd103bf531 100644 (file)
@@ -45,6 +45,7 @@
 #include "image.h"
 #include "text_decoder.h"
 #include "job_manager.h"
+#include "warnings.h"
 #include <dcp/decrypted_kdm.h>
 #include <dcp/locale_convert.h>
 #include <dcp/util.h>
@@ -65,7 +66,9 @@ extern "C" {
 #include <boost/range/algorithm/replace_if.hpp>
 #include <boost/thread.hpp>
 #include <boost/filesystem.hpp>
+DCPOMATIC_DISABLE_WARNINGS
 #include <boost/locale.hpp>
+DCPOMATIC_ENABLE_WARNINGS
 #ifdef DCPOMATIC_WINDOWS
 #include <boost/locale.hpp>
 #include <dbghelp.h>
@@ -230,6 +233,7 @@ addr2line (void const * const addr)
        return system(addr2line_cmd);
 }
 
+DCPOMATIC_DISABLE_WARNINGS
 /** This is called when C signals occur on Windows (e.g. SIGSEGV)
  *  (NOT C++ exceptions!).  We write a backtrace to backtrace_file by dark means.
  *  Adapted from code here: http://spin.atomicobject.com/2013/01/13/exceptions-stack-traces-c/
@@ -286,6 +290,7 @@ exception_handler(struct _EXCEPTION_POINTERS * info)
 
        return EXCEPTION_CONTINUE_SEARCH;
 }
+DCPOMATIC_ENABLE_WARNINGS
 #endif
 
 void
@@ -356,8 +361,10 @@ dcpomatic_setup ()
        SetUnhandledExceptionFilter(exception_handler);
 #endif
 
+DCPOMATIC_DISABLE_WARNINGS
        av_register_all ();
        avfilter_register_all ();
+DCPOMATIC_ENABLE_WARNINGS
 
 #ifdef DCPOMATIC_OSX
        /* Add our library directory to the libltdl search path so that
index 6075500e9d9148f5af103e9f56f6034dbdc3ab58..9b297c87bf63549e6736b1134e168c650bd1c026 100644 (file)
 
 */
 
-#include "video_filter_graph.h"
-#include "image.h"
 #include "compose.hpp"
+#include "image.h"
+#include "video_filter_graph.h"
+#include "warnings.h"
 extern "C" {
 #include <libavfilter/buffersrc.h>
 #include <libavfilter/buffersink.h>
@@ -51,6 +52,7 @@ VideoFilterGraph::process (AVFrame* frame)
 {
        list<pair<shared_ptr<Image>, int64_t> > images;
 
+DCPOMATIC_DISABLE_WARNINGS
        if (_copy) {
                images.push_back (make_pair (shared_ptr<Image> (new Image (frame)), av_frame_get_best_effort_timestamp (frame)));
        } else {
@@ -68,6 +70,7 @@ VideoFilterGraph::process (AVFrame* frame)
                        av_frame_unref (_frame);
                }
        }
+DCPOMATIC_ENABLE_WARNINGS
 
        return images;
 }
diff --git a/src/lib/warnings.h b/src/lib/warnings.h
new file mode 100644 (file)
index 0000000..d182526
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#if __GNUC__ >= 9
+#define DCPOMATIC_DISABLE_WARNINGS \
+  _Pragma("GCC diagnostic push") \
+  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
+  _Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
+  _Pragma("GCC diagnostic ignored \"-Wdeprecated-copy\"") \
+  _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
+#else
+#define DCPOMATIC_DISABLE_WARNINGS \
+  _Pragma("GCC diagnostic push") \
+  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
+  _Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
+  _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
+#endif
+
+#define DCPOMATIC_ENABLE_WARNINGS \
+  _Pragma("GCC diagnostic pop")
index c2dfb55d87d32880dabaf5f1a8e36b66e923d88a..0c9cddfa44456db8f352f5d24e208a49059f075e 100644 (file)
@@ -206,7 +206,7 @@ def build(bld):
                  """
 
     if bld.env.TARGET_OSX:
-        obj.framework = ['IOKit', 'Foundation', 'DiskArbitration']
+        obj.framework = ['IOKit', 'Foundation', 'DiskArbitration', 'ApplicationServices']
 
     obj.source = sources + ' version.cc'
 
index 9cd99a265f553b9e51f39a600e20dbe340a0a9a7..3680e2802dd8d7fb98a34cbcc4f640b828770a05 100644 (file)
 #include "lib/text_content.h"
 #include "lib/dcpomatic_log.h"
 #include "lib/subtitle_encoder.h"
+#include "lib/warnings.h"
 #include <dcp/exceptions.h>
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/generic/aboutdlgg.h>
 #include <wx/stdpaths.h>
 #include <wx/cmdline.h>
 #include <wx/preferences.h>
 #include <wx/splash.h>
 #include <wx/wxhtml.h>
+DCPOMATIC_ENABLE_WARNINGS
 #ifdef __WXGTK__
 #include <X11/Xlib.h>
 #endif
 #ifdef __WXMSW__
 #include <shellapi.h>
 #endif
-#ifdef __WXOSX__
-#include <ApplicationServices/ApplicationServices.h>
-#endif
 #include <boost/filesystem.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/foreach.hpp>
@@ -1548,10 +1548,9 @@ private:
                        unsetenv ("UBUNTU_MENUPROXY");
 #endif
 
-#ifdef __WXOSX__
-                       ProcessSerialNumber serial;
-                       GetCurrentProcess (&serial);
-                       TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+                       dcpomatic_sleep_seconds (1);
+                       make_foreground_application ();
 #endif
 
                        dcpomatic_setup_path_encoding ();
index 6d87273031fb8590721e082fada9ce71b3735bca..b94d4bf941016c4deb5e898040c7e50995c88fe5 100644 (file)
 #include "lib/job_manager.h"
 #include "lib/disk_writer_messages.h"
 #include "lib/version.h"
+#include "lib/warnings.h"
 #include <wx/wx.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <boost/process.hpp>
+DCPOMATIC_ENABLE_WARNINGS
 #ifdef DCPOMATIC_WINDOWS
 #include <boost/process/windows.hpp>
 #endif
 #ifdef DCPOMATIC_OSX
-#include <ApplicationServices/ApplicationServices.h>
 #include <notify.h>
 #endif
 
@@ -317,10 +319,8 @@ public:
                        unsetenv ("UBUNTU_MENUPROXY");
 #endif
 
-#ifdef __WXOSX__
-                       ProcessSerialNumber serial;
-                       GetCurrentProcess (&serial);
-                       TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+                       make_foreground_application ();
 #endif
 
                        dcpomatic_setup_path_encoding ();
index bac5f90840ea4dd91730b858a1506939c8dba3a7..2c3753e57e9c318bae90ee9670859294cee1483c 100644 (file)
@@ -27,6 +27,7 @@
 #include "lib/file_log.h"
 #include "lib/dcpomatic_log.h"
 #include "lib/nanomsg.h"
+#include "lib/warnings.h"
 extern "C" {
 #include <lwext4/ext4_mbr.h>
 #include <lwext4/ext4_fs.h>
@@ -66,7 +67,10 @@ extern "C" {
 }
 #endif
 
+DCPOMATIC_DISABLE_WARNINGS
 #include <glibmm.h>
+DCPOMATIC_ENABLE_WARNINGS
+
 #include <unistd.h>
 #include <sys/types.h>
 #include <boost/filesystem.hpp>
@@ -525,7 +529,7 @@ try
 
 #ifdef DCPOMATIC_LINUX
                polkit_authority = polkit_authority_get_sync (0, 0);
-               PolkitSubject* subject = polkit_unix_process_new (getppid());
+               PolkitSubject* subject = polkit_unix_process_new_for_owner (getppid(), 0, -1);
                Parameters* parameters = new Parameters;
                parameters->dcp_path = *dcp_path;
                parameters->device = *device;
@@ -565,7 +569,7 @@ main ()
        /* I *think* this confumes the notifyd event that we used to start the process, so we only
         * get started once per notification.
         */
-        xpc_set_event_stream_handler("com.apple.notifyd.matching", DISPATCH_TARGET_QUEUE_DEFAULT, ^(xpc_object_t event) {});
+        xpc_set_event_stream_handler("com.apple.notifyd.matching", DISPATCH_TARGET_QUEUE_DEFAULT, ^(xpc_object_t) {});
 #endif
 
        try {
index 117e756c72e93df587b325817fd181e9ec03f2f7..1d623abcd9222ad195185e83718591795b738120 100644 (file)
 #include <dcp/encrypted_kdm.h>
 #include <dcp/decrypted_kdm.h>
 #include <dcp/exceptions.h>
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/preferences.h>
 #include <wx/splash.h>
 #include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 #ifdef __WXOSX__
 #include <ApplicationServices/ApplicationServices.h>
 #endif
@@ -718,10 +721,8 @@ private:
                        unsetenv ("UBUNTU_MENUPROXY");
 #endif
 
-#ifdef __WXOSX__
-                       ProcessSerialNumber serial;
-                       GetCurrentProcess (&serial);
-                       TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+                       make_foreground_application ();
 #endif
 
                        dcpomatic_setup_path_encoding ();
index 67a06aec4f452b1dabde3f2166c73a3d54ba7a46..17f6526257c2a01e6e4d03b5c824d969e2ddb367 100644 (file)
@@ -73,9 +73,6 @@
 #ifdef __WXGTK__
 #include <X11/Xlib.h>
 #endif
-#ifdef __WXOSX__
-#include <ApplicationServices/ApplicationServices.h>
-#endif
 #include <boost/bind.hpp>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
@@ -1156,10 +1153,8 @@ private:
                        unsetenv ("UBUNTU_MENUPROXY");
 #endif
 
-#ifdef __WXOSX__
-                       ProcessSerialNumber serial;
-                       GetCurrentProcess (&serial);
-                       TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+                       make_foreground_application ();
 #endif
 
                        dcpomatic_setup_path_encoding ();
index 04950028af6dcfaec08a5ed663ebe4fb4f1391eb..b2b5c458a915b96dd263bf0882658009757f1ff1 100644 (file)
@@ -36,9 +36,6 @@
 #include <wx/imaglist.h>
 #include <wx/spinctrl.h>
 #include <wx/preferences.h>
-#ifdef __WXOSX__
-#include <ApplicationServices/ApplicationServices.h>
-#endif
 #include <boost/foreach.hpp>
 
 using std::exception;
@@ -585,10 +582,8 @@ private:
                unsetenv ("UBUNTU_MENUPROXY");
 #endif
 
-#ifdef __WXOSX__
-               ProcessSerialNumber serial;
-               GetCurrentProcess (&serial);
-               TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+               make_foreground_application ();
 #endif
 
                dcpomatic_setup_path_encoding ();
index cb4779ee3722c949278a7bdb1f4b4501f0a83164..a4ef0bc62a28ec8f37fd28b6cd7a3919173992fc 100644 (file)
 #include "lib/signaller.h"
 #include "lib/cross.h"
 #include "lib/dcpomatic_log.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/taskbar.h>
 #include <wx/splash.h>
 #include <wx/icon.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/thread.hpp>
 #include <boost/foreach.hpp>
 #include <boost/optional.hpp>
index 4f58b2d1882a6cd8383871592483cf6bd443e9f5..b3e68f4d1e9e2b28a45ecab31dd1d4c8b398009c 100644 (file)
 #include "static_text.h"
 #include "lib/version.h"
 #include "lib/compose.hpp"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/notebook.h>
 #include <wx/hyperlink.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 using std::vector;
 
index c1965459998ced7f4859b14113b87c017dad42bb..f3bb65a6c9d95e2868b8f725ad359ead00d664b4 100644 (file)
  *  @brief The "about DCP-o-matic" dialogue box.
  */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class wxNotebook;
 
index 93c33152aee997e5d73fca8f76e64d234f6888ba..e5625d415b5662f8e7885102d9058e1513eb1914 100644 (file)
 #include "lib/film.h"
 #include "lib/audio_analysis.h"
 #include "lib/playlist.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/signals2.hpp>
 
index 9e3ff787d93e7cf4b9c455c0fe99d1638815d59f..e1c96fdebe962d35784f5940c63aa03a52ed9a33 100644 (file)
 #include "audio_gain_dialog.h"
 #include "lib/audio_mapping.h"
 #include "lib/util.h"
+#include "lib/warnings.h"
 #include <dcp/locale_convert.h>
 #include <dcp/types.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/renderer.h>
 #include <wx/grid.h>
 #include <wx/graphics.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 #include <iostream>
 
index 3057416b29c623e1ad7b7c8fc06b223e89ccf221..e20e5289bc30901948d51a7d4b1a8a779fe8f927 100644 (file)
  *
  */
 
-#include <boost/signals2.hpp>
-#include <wx/wx.h>
 #include "lib/audio_mapping.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
+#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
+#include <boost/signals2.hpp>
 
 /** @class AudioMappingView
  *  @brief This class displays the mapping of one set of audio channels to another,
index 6eb853dce175349ee33f5a3c8878da15e71baac1..989f15edc04546e52f3decbb7e1c2a482d223d6a 100644 (file)
 
 #include "lib/util.h"
 #include "lib/audio_analysis.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/signals2.hpp>
 #include <vector>
index 5c366ca7b0dbe2cc9d9f61e8eba4002b5e71c6ff..cfdab5f3c2c39393e7eaefcb5fe1f6b5df991444 100644 (file)
 #include "lib/dcpomatic_time.h"
 #include "lib/player.h"
 #include "lib/text_ring_buffers.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class Butler;
 class FilmViewer;
index f47408a4ff740a97878da93a33c7fda6e6baeee4..afbe9ed2ebe81e381cb0fba1658758e191ece458 100644 (file)
 #include "lib/util.h"
 #include "lib/cross.h"
 #include "lib/exceptions.h"
+#include "lib/warnings.h"
 #include <dcp/locale_convert.h>
 #include <dcp/exceptions.h>
 #include <dcp/certificate_chain.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/stdpaths.h>
 #include <wx/preferences.h>
 #include <wx/spinctrl.h>
 #include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <RtAudio.h>
 #include <boost/filesystem.hpp>
 #include <boost/foreach.hpp>
index ba5d0c6fd02fda64765d6badc85fae4dc39e0614..b8c12d7b2aa36615f14ac564f9d1311c391ddb5e 100644 (file)
 */
 
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <vector>
 
index d5f502eeaf2a59608be487a9ccfb520feabb8d85..128a3862d44839c456959964973b71c6e9b6c374 100644 (file)
 #ifndef DCPOMATIC_CONTENT_SUB_PANEL_H
 #define DCPOMATIC_CONTENT_SUB_PANEL_H
 
-#include <boost/shared_ptr.hpp>
-#include <wx/wx.h>
 #include "lib/film.h"
 #include "lib/config.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
+#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
+#include <boost/shared_ptr.hpp>
 
 class ContentPanel;
 class Content;
index 334e9bb68202449a8053324cf5d6b854239a9085..3f4a65ab1bc1e58f1258ea6a6de219ee2e7c17a4 100644 (file)
 */
 
 #include "lib/content_store.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/listctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 #include <vector>
index b9c4604b6b298b7cd80d785ff759bbad58079e1e..1d6273af68088172e9e9702ee1c496a1a5e9d4a5 100644 (file)
 #include "lib/dcpomatic_time.h"
 #include "lib/types.h"
 #include "lib/film.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/signals2.hpp>
 
index 3452d5765b943f346db9e1fb015b006e2e72e06e..bb8be8e8024e26ca77fdb8539c255e2445a56a4c 100644 (file)
 #include "wx_util.h"
 #include "lib/util.h"
 #include <dcp/raw_convert.h>
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/propgrid/property.h>
 #include <wx/propgrid/props.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 
 using boost::optional;
index 4c9ccf388223b8bd161d196b4a751f2f58317113..485b6acf5b519e4982479ccecc67cfba180bcd44 100644 (file)
 */
 
 
+#include "lib/warnings.h"
 #include "table_dialog.h"
 #include <dcp/types.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/spinctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 
 class CustomScaleDialog : public TableDialog
index b05e73273d99d0703379ff109b5c1e70f200b9cf..289316820a3aa8bd2d806220b85546fcdff7297f 100644 (file)
 #include "wx_util.h"
 #include "static_text.h"
 #include "dcpomatic_button.h"
+#include "lib/warnings.h"
 #include <wx/wx.h>
 #include <wx/stdpaths.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
 
 using namespace std;
index f236096598ce07dfbb998fd950b3bda645803a9c..83fe57a170310dcf9e90928be3e73cf0b2a068c4 100644 (file)
 #ifndef DCPOMATIC_DIR_PICKER_CTRL
 #define DCPOMATIC_DIR_PICKER_CTRL
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class DirPickerCtrl : public wxPanel
 {
index 869092faac7404a6a2a654a8328ff57305faaf29..c690ea25d82b7658bf0a39a474685df03fb171fd 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class DiskWarningDialog : public wxDialog
 {
index 3f8730ae3a06e108c3d54866eac0d3236dddd933..d8645ff9713d5e8a24d51aded011e87fb1ac4f23 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "lib/config.h"
 #include "lib/send_kdm_email_job.h"
+#include "lib/warnings.h"
 #include "dkdm_output_panel.h"
 #include "kdm_timing_panel.h"
 #include "confirm_kdm_email_dialog.h"
@@ -32,7 +33,9 @@
 #ifdef DCPOMATIC_USE_OWN_PICKER
 #include "dir_picker_ctrl.h"
 #else
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 #endif
 #include <wx/stdpaths.h>
 
index a2fbf808f768b39c77e5f56a1e9e7ea0cff57ac9..ef241a0cab5d046ba9b2edcfed25af74a6f34627 100644 (file)
 
 */
 
+#include "lib/warnings.h"
 #include <dcp/certificate.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/notebook.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class DownloadCertificatePanel;
 
index 2ad03f7c0c96d1a00a82d8844684b8a52bc0b53c..ba355f8138c30c3c4aa46ecace7f75a7dc3fbf3d 100644 (file)
 #ifndef DCPOMATIC_DOWNLOAD_CERTIFICATE_PANEL_H
 #define DCPOMATIC_DOWNLOAD_CERTIFICATE_PANEL_H
 
+#include "lib/warnings.h"
 #include <dcp/certificate.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/optional.hpp>
 
 class DownloadCertificateDialog;
index 1043e7f1bf579985bf315abd7d8104f55e9f7a82..71a21b55f2408d312e442641d785a0418c96d4e2 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class DriveWipeWarningDialog : public wxDialog
 {
index ce6e1e2e98980fdd44be7c5b3fcbdb69cdc8ca3a..fa627cd81d51a36c12e9f2e9ad10d95caeb885b1 100644 (file)
 #include "file_picker_ctrl.h"
 #include "wx_util.h"
 #include "check_box.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/bind.hpp>
 
 using std::string;
index 47211a269149b83815922b53e5a0005822e04bd2..3eb05e44dcd966226fe2d0d582e41dfabfb980cc 100644 (file)
 #include "file_picker_ctrl.h"
 #include "wx_util.h"
 #include "dcpomatic_button.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/stdpaths.h>
 #include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
 
 using namespace std;
index b30288fa74826ec7d90994b037d1157d78fbfc0a..60858b665da55983d1a06fe83e9139dc53126833 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class FilePickerCtrl : public wxPanel
 {
index b8d862f8112ea03ebddf64d8976e22a0f9240850..84a1d361b7e3af37afec1085930a7e5b5156fdd6 100644 (file)
  */
 
 #include "lib/film.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
 class wxNotebook;
index cfa29670154db5e4751a23697ce10231b7c74eaa..f2f0826803c3ec98ec1deddc13ea4252f1b2eb07 100644 (file)
 
 */
 
-#include <wx/wx.h>
-#include <wx/filepicker.h>
 #include "wx_util.h"
 #include "table_dialog.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
+#include <wx/wx.h>
+#include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class DirPickerCtrl;
 
index 29985a5816bb701b44ec3e0a5c0e92672b8a4d8c..6e995813c5c0215751ec2ba52f31df6701330903 100644 (file)
 #include "lib/player_text.h"
 #include "lib/timer.h"
 #include "lib/signaller.h"
+#include "lib/warnings.h"
 #include <RtAudio.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class wxToggleButton;
 class FFmpegPlayer;
index 3ba4a09f5992342ef2e0e8593a20e80d872bde7f..775995f38f9c1fb4972e0594d32264ad010edcaf 100644 (file)
  *  @brief A dialog to select FFmpeg filters.
  */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
 class Film;
index f4f23cb283c7dba8eff4a7e9546a80cb54c9271d..e10075f3ad30418c2eb2e5a7712753ad3e1e054c 100644 (file)
 */
 
 #include "focus_manager.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/textctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 FocusManager* FocusManager::_instance;
 
index ba98e0963877b82ccf05982b4b81da161dd4ce99..260e74c3dcd58715f79e1b8f762446fdf1a4e773 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/listctrl.h>
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 #include <boost/filesystem.hpp>
index 786cee84a3a1afd9a8c19fc19640c7fc5ca433c6..a87249fafdd73d637bfc4649e36ea8137e32a0c3 100644 (file)
@@ -180,7 +180,9 @@ GLVideoView::draw (Position<int> inter_position, dcp::Size inter_size)
        glMatrixMode (GL_PROJECTION);
        glLoadIdentity ();
 
+DCPOMATIC_DISABLE_WARNINGS
        gluOrtho2D (0, canvas_size.GetWidth(), canvas_size.GetHeight(), 0);
+DCPOMATIC_ENABLE_WARNINGS
        check_gl_error ("gluOrtho2d");
        glMatrixMode (GL_MODELVIEW);
        glLoadIdentity ();
index 3675b8ddcb6025dce1c84b37a917e6b3d7ee2e57..fcf5dbcf251c890ca38945cc708ebbc945628874 100644 (file)
 #include "video_view.h"
 #include "lib/signaller.h"
 #include "lib/position.h"
-#include <wx/wx.h>
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/glcanvas.h>
+#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <dcp/util.h>
 #include <boost/atomic.hpp>
 #include <boost/shared_ptr.hpp>
index cb0de450a73ad7d141941536c003f4f057cfddf7..c98cbae07b2c16bb9e2b002706212cac13c5b557 100644 (file)
 #include "lib/film.h"
 #include "lib/hints.h"
 #include "lib/config.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/richtext/richtextctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 
 using std::max;
index 1fac9d11e63afa43ac33d65d52bc30e4089be00b..87dcf19535d977e7d8e8c89e824ccdb2f037707c 100644 (file)
 */
 
 #include "lib/types.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/weak_ptr.hpp>
 #include <boost/signals2.hpp>
 
index b5f86e7a131de7c823fd4cb293e0d82d069f7e99..873aa718cf5026da1bd3b29c1cca1395b1dae0aa 100644 (file)
 #include "html_dialog.h"
 #include "wx_util.h"
 #include "lib/cross.h"
+#include "lib/warnings.h"
 #include <boost/filesystem.hpp>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wxhtml.h>
 #include <wx/fs_mem.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
 HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html)
index f5fc76e4f67eced0a9f1c8b590d4de5187eb9c3a..9da4c82151d06b7ce4bf53dc893b5d5c5c0e77c3 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class wxHtmlLinkEvent;
 
index 40fd89a2c66cce72ecaed2701c7a47afbbad450d..b2de66172b0971fbee2c05c3aa9e2f786273eed9 100644 (file)
 #ifndef DCPOMATIC_I18N_HOOK_H
 #define DCPOMATIC_I18N_HOOK_H
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <map>
 
 class I18NHook
index 3dfdbe2b08c343ac4a0175369c51bf1eafb3ee2f..2198fb426928433b61c288a7738843e880dacc6f 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class InitialSetupDialog : public wxDialog
 {
index f9fe96d6a7b0319cbe9b7e0e009364f5b91bed5d..418a1145db939b50e746f8ae67858f1ff23f615c 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class InstantI18NDialog : public wxDialog
 {
index 77114a97c382b170f06758d58d1d8f2d41fb52af..2e471532fe1e7399a7e9b0978bbafcfe6e99fa80 100644 (file)
  *  @brief Class which is a wxPanel for showing the progress of jobs.
  */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <list>
 
index 9d6db76c6f2a7f2b0b50e1a6b1499a1f9401717f..4b461b8139e78795dc4d42ffbf9f9f3b1da5a536 100644 (file)
 */
 
 #include "lib/types.h"
+#include "lib/warnings.h"
 #include <boost/filesystem.hpp>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class KDMCPLPanel : public wxPanel
 {
index a345d0e963b62ed37dc6acde857f80998f11bd87..b138e7d31574b828f580a06548f44c12ddb03482 100644 (file)
@@ -18,9 +18,6 @@
 
 */
 
-#include "lib/config.h"
-#include "lib/cinema.h"
-#include "lib/send_kdm_email_job.h"
 #include "kdm_output_panel.h"
 #include "kdm_timing_panel.h"
 #include "confirm_kdm_email_dialog.h"
 #include "name_format_editor.h"
 #include "check_box.h"
 #include "dcpomatic_button.h"
+#include "lib/config.h"
+#include "lib/cinema.h"
+#include "lib/send_kdm_email_job.h"
+#include "lib/warnings.h"
 #include <dcp/exceptions.h>
 #include <dcp/types.h>
 #ifdef DCPOMATIC_USE_OWN_PICKER
 #include "dir_picker_ctrl.h"
 #else
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 #endif
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/stdpaths.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 using std::pair;
 using std::string;
index 51a99627c902d0260a5eb4e73f4e61866424bd6a..2734a9894240e5a7ee7c0a08d022e2a1b4fad3f5 100644 (file)
 #include "wx_util.h"
 #include "time_picker.h"
 #include "static_text.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/datectrl.h>
 #include <wx/dateevt.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 using std::cout;
 using boost::bind;
index a926864dbb72da8ee1904c68271064b6229c0a3a..be2e9309b660ca06afe34791fc9c99d3df29b3ef 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <boost/signals2.hpp>
 
index fbbaa1aee9fd2c12178d87ce6303c51b4a8b1a2a..e2c261873959074522a02a6356794beb0495388c 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 #include <list>
index 0f625907cc656f2509ae9588645c66fa8db99097..8ef43cf9a7ba7c28f90fd4057d6a048953255c89 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class MessageDialog : public wxDialog
 {
index acf20f129884173d4ee3988dd848a66752f5c790..bc5ae69621395653bbee9a512f0f31e47aab05b2 100644 (file)
 */
 
 #include "lib/config.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class NagDialog : public wxDialog
 {
index 2ae3f5e930911e887990088b3a848a717c29f2a8..32c78ea252ba8f5a668235ae4db6b6696cb8d1d9 100644 (file)
 #define DCPOMATIC_NAME_FORMAT_EDITOR_H
 
 #include "lib/compose.hpp"
+#include "lib/warnings.h"
 #include <dcp/name_format.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 #include <boost/signals2.hpp>
 
index b7cc9331995d4fd4c494bd275cb4631dfc6227e1..5939e5264ec31b3dab288c21acb4bcb889907b56 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
 class CheckBox;
index b932281746b0fe37c2e00c4860f3ce8d58935404..ae3e134295f3442694a1dceda5fcff9816f83d32 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/scoped_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 
index 9da73762f38d44860efedb7ac0780805090e5366..c8cc14676a3f8f87b0b06cba96519a8f1912a9ec 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 #include <boost/filesystem.hpp>
 
index a3b05173a40bdfb8189cdacdf5c39ccf2fdbd5fd..6b99065f632b05a224d990dde62978ee2810b600 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class QuestionDialog : public wxDialog
 {
index 94d5e3debc96ffa1c94d5990266185d83d289581..f0bb547080a4ef5bd8dc27d79c088024a3ed549c 100644 (file)
 #include "lib/util.h"
 #include <dcp/exceptions.h>
 #include <dcp/certificate_chain.h>
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/filepicker.h>
 #include <wx/validate.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
 using std::string;
index 15c043f1aa693f6d5167ac2332dbbf6c362c83e7..b33b7ebc88e6e6749f831cfdeae9353500ee584b 100644 (file)
 */
 
 #include "lib/dkdm_recipient.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/srchctrl.h>
 #include <wx/treectrl.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/signals2.hpp>
 #include <list>
index 0c4fb6a865345b0331849b0f14d619b07f3f3afd..d3f1d32f86fcb73938f1b3b8622dc6a06077c870 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/spinctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include "table_dialog.h"
 
 class RepeatDialog : public TableDialog
index 9bd70a50e7c73226f44dc644b53814de63c9dcec..651087907d24d038432efa9f9679d6935e342367 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/dialog.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 
 class wxTextCtrl;
index 6ea3571a102799c085ab6b7d460959b3a3e66e4c..731cf95396181cc9ef72814ee56f9533c903b3e5 100644 (file)
 #include "rgba_colour_picker.h"
 #include "wx_util.h"
 #include "static_text.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/clrpicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 RGBAColourPicker::RGBAColourPicker (wxWindow* parent, RGBA colour)
        : wxPanel (parent, wxID_ANY)
index c7972d4b3ec157f9d8427f32a7027b2ec10b8cab..30c81b103b107dc78d039ac1a24a0562b4ff20c5 100644 (file)
 */
 
 #include "lib/rgba.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class wxColourPickerCtrl;
 class wxSlider;
index 71d0ed99d27dfe74d0f8326a2a4864387a8b0a14..bc7065f294ede1d823e749bdfba09c0e84dd5abe 100644 (file)
 #include "dcpomatic_button.h"
 #include "lib/compose.hpp"
 #include "lib/util.h"
+#include "lib/warnings.h"
 #include <dcp/exceptions.h>
 #include <dcp/certificate_chain.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/filepicker.h>
 #include <wx/validate.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
 using std::string;
index 510297efb67a285e2bc06b722042b3e90519182d..9cf317c5a143becc3489d5474977197ea89c714f 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <wx/srchctrl.h>
 #include <wx/treectrl.h>
 #include <boost/shared_ptr.hpp>
index 5eae05de40f7cfdbadd59e2179f1f31c83df0b09..4c10c8f6bce7ad58ff3a1c775122312229fcf3c2 100644 (file)
 #include "lib/film.h"
 #include "lib/screen.h"
 #include "lib/config.h"
+#include "lib/warnings.h"
 #include <libcxml/cxml.h>
 #ifdef DCPOMATIC_USE_OWN_PICKER
 #include "dir_picker_ctrl.h"
 #else
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 #endif
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/treectrl.h>
 #include <wx/listctrl.h>
 #include <wx/stdpaths.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
 using std::string;
index 509280b5cc482e1d6e3efa62cdbcd09f3c03f30e..f49749a69fa748abf412e1a8f0ff6f311c5c0f0c 100644 (file)
 */
 
 #include "wx_util.h"
+#include "lib/warnings.h"
 #include <dcp/types.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <map>
index 309cde77e39fc0405890120c7b2f82396425658e..dc261ff1c8e718de348017b7170ccfa06e597db6 100644 (file)
 */
 
 #include "lib/encode_server.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/listctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
 class ServersListDialog : public wxDialog
index 643c782b80d554fa441c391ff40315c7fcbc38e3..323047adaca9182fcc237c0dfa6a330aa3f6cfd7 100644 (file)
 
 #include "video_view.h"
 #include "lib/position.h"
+#include "lib/warnings.h"
 #include <dcp/types.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class FilmViewer;
 
index 76e8d8b16d00f1df23698d07257278779f43f14d..6d905292eff2b4e8965dc9d92c875a7136f5425c 100644 (file)
 #include "lib/ffmpeg_content.h"
 #include "lib/examine_ffmpeg_subtitles_job.h"
 #include "lib/job_manager.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/clrpicker.h>
 #include <wx/spinctrl.h>
 #include <wx/gbsizer.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 using std::map;
 using std::string;
index 6c7e468178dc638c2fd0e742e4a4fedef5530dbf..b0dd8d30723775a852eb66234e7f25968c382e28 100644 (file)
 
 #include "timecode.h"
 #include "lib/rgba.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/signals2.hpp>
 
index 48a31a839160223d4408da4347a6e3575d55ab8a..da51c9c3a072322cb1a28d371f212130f5877978 100644 (file)
  *  one of those fonts.
  */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
 #include <boost/optional.hpp>
 #include <vector>
index a5015ee59c02f4921233922455a5e774b5fbce38..fdc2022c84f6a39033f54794ecd09927d1cf35f1 100644 (file)
 #ifndef DCPOMATIC_TABLE_DIALOG_H
 #define DCPOMATIC_TABLE_DIALOG_H
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class TableDialog : public wxDialog
 {
index 8ef0d956ccf78099fa70f5e3782d2c6ead0d00c7..4a55e0beb5dbb4c1512efb12486bc752997efcb3 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 #include <wx/listctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
 class TemplatesDialog : public wxDialog
index 6ce22dc799dfa9f579b733a0a023faf2bc10a1f9..d360838a834327ea5063d6d821dd1c6e65774691 100644 (file)
 */
 
 #include "lib/content_text.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <wx/listctrl.h>
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
index 9e83c00430709cc158dc1b23d6f530548c01ff39..53b0ce2b8886214128ce476b1de2c2efe6f1f05d 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
 class wxSpinCtrl;
index 27cfed53eef989373eee4db604886d4890c3facb..2573e3cb311b970cc181c1a76825b04beaa955bc 100644 (file)
 #define DCPOMATIC_TIMELINE_CONTENT_VIEW_H
 
 #include "lib/types.h"
+#include "lib/warnings.h"
 #include "timeline_view.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
 class Content;
index 9ae7de933966b3da4c331f896f21562952836e7b..de686f14ca68317697eca4ff72c13e88d7b2de40 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 class TryUnmountDialog : public wxDialog
 {
index e864564acd118c7822eda99cba6c99db7faca67f..373e518b1e46ee5000916cf5bd38ab532c153edd 100644 (file)
 #include "update_dialog.h"
 #include "static_text.h"
 #include "wx_util.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/hyperlink.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 using std::string;
 using boost::optional;
index 2db12ab6465440b71a3862a9937287a151c2bfcc..096699f39df3c0e6a741b9ad32d2c658fcdbeae8 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/optional.hpp>
 
 class UpdateDialog : public wxDialog
index 42728614f2b0f18425f98a872144a3833bfff492..6432d21c7a9922930cf094a620bf4ea9de47dea1 100644 (file)
 #include "verify_dcp_dialog.h"
 #include "wx_util.h"
 #include "lib/verify_dcp_job.h"
+#include "lib/warnings.h"
 #include <dcp/verify.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/richtext/richtextctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/foreach.hpp>
 
 using std::list;
index d2f21863d606eaf389c788c5a1bbb31e1e1b8517..b67c1dfc74429ce9e5dca9656fbbcfcdcba3756c 100644 (file)
 */
 
 #include <dcp/verify.h>
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <list>
 
 class wxRichTextCtrl;
index ac3a72dde524a331b4d427ff58c876df2c6b6a2c..252720f606214764d7a328b2ee555dd328c05df9 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/weak_ptr.hpp>
 
 class VideoWaveformPlot;
index 3801860740008cf82550a5431f4d50de46893100..1e38f58906b35d4b7f5d7b00802bcb1126943785 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 #include <boost/signals2.hpp>
index 95e71cbc0ee99d8b275ad5b6b121b4196d8be93b..78a98b1d60e036bd433acb9399f3ac45e4479fba 100644 (file)
 
 */
 
-#include <wx/wx.h>
 #include "wx_signal_manager.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
+#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 wxSignalManager::wxSignalManager (wxEvtHandler* h)
        : _handler (h)
index f8756549b44bca308ca591cace3c3859a9fea02e..46b122a8a6c82dca3231e2740553f8ce8c7ed6c7 100644 (file)
 #include "lib/util.h"
 #include "lib/cross.h"
 #include "lib/job.h"
+#include "lib/warnings.h"
 #include <dcp/locale_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/spinctrl.h>
 #include <wx/splash.h>
 #include <wx/progdlg.h>
 #include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/thread.hpp>
 
 using std::string;
index af938b670f54121b9d478fe9f4546c3a69d370e7..294c661a87dbed0fe88d59519f16cd872c0e0e7c 100644 (file)
 #define DCPOMATIC_WX_UTIL_H
 
 #include "lib/dcpomatic_time.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <wx/gbsizer.h>
 #include <boost/function.hpp>
 #include <boost/thread.hpp>
index d824ede30bebcca1c46fe768c1e705bcaa0e8e80..d80bfb2e0067dd79d620ea8b0994710606aab6f2 100644 (file)
@@ -53,6 +53,9 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
                name += "prores";
                extension = "mov";
                break;
+       case EXPORT_FORMAT_H264_PCM:
+       case EXPORT_FORMAT_SUBTITLES_DCP:
+               BOOST_REQUIRE (false);
        }
 
        name = String::compose("%1_test%2", name, number);
index 1e146246487ec972a5e8bfd8e162a0ded5abef4e..b4b7c260b8015cb90ddcaa13ea77fc8f5b472e4f 100644 (file)
  *  @brief Some simple tests of FFmpegAudioStream.
  */
 
-#include <boost/test/unit_test.hpp>
-#include <libxml++/libxml++.h>
-#include <libcxml/cxml.h>
+#include "lib/film.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/ffmpeg_audio_stream.h"
-#include "lib/film.h"
+#include "lib/warnings.h"
+#include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
+#include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
+#include <boost/test/unit_test.hpp>
 
 using std::pair;
 using std::list;
index 77108af46b586f267dc53db0830f671039148a09..b620a68a0802195982b02ddf365a22563cb2e8ce 100644 (file)
 
 */
 
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <Magick++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
 #include <boost/shared_ptr.hpp>
 
diff --git a/wscript b/wscript
index 72db83e2cc638ada4377d2f7dd6b62001518cdbf..f874758dde6d87d36267809965f643eef0d4b313 100644 (file)
--- a/wscript
+++ b/wscript
@@ -75,6 +75,7 @@ def options(opt):
     opt.add_option('--variant',           help='build variant (swaroop-studio, swaroop-theater)', choices=['swaroop-studio', 'swaroop-theater'])
     opt.add_option('--use-lld',           action='store_true', default=False, help='use lld linker')
     opt.add_option('--enable-disk',       action='store_true', default=False, help='build dcpomatic2_disk tool; requires Boost process, lwext4 and nanomsg libraries')
+    opt.add_option('--warnings-are-errors', action='store_true', default=False, help='build with -Werror')
 
 def configure(conf):
     conf.load('compiler_cxx')
@@ -106,22 +107,26 @@ def configure(conf):
                                        '-Wall',
                                        '-Wextra',
                                        '-Wwrite-strings',
-                                       '-Wsign-conversion',
-                                       # Remove auto_ptr warnings from libxml++-2.6
-                                       '-Wno-deprecated-declarations',
+                                       # I tried and failed to ignore these with _Pragma
                                        '-Wno-ignored-qualifiers',
-                                       '-Wno-parentheses',
                                        '-D_FILE_OFFSET_BITS=64'])
 
     if conf.options.force_cpp11:
         conf.env.append_value('CXXFLAGS', ['-std=c++11', '-DBOOST_NO_CXX11_SCOPED_ENUMS'])
 
+    if conf.options.warnings_are_errors:
+        conf.env.append_value('CXXFLAGS', '-Werror')
+
     if conf.env['CXX_NAME'] == 'gcc':
         gcc = conf.env['CC_VERSION']
-        if int(gcc[0]) >= 4 and int(gcc[1]) > 1:
-            conf.env.append_value('CXXFLAGS', ['-Wno-unused-result'])
-        if int(gcc[0]) >= 9:
-            conf.env.append_value('CXXFLAGS', ['-Wno-deprecated-copy'])
+        if int(gcc[0]) >= 8:
+            # I tried and failed to ignore these with _Pragma
+            conf.env.append_value('CXXFLAGS', ['-Wno-cast-function-type'])
+        elif int(gcc[0]) == 7:
+            # There appears to be a GCC bug which lingered from major versions 5--7 and which
+            # flags up these warnings all over the place in boost::optional.
+            # These seems to be the only practical way to hide it
+            conf.env.append_value('CXXFLAGS', ['-Wno-maybe-uninitialized'])
         have_c11 = int(gcc[0]) >= 4 and int(gcc[1]) >= 8 and int(gcc[2]) >= 1
     else:
         have_c11 = False
@@ -203,11 +208,8 @@ def configure(conf):
 
     # OSX
     if conf.env.TARGET_OSX:
-        conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_OSX', '-Wno-unused-function', '-Wno-unused-parameter', '-Wno-unused-local-typedef', '-Wno-potentially-evaluated-expression'])
+        conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_OSX'])
         conf.env.append_value('LINKFLAGS', '-headerpad_max_install_names')
-    else:
-        # Avoid the endless warnings about _t uninitialized in optional<>
-        conf.env.append_value('CXXFLAGS', '-Wno-maybe-uninitialized')
 
     #
     # Dependencies.
@@ -322,10 +324,10 @@ def configure(conf):
         if conf.options.workaround_gssapi:
             conf.env.LIB_SSH = ['gssapi_krb5']
     else:
-        conf.check_cc(fragment="""
+        conf.check_cxx(fragment="""
                                #include <libssh/libssh.h>\n
                                int main () {\n
-                               ssh_session s = ssh_new ();\n
+                               ssh_new ();\n
                                return 0;\n
                                }
                                """,
@@ -501,7 +503,7 @@ def configure(conf):
 
         conf.check_cxx(fragment="""
                            #include <boost/thread.hpp>\n
-                           int main() { boost::thread t (); }\n
+                           int main() { boost::thread t; }\n
                            """,
                        msg='Checking for boost threading library',
                        libpath='/usr/local/lib',
@@ -550,8 +552,9 @@ def configure(conf):
                 deps.append('boost_filesystem%s' % boost_lib_suffix)
             conf.check_cxx(fragment="""
                                 #include <boost/process.hpp>\n
-                                int main() { boost::process::child* c = new boost::process::child("foo"); }\n
+                                int main() { new boost::process::child("foo"); }\n
                                 """,
+                           cxxflags='-Wno-unused-parameter',
                            msg='Checking for boost process library',
                            lib=deps,
                            uselib_store='BOOST_PROCESS')