summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-07-27 21:47:26 +0200
committerCarl Hetherington <cth@carlh.net>2020-07-27 21:47:26 +0200
commit2da4caba7871455c097c0ed940dd6f2332dbda5d (patch)
treef87883d0fcfe4c19ae5f7490306d49cc4f5d02b3 /src
parent94aadbd62c259a73d7511522dd167d519c68c5f9 (diff)
parent5d440e1133fc68dfffeaf53cf934b996dae811c7 (diff)
Merge branch 'warnings' into v2.15.x.
Clean up our handling of compiler warnings in a variety of ways, and use #pragma rather than -Wno to only disable warnings where necessary.
Diffstat (limited to 'src')
-rw-r--r--src/lib/analyse_audio_job.h4
-rw-r--r--src/lib/analytics.cc3
-rw-r--r--src/lib/atmos_content.cc3
-rw-r--r--src/lib/audio_analysis.cc3
-rw-r--r--src/lib/audio_mapping.cc7
-rw-r--r--src/lib/audio_point.cc3
-rw-r--r--src/lib/cinema_sound_processor.cc2
-rw-r--r--src/lib/colour_conversion.cc3
-rw-r--r--src/lib/cross.h5
-rw-r--r--src/lib/cross_common.cc3
-rw-r--r--src/lib/cross_linux.cc15
-rw-r--r--src/lib/cross_osx.cc22
-rw-r--r--src/lib/dcp_text_track.h3
-rw-r--r--src/lib/dcp_video.cc3
-rw-r--r--src/lib/dkdm_wrapper.cc3
-rw-r--r--src/lib/edid.cc3
-rw-r--r--src/lib/encode_server.cc7
-rw-r--r--src/lib/exceptions.h10
-rw-r--r--src/lib/ffmpeg.cc8
-rw-r--r--src/lib/ffmpeg.h3
-rw-r--r--src/lib/ffmpeg_audio_stream.cc3
-rw-r--r--src/lib/ffmpeg_decoder.cc10
-rw-r--r--src/lib/ffmpeg_examiner.cc28
-rw-r--r--src/lib/ffmpeg_file_encoder.cc10
-rw-r--r--src/lib/ffmpeg_image_proxy.cc8
-rw-r--r--src/lib/ffmpeg_stream.cc3
-rw-r--r--src/lib/ffmpeg_subtitle_stream.cc3
-rw-r--r--src/lib/font.cc3
-rw-r--r--src/lib/isdcf_metadata.cc3
-rw-r--r--src/lib/j2k_encoder.cc6
-rw-r--r--src/lib/j2k_image_proxy.cc3
-rw-r--r--src/lib/json_server.cc4
-rw-r--r--src/lib/kdm_recipient.h3
-rw-r--r--src/lib/raw_image_proxy.cc3
-rw-r--r--src/lib/render_text.cc3
-rw-r--r--src/lib/rgba.cc3
-rw-r--r--src/lib/scp_uploader.cc3
-rw-r--r--src/lib/spl.cc5
-rw-r--r--src/lib/spl_entry.cc3
-rw-r--r--src/lib/subtitle_analysis.cc3
-rw-r--r--src/lib/types.cc3
-rw-r--r--src/lib/util.cc7
-rw-r--r--src/lib/video_filter_graph.cc7
-rw-r--r--src/lib/warnings.h37
-rw-r--r--src/lib/wscript2
-rw-r--r--src/tools/dcpomatic.cc13
-rw-r--r--src/tools/dcpomatic_disk.cc10
-rw-r--r--src/tools/dcpomatic_disk_writer.cc8
-rw-r--r--src/tools/dcpomatic_kdm.cc9
-rw-r--r--src/tools/dcpomatic_player.cc9
-rw-r--r--src/tools/dcpomatic_playlist.cc9
-rw-r--r--src/tools/dcpomatic_server.cc3
-rw-r--r--src/wx/about_dialog.cc3
-rw-r--r--src/wx/about_dialog.h3
-rw-r--r--src/wx/audio_dialog.h3
-rw-r--r--src/wx/audio_mapping_view.cc3
-rw-r--r--src/wx/audio_mapping_view.h7
-rw-r--r--src/wx/audio_plot.h3
-rw-r--r--src/wx/closed_captions_dialog.h3
-rw-r--r--src/wx/config_dialog.h3
-rw-r--r--src/wx/content_advanced_dialog.h3
-rw-r--r--src/wx/content_sub_panel.h7
-rw-r--r--src/wx/content_view.h3
-rw-r--r--src/wx/controls.h3
-rw-r--r--src/wx/custom_scale_dialog.cc3
-rw-r--r--src/wx/custom_scale_dialog.h3
-rw-r--r--src/wx/dir_picker_ctrl.cc3
-rw-r--r--src/wx/dir_picker_ctrl.h3
-rw-r--r--src/wx/disk_warning_dialog.h3
-rw-r--r--src/wx/dkdm_output_panel.cc3
-rw-r--r--src/wx/download_certificate_dialog.h3
-rw-r--r--src/wx/download_certificate_panel.h3
-rw-r--r--src/wx/drive_wipe_warning_dialog.h3
-rw-r--r--src/wx/export_dialog.cc3
-rw-r--r--src/wx/file_picker_ctrl.cc3
-rw-r--r--src/wx/file_picker_ctrl.h3
-rw-r--r--src/wx/film_editor.h3
-rw-r--r--src/wx/film_name_location_dialog.h7
-rw-r--r--src/wx/film_viewer.h3
-rw-r--r--src/wx/filter_dialog.h3
-rw-r--r--src/wx/focus_manager.cc3
-rw-r--r--src/wx/fonts_dialog.h3
-rw-r--r--src/wx/gl_video_view.cc2
-rw-r--r--src/wx/gl_video_view.h5
-rw-r--r--src/wx/hints_dialog.cc3
-rw-r--r--src/wx/hints_dialog.h3
-rw-r--r--src/wx/html_dialog.cc3
-rw-r--r--src/wx/html_dialog.h3
-rw-r--r--src/wx/i18n_hook.h3
-rw-r--r--src/wx/initial_setup_dialog.h3
-rw-r--r--src/wx/instant_i18n_dialog.h3
-rw-r--r--src/wx/job_manager_view.h3
-rw-r--r--src/wx/kdm_cpl_panel.h3
-rw-r--r--src/wx/kdm_output_panel.cc11
-rw-r--r--src/wx/kdm_timing_panel.cc3
-rw-r--r--src/wx/kdm_timing_panel.h3
-rw-r--r--src/wx/markers_dialog.h3
-rw-r--r--src/wx/message_dialog.h3
-rw-r--r--src/wx/nag_dialog.h3
-rw-r--r--src/wx/name_format_editor.h3
-rw-r--r--src/wx/password_entry.h3
-rw-r--r--src/wx/player_information.h3
-rw-r--r--src/wx/player_stress_tester.h3
-rw-r--r--src/wx/question_dialog.h3
-rw-r--r--src/wx/recipient_dialog.cc3
-rw-r--r--src/wx/recipients_panel.h3
-rw-r--r--src/wx/repeat_dialog.h3
-rw-r--r--src/wx/report_problem_dialog.h3
-rw-r--r--src/wx/rgba_colour_picker.cc3
-rw-r--r--src/wx/rgba_colour_picker.h3
-rw-r--r--src/wx/screen_dialog.cc3
-rw-r--r--src/wx/screens_panel.h3
-rw-r--r--src/wx/self_dkdm_dialog.cc5
-rw-r--r--src/wx/self_dkdm_dialog.h3
-rw-r--r--src/wx/servers_list_dialog.h3
-rw-r--r--src/wx/simple_video_view.h3
-rw-r--r--src/wx/subtitle_appearance_dialog.cc3
-rw-r--r--src/wx/subtitle_appearance_dialog.h3
-rw-r--r--src/wx/system_font_dialog.h3
-rw-r--r--src/wx/table_dialog.h3
-rw-r--r--src/wx/templates_dialog.h3
-rw-r--r--src/wx/text_view.h3
-rw-r--r--src/wx/time_picker.h3
-rw-r--r--src/wx/timeline_content_view.h3
-rw-r--r--src/wx/try_unmount_dialog.h3
-rw-r--r--src/wx/update_dialog.cc3
-rw-r--r--src/wx/update_dialog.h3
-rw-r--r--src/wx/verify_dcp_dialog.cc3
-rw-r--r--src/wx/verify_dcp_dialog.h3
-rw-r--r--src/wx/video_waveform_dialog.h3
-rw-r--r--src/wx/video_waveform_plot.h3
-rw-r--r--src/wx/wx_signal_manager.cc5
-rw-r--r--src/wx/wx_util.cc3
-rw-r--r--src/wx/wx_util.h3
134 files changed, 537 insertions, 74 deletions
diff --git a/src/lib/analyse_audio_job.h b/src/lib/analyse_audio_job.h
index f7cc3e256..8f88b0fa1 100644
--- a/src/lib/analyse_audio_job.h
+++ b/src/lib/analyse_audio_job.h
@@ -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;
diff --git a/src/lib/analytics.cc b/src/lib/analytics.cc
index 34f67116e..f20b213e4 100644
--- a/src/lib/analytics.cc
+++ b/src/lib/analytics.cc
@@ -21,9 +21,12 @@
#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>
diff --git a/src/lib/atmos_content.cc b/src/lib/atmos_content.cc
index 2e59b92b7..0543437a3 100644
--- a/src/lib/atmos_content.cc
+++ b/src/lib/atmos_content.cc
@@ -20,8 +20,11 @@
#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;
diff --git a/src/lib/audio_analysis.cc b/src/lib/audio_analysis.cc
index 446fcccef..f69bcd362 100644
--- a/src/lib/audio_analysis.cc
+++ b/src/lib/audio_analysis.cc
@@ -23,8 +23,11 @@
#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>
diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc
index 05dfb7e89..94efbe49b 100644
--- a/src/lib/audio_mapping.cc
+++ b/src/lib/audio_mapping.cc
@@ -19,12 +19,15 @@
*/
#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>
diff --git a/src/lib/audio_point.cc b/src/lib/audio_point.cc
index b5ea2c31e..722673b96 100644
--- a/src/lib/audio_point.cc
+++ b/src/lib/audio_point.cc
@@ -19,8 +19,11 @@
*/
#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;
diff --git a/src/lib/cinema_sound_processor.cc b/src/lib/cinema_sound_processor.cc
index 1a3ba5a0f..bd60f7d71 100644
--- a/src/lib/cinema_sound_processor.cc
+++ b/src/lib/cinema_sound_processor.cc
@@ -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];
}
diff --git a/src/lib/colour_conversion.cc b/src/lib/colour_conversion.cc
index 2e052060e..22404c279 100644
--- a/src/lib/colour_conversion.cc
+++ b/src/lib/colour_conversion.cc
@@ -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>
diff --git a/src/lib/cross.h b/src/lib/cross.h
index 4d3d2b2c7..64cb2e6b8 100644
--- a/src/lib/cross.h
+++ b/src/lib/cross.h
@@ -40,12 +40,13 @@
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
diff --git a/src/lib/cross_common.cc b/src/lib/cross_common.cc
index cf220fe53..edc806b58 100644
--- a/src/lib/cross_common.cc
+++ b/src/lib/cross_common.cc
@@ -21,9 +21,12 @@
#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"
diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc
index 25fd3490e..e17f188b9 100644
--- a/src/lib/cross_linux.cc
+++ b/src/lib/cross_linux.cc
@@ -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
diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc
index 574cc8660..e91d3df16 100644
--- a/src/lib/cross_osx.cc
+++ b/src/lib/cross_osx.cc
@@ -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);
+}
+
diff --git a/src/lib/dcp_text_track.h b/src/lib/dcp_text_track.h
index 913e77fa5..e6a146b3b 100644
--- a/src/lib/dcp_text_track.h
+++ b/src/lib/dcp_text_track.h
@@ -21,8 +21,11 @@
#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
{
diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc
index 7b06f8cfc..d6b9d4f27 100644
--- a/src/lib/dcp_video.cc
+++ b/src/lib/dcp_video.cc
@@ -39,12 +39,15 @@
#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>
diff --git a/src/lib/dkdm_wrapper.cc b/src/lib/dkdm_wrapper.cc
index 0dd37b464..6638bc315 100644
--- a/src/lib/dkdm_wrapper.cc
+++ b/src/lib/dkdm_wrapper.cc
@@ -21,7 +21,10 @@
#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;
diff --git a/src/lib/edid.cc b/src/lib/edid.cc
index 3df65d325..a530b8e38 100644
--- a/src/lib/edid.cc
+++ b/src/lib/edid.cc
@@ -20,8 +20,11 @@
#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>
diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc
index c242cb216..c30fc8f30 100644
--- a/src/lib/encode_server.cc
+++ b/src/lib/encode_server.cc
@@ -36,9 +36,12 @@
#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
}
diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h
index 98534bb32..05cda9659 100644
--- a/src/lib/exceptions.h
+++ b/src/lib/exceptions.h
@@ -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
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc
index 8eb19816c..0802fa159 100644
--- a/src/lib/ffmpeg.cc
+++ b/src/lib/ffmpeg.cc
@@ -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)
diff --git a/src/lib/ffmpeg.h b/src/lib/ffmpeg.h
index 10517055c..e6399c076 100644
--- a/src/lib/ffmpeg.h
+++ b/src/lib/ffmpeg.h
@@ -23,9 +23,12 @@
#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>
diff --git a/src/lib/ffmpeg_audio_stream.cc b/src/lib/ffmpeg_audio_stream.cc
index 1fc008d51..32828f13a 100644
--- a/src/lib/ffmpeg_audio_stream.cc
+++ b/src/lib/ffmpeg_audio_stream.cc
@@ -20,7 +20,10 @@
#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;
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index cfaf0361b..04c97ed3b 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -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);
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index 3fb9a53e4..cc6a62ff6 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -18,6 +18,14 @@
*/
+#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
{
diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc
index 44ef3f072..f8bd14e76 100644
--- a/src/lib/ffmpeg_file_encoder.cc
+++ b/src/lib/ffmpeg_file_encoder.cc
@@ -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;
diff --git a/src/lib/ffmpeg_image_proxy.cc b/src/lib/ffmpeg_image_proxy.cc
index db6059266..f2b72059b 100644
--- a/src/lib/ffmpeg_image_proxy.cc
+++ b/src/lib/ffmpeg_image_proxy.cc
@@ -25,12 +25,15 @@
#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
{
diff --git a/src/lib/ffmpeg_stream.cc b/src/lib/ffmpeg_stream.cc
index 86108ce4d..60327ab0d 100644
--- a/src/lib/ffmpeg_stream.cc
+++ b/src/lib/ffmpeg_stream.cc
@@ -20,8 +20,11 @@
#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>
}
diff --git a/src/lib/ffmpeg_subtitle_stream.cc b/src/lib/ffmpeg_subtitle_stream.cc
index da8bafc0a..72698fa51 100644
--- a/src/lib/ffmpeg_subtitle_stream.cc
+++ b/src/lib/ffmpeg_subtitle_stream.cc
@@ -19,8 +19,11 @@
*/
#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>
diff --git a/src/lib/font.cc b/src/lib/font.cc
index 019c9ab07..a52957376 100644
--- a/src/lib/font.cc
+++ b/src/lib/font.cc
@@ -20,7 +20,10 @@
#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;
diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc
index c333325a1..f4b256626 100644
--- a/src/lib/isdcf_metadata.cc
+++ b/src/lib/isdcf_metadata.cc
@@ -19,9 +19,12 @@
*/
#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"
diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc
index 498050073..d8d8209c9 100644
--- a/src/lib/j2k_encoder.cc
+++ b/src/lib/j2k_encoder.cc
@@ -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);
}
diff --git a/src/lib/j2k_image_proxy.cc b/src/lib/j2k_image_proxy.cc
index acf8bb052..08ebc343c 100644
--- a/src/lib/j2k_image_proxy.cc
+++ b/src/lib/j2k_image_proxy.cc
@@ -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"
diff --git a/src/lib/json_server.cc b/src/lib/json_server.cc
index 3f43a75eb..4cff27b6f 100644
--- a/src/lib/json_server.cc
+++ b/src/lib/json_server.cc
@@ -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
}
diff --git a/src/lib/kdm_recipient.h b/src/lib/kdm_recipient.h
index b68b4b7c7..e92fc3c48 100644
--- a/src/lib/kdm_recipient.h
+++ b/src/lib/kdm_recipient.h
@@ -21,9 +21,12 @@
#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>
diff --git a/src/lib/raw_image_proxy.cc b/src/lib/raw_image_proxy.cc
index 2509bd0d4..09902c3a2 100644
--- a/src/lib/raw_image_proxy.cc
+++ b/src/lib/raw_image_proxy.cc
@@ -20,13 +20,16 @@
#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"
diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc
index de33f9380..b0a958c16 100644
--- a/src/lib/render_text.cc
+++ b/src/lib/render_text.cc
@@ -24,10 +24,13 @@
#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>
diff --git a/src/lib/rgba.cc b/src/lib/rgba.cc
index 6d58d97d1..1076af433 100644
--- a/src/lib/rgba.cc
+++ b/src/lib/rgba.cc
@@ -19,7 +19,10 @@
*/
#include "rgba.h"
+#include "warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/lexical_cast.hpp>
using std::string;
diff --git a/src/lib/scp_uploader.cc b/src/lib/scp_uploader.cc
index d6fa67592..9bb0f1e55 100644
--- a/src/lib/scp_uploader.cc
+++ b/src/lib/scp_uploader.cc
@@ -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) {
diff --git a/src/lib/spl.cc b/src/lib/spl.cc
index ccf809f8b..7692df0ca 100644
--- a/src/lib/spl.cc
+++ b/src/lib/spl.cc
@@ -18,11 +18,14 @@
*/
-#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>
diff --git a/src/lib/spl_entry.cc b/src/lib/spl_entry.cc
index 5b011a046..3cb1a9a36 100644
--- a/src/lib/spl_entry.cc
+++ b/src/lib/spl_entry.cc
@@ -21,7 +21,10 @@
#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;
diff --git a/src/lib/subtitle_analysis.cc b/src/lib/subtitle_analysis.cc
index f8254f00d..e6e8f310f 100644
--- a/src/lib/subtitle_analysis.cc
+++ b/src/lib/subtitle_analysis.cc
@@ -20,9 +20,12 @@
#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;
diff --git a/src/lib/types.cc b/src/lib/types.cc
index d2df7f1a8..df57f2d47 100644
--- a/src/lib/types.cc
+++ b/src/lib/types.cc
@@ -21,12 +21,15 @@
#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>
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 74951fc64..7ba9242fa 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -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
diff --git a/src/lib/video_filter_graph.cc b/src/lib/video_filter_graph.cc
index 6075500e9..9b297c87b 100644
--- a/src/lib/video_filter_graph.cc
+++ b/src/lib/video_filter_graph.cc
@@ -18,9 +18,10 @@
*/
-#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
index 000000000..d182526ff
--- /dev/null
+++ b/src/lib/warnings.h
@@ -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")
diff --git a/src/lib/wscript b/src/lib/wscript
index c2dfb55d8..0c9cddfa4 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -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'
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 9cd99a265..3680e2802 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -84,23 +84,23 @@
#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 ();
diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc
index 6d8727303..b94d4bf94 100644
--- a/src/tools/dcpomatic_disk.cc
+++ b/src/tools/dcpomatic_disk.cc
@@ -35,13 +35,15 @@
#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 ();
diff --git a/src/tools/dcpomatic_disk_writer.cc b/src/tools/dcpomatic_disk_writer.cc
index bac5f9084..2c3753e57 100644
--- a/src/tools/dcpomatic_disk_writer.cc
+++ b/src/tools/dcpomatic_disk_writer.cc
@@ -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 {
diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc
index 117e756c7..1d623abcd 100644
--- a/src/tools/dcpomatic_kdm.cc
+++ b/src/tools/dcpomatic_kdm.cc
@@ -51,10 +51,13 @@
#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 ();
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 67a06aec4..17f652625 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -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 ();
diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc
index 04950028a..b2b5c458a 100644
--- a/src/tools/dcpomatic_playlist.cc
+++ b/src/tools/dcpomatic_playlist.cc
@@ -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 ();
diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc
index cb4779ee3..a4ef0bc62 100644
--- a/src/tools/dcpomatic_server.cc
+++ b/src/tools/dcpomatic_server.cc
@@ -29,9 +29,12 @@
#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>
diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc
index 4f58b2d18..b3e68f4d1 100644
--- a/src/wx/about_dialog.cc
+++ b/src/wx/about_dialog.cc
@@ -27,8 +27,11 @@
#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;
diff --git a/src/wx/about_dialog.h b/src/wx/about_dialog.h
index c19654599..f3bb65a6c 100644
--- a/src/wx/about_dialog.h
+++ b/src/wx/about_dialog.h
@@ -22,7 +22,10 @@
* @brief The "about DCP-o-matic" dialogue box.
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class wxNotebook;
diff --git a/src/wx/audio_dialog.h b/src/wx/audio_dialog.h
index 93c33152a..e5625d415 100644
--- a/src/wx/audio_dialog.h
+++ b/src/wx/audio_dialog.h
@@ -21,7 +21,10 @@
#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>
diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc
index 9e3ff787d..e1c96fdeb 100644
--- a/src/wx/audio_mapping_view.cc
+++ b/src/wx/audio_mapping_view.cc
@@ -27,12 +27,15 @@
#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>
diff --git a/src/wx/audio_mapping_view.h b/src/wx/audio_mapping_view.h
index 3057416b2..e20e5289b 100644
--- a/src/wx/audio_mapping_view.h
+++ b/src/wx/audio_mapping_view.h
@@ -23,9 +23,12 @@
*
*/
-#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,
diff --git a/src/wx/audio_plot.h b/src/wx/audio_plot.h
index 6eb853dce..989f15edc 100644
--- a/src/wx/audio_plot.h
+++ b/src/wx/audio_plot.h
@@ -20,7 +20,10 @@
#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>
diff --git a/src/wx/closed_captions_dialog.h b/src/wx/closed_captions_dialog.h
index 5c366ca7b..cfdab5f3c 100644
--- a/src/wx/closed_captions_dialog.h
+++ b/src/wx/closed_captions_dialog.h
@@ -21,7 +21,10 @@
#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;
diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h
index f47408a4f..afbe9ed2e 100644
--- a/src/wx/config_dialog.h
+++ b/src/wx/config_dialog.h
@@ -32,13 +32,16 @@
#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>
diff --git a/src/wx/content_advanced_dialog.h b/src/wx/content_advanced_dialog.h
index ba5d0c6fd..b8c12d7b2 100644
--- a/src/wx/content_advanced_dialog.h
+++ b/src/wx/content_advanced_dialog.h
@@ -19,7 +19,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/shared_ptr.hpp>
#include <vector>
diff --git a/src/wx/content_sub_panel.h b/src/wx/content_sub_panel.h
index d5f502eea..128a3862d 100644
--- a/src/wx/content_sub_panel.h
+++ b/src/wx/content_sub_panel.h
@@ -21,10 +21,13 @@
#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;
diff --git a/src/wx/content_view.h b/src/wx/content_view.h
index 334e9bb68..3f4a65ab1 100644
--- a/src/wx/content_view.h
+++ b/src/wx/content_view.h
@@ -19,7 +19,10 @@
*/
#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>
diff --git a/src/wx/controls.h b/src/wx/controls.h
index b9c4604b6..1d6273af6 100644
--- a/src/wx/controls.h
+++ b/src/wx/controls.h
@@ -24,7 +24,10 @@
#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>
diff --git a/src/wx/custom_scale_dialog.cc b/src/wx/custom_scale_dialog.cc
index 3452d5765..bb8be8e80 100644
--- a/src/wx/custom_scale_dialog.cc
+++ b/src/wx/custom_scale_dialog.cc
@@ -23,9 +23,12 @@
#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;
diff --git a/src/wx/custom_scale_dialog.h b/src/wx/custom_scale_dialog.h
index 4c9ccf388..485b6acf5 100644
--- a/src/wx/custom_scale_dialog.h
+++ b/src/wx/custom_scale_dialog.h
@@ -19,10 +19,13 @@
*/
+#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
diff --git a/src/wx/dir_picker_ctrl.cc b/src/wx/dir_picker_ctrl.cc
index b05e73273..289316820 100644
--- a/src/wx/dir_picker_ctrl.cc
+++ b/src/wx/dir_picker_ctrl.cc
@@ -22,9 +22,12 @@
#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;
diff --git a/src/wx/dir_picker_ctrl.h b/src/wx/dir_picker_ctrl.h
index f23609659..83fe57a17 100644
--- a/src/wx/dir_picker_ctrl.h
+++ b/src/wx/dir_picker_ctrl.h
@@ -21,7 +21,10 @@
#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
{
diff --git a/src/wx/disk_warning_dialog.h b/src/wx/disk_warning_dialog.h
index 869092faa..c690ea25d 100644
--- a/src/wx/disk_warning_dialog.h
+++ b/src/wx/disk_warning_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class DiskWarningDialog : public wxDialog
{
diff --git a/src/wx/dkdm_output_panel.cc b/src/wx/dkdm_output_panel.cc
index 3f8730ae3..d8645ff97 100644
--- a/src/wx/dkdm_output_panel.cc
+++ b/src/wx/dkdm_output_panel.cc
@@ -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>
diff --git a/src/wx/download_certificate_dialog.h b/src/wx/download_certificate_dialog.h
index a2fbf808f..ef241a0ca 100644
--- a/src/wx/download_certificate_dialog.h
+++ b/src/wx/download_certificate_dialog.h
@@ -18,9 +18,12 @@
*/
+#include "lib/warnings.h"
#include <dcp/certificate.h>
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
#include <wx/notebook.h>
+DCPOMATIC_ENABLE_WARNINGS
class DownloadCertificatePanel;
diff --git a/src/wx/download_certificate_panel.h b/src/wx/download_certificate_panel.h
index 2ad03f7c0..ba355f813 100644
--- a/src/wx/download_certificate_panel.h
+++ b/src/wx/download_certificate_panel.h
@@ -21,8 +21,11 @@
#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;
diff --git a/src/wx/drive_wipe_warning_dialog.h b/src/wx/drive_wipe_warning_dialog.h
index 1043e7f1b..71a21b55f 100644
--- a/src/wx/drive_wipe_warning_dialog.h
+++ b/src/wx/drive_wipe_warning_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class DriveWipeWarningDialog : public wxDialog
{
diff --git a/src/wx/export_dialog.cc b/src/wx/export_dialog.cc
index ce6e1e2e9..fa627cd81 100644
--- a/src/wx/export_dialog.cc
+++ b/src/wx/export_dialog.cc
@@ -22,7 +22,10 @@
#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;
diff --git a/src/wx/file_picker_ctrl.cc b/src/wx/file_picker_ctrl.cc
index 47211a269..3eb05e44d 100644
--- a/src/wx/file_picker_ctrl.cc
+++ b/src/wx/file_picker_ctrl.cc
@@ -21,9 +21,12 @@
#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;
diff --git a/src/wx/file_picker_ctrl.h b/src/wx/file_picker_ctrl.h
index b30288fa7..60858b665 100644
--- a/src/wx/file_picker_ctrl.h
+++ b/src/wx/file_picker_ctrl.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class FilePickerCtrl : public wxPanel
{
diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h
index b8d862f81..84a1d361b 100644
--- a/src/wx/film_editor.h
+++ b/src/wx/film_editor.h
@@ -23,7 +23,10 @@
*/
#include "lib/film.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
class wxNotebook;
diff --git a/src/wx/film_name_location_dialog.h b/src/wx/film_name_location_dialog.h
index cfa296701..f2f082680 100644
--- a/src/wx/film_name_location_dialog.h
+++ b/src/wx/film_name_location_dialog.h
@@ -18,10 +18,13 @@
*/
-#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;
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index 29985a581..6e995813c 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -28,8 +28,11 @@
#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;
diff --git a/src/wx/filter_dialog.h b/src/wx/filter_dialog.h
index 3ba4a09f5..775995f38 100644
--- a/src/wx/filter_dialog.h
+++ b/src/wx/filter_dialog.h
@@ -22,7 +22,10 @@
* @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;
diff --git a/src/wx/focus_manager.cc b/src/wx/focus_manager.cc
index f4f23cb28..e10075f3a 100644
--- a/src/wx/focus_manager.cc
+++ b/src/wx/focus_manager.cc
@@ -19,7 +19,10 @@
*/
#include "focus_manager.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/textctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
FocusManager* FocusManager::_instance;
diff --git a/src/wx/fonts_dialog.h b/src/wx/fonts_dialog.h
index ba98e0963..260e74c3d 100644
--- a/src/wx/fonts_dialog.h
+++ b/src/wx/fonts_dialog.h
@@ -18,8 +18,11 @@
*/
+#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>
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc
index 786cee84a..a87249faf 100644
--- a/src/wx/gl_video_view.cc
+++ b/src/wx/gl_video_view.cc
@@ -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 ();
diff --git a/src/wx/gl_video_view.h b/src/wx/gl_video_view.h
index 3675b8ddc..fcf5dbcf2 100644
--- a/src/wx/gl_video_view.h
+++ b/src/wx/gl_video_view.h
@@ -21,8 +21,11 @@
#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>
diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc
index cb0de450a..c98cbae07 100644
--- a/src/wx/hints_dialog.cc
+++ b/src/wx/hints_dialog.cc
@@ -25,7 +25,10 @@
#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;
diff --git a/src/wx/hints_dialog.h b/src/wx/hints_dialog.h
index 1fac9d11e..87dcf1953 100644
--- a/src/wx/hints_dialog.h
+++ b/src/wx/hints_dialog.h
@@ -19,7 +19,10 @@
*/
#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>
diff --git a/src/wx/html_dialog.cc b/src/wx/html_dialog.cc
index b5f86e7a1..873aa718c 100644
--- a/src/wx/html_dialog.cc
+++ b/src/wx/html_dialog.cc
@@ -21,9 +21,12 @@
#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)
diff --git a/src/wx/html_dialog.h b/src/wx/html_dialog.h
index f5fc76e4f..9da4c8215 100644
--- a/src/wx/html_dialog.h
+++ b/src/wx/html_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class wxHtmlLinkEvent;
diff --git a/src/wx/i18n_hook.h b/src/wx/i18n_hook.h
index 40fd89a2c..b2de66172 100644
--- a/src/wx/i18n_hook.h
+++ b/src/wx/i18n_hook.h
@@ -21,7 +21,10 @@
#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
diff --git a/src/wx/initial_setup_dialog.h b/src/wx/initial_setup_dialog.h
index 3dfdbe2b0..2198fb426 100644
--- a/src/wx/initial_setup_dialog.h
+++ b/src/wx/initial_setup_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class InitialSetupDialog : public wxDialog
{
diff --git a/src/wx/instant_i18n_dialog.h b/src/wx/instant_i18n_dialog.h
index f9fe96d6a..418a1145d 100644
--- a/src/wx/instant_i18n_dialog.h
+++ b/src/wx/instant_i18n_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class InstantI18NDialog : public wxDialog
{
diff --git a/src/wx/job_manager_view.h b/src/wx/job_manager_view.h
index 77114a97c..2e471532f 100644
--- a/src/wx/job_manager_view.h
+++ b/src/wx/job_manager_view.h
@@ -22,7 +22,10 @@
* @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>
diff --git a/src/wx/kdm_cpl_panel.h b/src/wx/kdm_cpl_panel.h
index 9d6db76c6..4b461b813 100644
--- a/src/wx/kdm_cpl_panel.h
+++ b/src/wx/kdm_cpl_panel.h
@@ -19,8 +19,11 @@
*/
#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
{
diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc
index a345d0e96..b138e7d31 100644
--- a/src/wx/kdm_output_panel.cc
+++ b/src/wx/kdm_output_panel.cc
@@ -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"
@@ -29,14 +26,22 @@
#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;
diff --git a/src/wx/kdm_timing_panel.cc b/src/wx/kdm_timing_panel.cc
index 51a99627c..2734a9894 100644
--- a/src/wx/kdm_timing_panel.cc
+++ b/src/wx/kdm_timing_panel.cc
@@ -22,8 +22,11 @@
#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;
diff --git a/src/wx/kdm_timing_panel.h b/src/wx/kdm_timing_panel.h
index a926864db..be2e9309b 100644
--- a/src/wx/kdm_timing_panel.h
+++ b/src/wx/kdm_timing_panel.h
@@ -18,7 +18,10 @@
*/
+#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>
diff --git a/src/wx/markers_dialog.h b/src/wx/markers_dialog.h
index fbbaa1aee..e2c261873 100644
--- a/src/wx/markers_dialog.h
+++ b/src/wx/markers_dialog.h
@@ -18,7 +18,10 @@
*/
+#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>
diff --git a/src/wx/message_dialog.h b/src/wx/message_dialog.h
index 0f625907c..8ef43cf9a 100644
--- a/src/wx/message_dialog.h
+++ b/src/wx/message_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class MessageDialog : public wxDialog
{
diff --git a/src/wx/nag_dialog.h b/src/wx/nag_dialog.h
index acf20f129..bc5ae6962 100644
--- a/src/wx/nag_dialog.h
+++ b/src/wx/nag_dialog.h
@@ -19,7 +19,10 @@
*/
#include "lib/config.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class NagDialog : public wxDialog
{
diff --git a/src/wx/name_format_editor.h b/src/wx/name_format_editor.h
index 2ae3f5e93..32c78ea25 100644
--- a/src/wx/name_format_editor.h
+++ b/src/wx/name_format_editor.h
@@ -22,8 +22,11 @@
#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>
diff --git a/src/wx/password_entry.h b/src/wx/password_entry.h
index b7cc93319..5939e5264 100644
--- a/src/wx/password_entry.h
+++ b/src/wx/password_entry.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
class CheckBox;
diff --git a/src/wx/player_information.h b/src/wx/player_information.h
index b93228174..ae3e13429 100644
--- a/src/wx/player_information.h
+++ b/src/wx/player_information.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/scoped_ptr.hpp>
#include <boost/weak_ptr.hpp>
diff --git a/src/wx/player_stress_tester.h b/src/wx/player_stress_tester.h
index 9da73762f..c8cc14676 100644
--- a/src/wx/player_stress_tester.h
+++ b/src/wx/player_stress_tester.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
#include <boost/filesystem.hpp>
diff --git a/src/wx/question_dialog.h b/src/wx/question_dialog.h
index a3b05173a..6b99065f6 100644
--- a/src/wx/question_dialog.h
+++ b/src/wx/question_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class QuestionDialog : public wxDialog
{
diff --git a/src/wx/recipient_dialog.cc b/src/wx/recipient_dialog.cc
index 94d5e3deb..f0bb54708 100644
--- a/src/wx/recipient_dialog.cc
+++ b/src/wx/recipient_dialog.cc
@@ -29,8 +29,11 @@
#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;
diff --git a/src/wx/recipients_panel.h b/src/wx/recipients_panel.h
index 15c043f1a..b33b7ebc8 100644
--- a/src/wx/recipients_panel.h
+++ b/src/wx/recipients_panel.h
@@ -19,9 +19,12 @@
*/
#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>
diff --git a/src/wx/repeat_dialog.h b/src/wx/repeat_dialog.h
index 0c4fb6a86..d3f1d32f8 100644
--- a/src/wx/repeat_dialog.h
+++ b/src/wx/repeat_dialog.h
@@ -18,8 +18,11 @@
*/
+#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
diff --git a/src/wx/report_problem_dialog.h b/src/wx/report_problem_dialog.h
index 9bd70a50e..651087907 100644
--- a/src/wx/report_problem_dialog.h
+++ b/src/wx/report_problem_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/dialog.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/shared_ptr.hpp>
class wxTextCtrl;
diff --git a/src/wx/rgba_colour_picker.cc b/src/wx/rgba_colour_picker.cc
index 6ea3571a1..731cf9539 100644
--- a/src/wx/rgba_colour_picker.cc
+++ b/src/wx/rgba_colour_picker.cc
@@ -21,7 +21,10 @@
#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)
diff --git a/src/wx/rgba_colour_picker.h b/src/wx/rgba_colour_picker.h
index c7972d4b3..30c81b103 100644
--- a/src/wx/rgba_colour_picker.h
+++ b/src/wx/rgba_colour_picker.h
@@ -19,7 +19,10 @@
*/
#include "lib/rgba.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class wxColourPickerCtrl;
class wxSlider;
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc
index 71d0ed99d..bc7065f29 100644
--- a/src/wx/screen_dialog.cc
+++ b/src/wx/screen_dialog.cc
@@ -27,10 +27,13 @@
#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;
diff --git a/src/wx/screens_panel.h b/src/wx/screens_panel.h
index 510297efb..9cf317c5a 100644
--- a/src/wx/screens_panel.h
+++ b/src/wx/screens_panel.h
@@ -18,7 +18,10 @@
*/
+#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>
diff --git a/src/wx/self_dkdm_dialog.cc b/src/wx/self_dkdm_dialog.cc
index 5eae05de4..4c10c8f6b 100644
--- a/src/wx/self_dkdm_dialog.cc
+++ b/src/wx/self_dkdm_dialog.cc
@@ -26,15 +26,20 @@
#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;
diff --git a/src/wx/self_dkdm_dialog.h b/src/wx/self_dkdm_dialog.h
index 509280b5c..f49749a69 100644
--- a/src/wx/self_dkdm_dialog.h
+++ b/src/wx/self_dkdm_dialog.h
@@ -19,8 +19,11 @@
*/
#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>
diff --git a/src/wx/servers_list_dialog.h b/src/wx/servers_list_dialog.h
index 309cde77e..dc261ff1c 100644
--- a/src/wx/servers_list_dialog.h
+++ b/src/wx/servers_list_dialog.h
@@ -19,8 +19,11 @@
*/
#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
diff --git a/src/wx/simple_video_view.h b/src/wx/simple_video_view.h
index 643c782b8..323047ada 100644
--- a/src/wx/simple_video_view.h
+++ b/src/wx/simple_video_view.h
@@ -20,8 +20,11 @@
#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;
diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc
index 76e8d8b16..6d905292e 100644
--- a/src/wx/subtitle_appearance_dialog.cc
+++ b/src/wx/subtitle_appearance_dialog.cc
@@ -29,10 +29,13 @@
#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;
diff --git a/src/wx/subtitle_appearance_dialog.h b/src/wx/subtitle_appearance_dialog.h
index 6c7e46817..b0dd8d307 100644
--- a/src/wx/subtitle_appearance_dialog.h
+++ b/src/wx/subtitle_appearance_dialog.h
@@ -20,7 +20,10 @@
#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>
diff --git a/src/wx/system_font_dialog.h b/src/wx/system_font_dialog.h
index 48a31a839..da51c9c3a 100644
--- a/src/wx/system_font_dialog.h
+++ b/src/wx/system_font_dialog.h
@@ -26,7 +26,10 @@
* 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>
diff --git a/src/wx/table_dialog.h b/src/wx/table_dialog.h
index a5015ee59..fdc2022c8 100644
--- a/src/wx/table_dialog.h
+++ b/src/wx/table_dialog.h
@@ -21,7 +21,10 @@
#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
{
diff --git a/src/wx/templates_dialog.h b/src/wx/templates_dialog.h
index 8ef0d956c..4a55e0beb 100644
--- a/src/wx/templates_dialog.h
+++ b/src/wx/templates_dialog.h
@@ -18,8 +18,11 @@
*/
+#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
diff --git a/src/wx/text_view.h b/src/wx/text_view.h
index 6ce22dc79..d360838a8 100644
--- a/src/wx/text_view.h
+++ b/src/wx/text_view.h
@@ -19,7 +19,10 @@
*/
#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>
diff --git a/src/wx/time_picker.h b/src/wx/time_picker.h
index 9e83c0043..53b0ce2b8 100644
--- a/src/wx/time_picker.h
+++ b/src/wx/time_picker.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
class wxSpinCtrl;
diff --git a/src/wx/timeline_content_view.h b/src/wx/timeline_content_view.h
index 27cfed53e..2573e3cb3 100644
--- a/src/wx/timeline_content_view.h
+++ b/src/wx/timeline_content_view.h
@@ -22,8 +22,11 @@
#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;
diff --git a/src/wx/try_unmount_dialog.h b/src/wx/try_unmount_dialog.h
index 9ae7de933..de686f14c 100644
--- a/src/wx/try_unmount_dialog.h
+++ b/src/wx/try_unmount_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class TryUnmountDialog : public wxDialog
{
diff --git a/src/wx/update_dialog.cc b/src/wx/update_dialog.cc
index e864564ac..373e518b1 100644
--- a/src/wx/update_dialog.cc
+++ b/src/wx/update_dialog.cc
@@ -21,7 +21,10 @@
#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;
diff --git a/src/wx/update_dialog.h b/src/wx/update_dialog.h
index 2db12ab64..096699f39 100644
--- a/src/wx/update_dialog.h
+++ b/src/wx/update_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/optional.hpp>
class UpdateDialog : public wxDialog
diff --git a/src/wx/verify_dcp_dialog.cc b/src/wx/verify_dcp_dialog.cc
index 42728614f..6432d21c7 100644
--- a/src/wx/verify_dcp_dialog.cc
+++ b/src/wx/verify_dcp_dialog.cc
@@ -21,8 +21,11 @@
#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;
diff --git a/src/wx/verify_dcp_dialog.h b/src/wx/verify_dcp_dialog.h
index d2f21863d..b67c1dfc7 100644
--- a/src/wx/verify_dcp_dialog.h
+++ b/src/wx/verify_dcp_dialog.h
@@ -19,7 +19,10 @@
*/
#include <dcp/verify.h>
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <list>
class wxRichTextCtrl;
diff --git a/src/wx/video_waveform_dialog.h b/src/wx/video_waveform_dialog.h
index ac3a72dde..252720f60 100644
--- a/src/wx/video_waveform_dialog.h
+++ b/src/wx/video_waveform_dialog.h
@@ -18,7 +18,10 @@
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/weak_ptr.hpp>
class VideoWaveformPlot;
diff --git a/src/wx/video_waveform_plot.h b/src/wx/video_waveform_plot.h
index 380186074..1e38f5890 100644
--- a/src/wx/video_waveform_plot.h
+++ b/src/wx/video_waveform_plot.h
@@ -18,7 +18,10 @@
*/
+#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>
diff --git a/src/wx/wx_signal_manager.cc b/src/wx/wx_signal_manager.cc
index 95e71cbc0..78a98b1d6 100644
--- a/src/wx/wx_signal_manager.cc
+++ b/src/wx/wx_signal_manager.cc
@@ -18,8 +18,11 @@
*/
-#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)
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index f8756549b..46b122a8a 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -31,11 +31,14 @@
#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;
diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h
index af938b670..294c661a8 100644
--- a/src/wx/wx_util.h
+++ b/src/wx/wx_util.h
@@ -26,7 +26,10 @@
#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>