From ce624e59b9dee93195d2582f7264ab398ed0d99b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 02:22:49 +0200 Subject: int64_t -> Frame --- src/lib/analyse_audio_job.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') 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; -- cgit v1.2.3 From 2bec3708fc744c18128c5bdb4c2a332f5c8eb283 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 02:26:17 +0200 Subject: Ignore libxml++ warnings in a nicer way. --- src/lib/analytics.cc | 3 +++ src/lib/atmos_content.cc | 3 +++ src/lib/audio_analysis.cc | 3 +++ src/lib/audio_mapping.cc | 7 +++++-- src/lib/audio_point.cc | 3 +++ src/lib/colour_conversion.cc | 3 +++ src/lib/cross_common.cc | 3 +++ src/lib/dcp_text_track.h | 3 +++ src/lib/dcp_video.cc | 3 +++ src/lib/dkdm_wrapper.cc | 3 +++ src/lib/edid.cc | 3 +++ src/lib/encode_server.cc | 3 +++ src/lib/ffmpeg_audio_stream.cc | 3 +++ src/lib/ffmpeg_image_proxy.cc | 3 +++ src/lib/ffmpeg_stream.cc | 3 +++ src/lib/ffmpeg_subtitle_stream.cc | 3 +++ src/lib/font.cc | 3 +++ src/lib/isdcf_metadata.cc | 3 +++ src/lib/j2k_image_proxy.cc | 3 +++ src/lib/kdm_recipient.h | 3 +++ src/lib/raw_image_proxy.cc | 3 +++ src/lib/rgba.cc | 3 +++ src/lib/spl.cc | 5 ++++- src/lib/spl_entry.cc | 3 +++ src/lib/subtitle_analysis.cc | 3 +++ src/lib/types.cc | 3 +++ test/stream_test.cc | 11 +++++++---- 27 files changed, 88 insertions(+), 7 deletions(-) (limited to 'src/lib') 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 #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +DCPOMATIC_DISABLE_WARNINGS #include +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 +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS using std::string; using dcp::raw_convert; 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 #include #include @@ -29,7 +30,9 @@ #include #include #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include 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 #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include "i18n.h" 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 +DCPOMATIC_DISABLE_WARNINGS #include +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 #include #include #include #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include #include diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc index c242cb216..61e0b09c5 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 #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 +#include "warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include using std::string; diff --git a/src/lib/ffmpeg_image_proxy.cc b/src/lib/ffmpeg_image_proxy.cc index db6059266..b54e29d44 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 extern "C" { #include #include } +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include "i18n.h" 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 +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS extern "C" { #include } 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 +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include 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 #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include "i18n.h" 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 #include #include @@ -30,7 +31,9 @@ #include #include #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include "i18n.h" 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 #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include 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 #include #include extern "C" { #include } +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include "i18n.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 +DCPOMATIC_ENABLE_WARNINGS #include using std::string; 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 #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +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 #include +DCPOMATIC_DISABLE_WARNINGS #include +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 #include #include #include #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include diff --git a/test/stream_test.cc b/test/stream_test.cc index 1e1462464..b4b7c260b 100644 --- a/test/stream_test.cc +++ b/test/stream_test.cc @@ -22,12 +22,15 @@ * @brief Some simple tests of FFmpegAudioStream. */ -#include -#include -#include +#include "lib/film.h" #include "lib/ffmpeg_content.h" #include "lib/ffmpeg_audio_stream.h" -#include "lib/film.h" +#include "lib/warnings.h" +#include +DCPOMATIC_DISABLE_WARNINGS +#include +DCPOMATIC_ENABLE_WARNINGS +#include using std::pair; using std::list; -- cgit v1.2.3 From bc2dcbef02911c35a5ce3680c12641966d93bd49 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 02:26:42 +0200 Subject: Fix off-by-one in ASSERT and make it more comprehensive. --- src/lib/cinema_sound_processor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') 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]; } -- cgit v1.2.3 From 35409488fd54aacefa6858dce4b02a576170e76e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 02:27:12 +0200 Subject: Ignore FFmpeg warnings in a nicer way. --- src/lib/ffmpeg.cc | 8 ++++++++ src/lib/ffmpeg.h | 3 +++ src/lib/ffmpeg_decoder.cc | 10 ++++++++++ src/lib/ffmpeg_examiner.cc | 28 ++++++++++++++++++++++------ src/lib/ffmpeg_file_encoder.cc | 10 ++++++++++ src/lib/ffmpeg_image_proxy.cc | 5 ++++- src/lib/util.cc | 3 +++ src/lib/video_filter_graph.cc | 7 +++++-- 8 files changed, 65 insertions(+), 9 deletions(-) (limited to 'src/lib') 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 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 } +DCPOMATIC_ENABLE_WARNINGS #include #include 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 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 stream) const AVSampleFormat FFmpegDecoder::audio_sample_format (shared_ptr 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 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 #include @@ -26,12 +34,7 @@ extern "C" { #include #include } -#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 #include @@ -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 c, shared_ptr job) : FFmpeg (c) @@ -54,6 +58,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptrnb_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 c, shared_ptrstreams[_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 c, shared_ptr= 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 stream) { @@ -205,17 +215,22 @@ FFmpegExaminer::audio_packet (AVCodecContext* context, shared_ptr= 0 && frame_finished) { +DCPOMATIC_ENABLE_WARNINGS stream->first_audio = frame_time (stream->stream (_format_context)); } } + optional FFmpegExaminer::frame_time (AVStream* s) const { optional 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 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 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 b54e29d44..f2b72059b 100644 --- a/src/lib/ffmpeg_image_proxy.cc +++ b/src/lib/ffmpeg_image_proxy.cc @@ -86,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(amount), static_cast(_data.size()) - _pos); if (to_do == 0) { return AVERROR_EOF; } @@ -115,6 +115,7 @@ FFmpegImageProxy::avio_seek (int64_t const pos, int whence) return _pos; } +DCPOMATIC_DISABLE_WARNINGS ImageProxy::Result FFmpegImageProxy::image (optional) const @@ -199,6 +200,8 @@ FFmpegImageProxy::image (optional) const return Result (_image, 0); } +DCPOMATIC_ENABLE_WARNINGS + void FFmpegImageProxy::add_metadata (xmlpp::Node* node) const { diff --git a/src/lib/util.cc b/src/lib/util.cc index 74951fc64..91a8ecb6e 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 #include #include @@ -356,8 +357,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 #include @@ -51,6 +52,7 @@ VideoFilterGraph::process (AVFrame* frame) { list, int64_t> > images; +DCPOMATIC_DISABLE_WARNINGS if (_copy) { images.push_back (make_pair (shared_ptr (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; } -- cgit v1.2.3 From dffad8ef7d9d94c42be01dc467202575ad877be4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 02:28:05 +0200 Subject: Ignore libssh warnings in a nicer way. --- src/lib/scp_uploader.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib') 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 #include "i18n.h" @@ -51,10 +52,12 @@ SCPUploader::SCPUploader (function set_status, functiontms_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) { -- cgit v1.2.3 From 7399b5483c5b69559bbfcee27bfd415a967add85 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 02:29:24 +0200 Subject: Rationalise compiler warning setup. --- cscript | 2 +- src/lib/warnings.h | 26 ++++++++++++++++++++++++++ wscript | 14 ++++++++------ 3 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 src/lib/warnings.h (limited to 'src/lib') diff --git a/cscript b/cscript index 052aa6c7c..7f262bf81 100644 --- 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 diff --git a/src/lib/warnings.h b/src/lib/warnings.h new file mode 100644 index 000000000..e225c0339 --- /dev/null +++ b/src/lib/warnings.h @@ -0,0 +1,26 @@ +/* + Copyright (C) 2020 Carl Hetherington + + 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 . + +*/ + +#define DCPOMATIC_DISABLE_WARNINGS \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") + +#define DCPOMATIC_ENABLE_WARNINGS \ + _Pragma("GCC diagnostic pop") diff --git a/wscript b/wscript index 72db83e2c..4fba8fb57 100644 --- 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,16 +107,17 @@ 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-cast-function-type', '-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: @@ -325,7 +327,7 @@ def configure(conf): conf.check_cc(fragment=""" #include \n int main () {\n - ssh_session s = ssh_new ();\n + ssh_new ();\n return 0;\n } """, @@ -550,7 +552,7 @@ def configure(conf): deps.append('boost_filesystem%s' % boost_lib_suffix) conf.check_cxx(fragment=""" #include \n - int main() { boost::process::child* c = new boost::process::child("foo"); }\n + int main() { new boost::process::child("foo"); }\n """, msg='Checking for boost process library', lib=deps, -- cgit v1.2.3 From 0d711edad0694ee5f5c735b221d52387499e2d36 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 19:54:34 +0200 Subject: Disable warnings from magick. --- src/lib/warnings.h | 3 ++- test/test.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/warnings.h b/src/lib/warnings.h index e225c0339..bfb666e1b 100644 --- a/src/lib/warnings.h +++ b/src/lib/warnings.h @@ -20,7 +20,8 @@ #define DCPOMATIC_DISABLE_WARNINGS \ _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ + _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") #define DCPOMATIC_ENABLE_WARNINGS \ _Pragma("GCC diagnostic pop") diff --git a/test/test.h b/test/test.h index 77108af46..b620a68a0 100644 --- a/test/test.h +++ b/test/test.h @@ -18,7 +18,10 @@ */ +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include -- cgit v1.2.3 From 6eba051dcbb8c56e3e2efea946ce0380d17a7b33 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 21:29:43 +0200 Subject: Various OSX warnings fixes. --- src/lib/cross.h | 5 +++-- src/lib/cross_osx.cc | 18 ++++++++++++++---- src/lib/encode_server.cc | 4 +++- src/lib/j2k_encoder.cc | 6 +++++- src/lib/json_server.cc | 4 +++- src/lib/render_text.cc | 3 +++ src/lib/util.cc | 2 ++ src/lib/wscript | 2 +- src/tools/dcpomatic.cc | 10 +++------- src/tools/dcpomatic_disk.cc | 7 ++----- src/tools/dcpomatic_disk_writer.cc | 4 ++++ src/tools/dcpomatic_kdm.cc | 6 ++---- src/tools/dcpomatic_player.cc | 9 ++------- src/tools/dcpomatic_playlist.cc | 9 ++------- src/wx/gl_video_view.cc | 2 ++ wscript | 4 ++-- 16 files changed, 53 insertions(+), 42 deletions(-) (limited to 'src/lib') 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 > 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_osx.cc b/src/lib/cross_osx.cc index 574cc8660..aa05df016 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 #include extern "C" { @@ -35,6 +36,7 @@ extern "C" { #if BOOST_VERSION >= 106100 #include #endif +#include #include #include #include @@ -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 () @@ -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/encode_server.cc b/src/lib/encode_server.cc index 61e0b09c5..c30fc8f30 100644 --- a/src/lib/encode_server.cc +++ b/src/lib/encode_server.cc @@ -239,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/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())); #ifdef DCPOMATIC_LINUX + boost::thread* t = _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional())); pthread_setname_np (t->native_handle(), "encode-worker"); #endif +#ifdef DCPOMATIC_OSX + _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional())); +#endif #ifdef DCPOMATIC_WINDOWS + boost::thread* t = _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional())); if (windows_xp) { SetThreadAffinityMask (t->native_handle(), 1 << i); } 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/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 #include #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #ifndef DCPOMATIC_HAVE_SHOW_IN_CAIRO_CONTEXT #include diff --git a/src/lib/util.cc b/src/lib/util.cc index 91a8ecb6e..b6ca34d22 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -66,7 +66,9 @@ extern "C" { #include #include #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #ifdef DCPOMATIC_WINDOWS #include #include 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..75b4025aa 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -98,9 +98,6 @@ #ifdef __WXMSW__ #include #endif -#ifdef __WXOSX__ -#include -#endif #include #include #include @@ -1548,10 +1545,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..55f2bd440 100644 --- a/src/tools/dcpomatic_disk.cc +++ b/src/tools/dcpomatic_disk.cc @@ -41,7 +41,6 @@ #include #endif #ifdef DCPOMATIC_OSX -#include #include #endif @@ -317,10 +316,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 66d38ec19..1e6d10fbf 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 #include @@ -66,7 +67,10 @@ extern "C" { } #endif +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS + #include #include #include diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index 117e756c7..84573797e 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -718,10 +718,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 #endif -#ifdef __WXOSX__ -#include -#endif #include #include #include @@ -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 #include #include -#ifdef __WXOSX__ -#include -#endif #include 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/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 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/wscript b/wscript index b0faa8483..b1e2096d4 100644 --- a/wscript +++ b/wscript @@ -322,7 +322,7 @@ def configure(conf): if conf.options.workaround_gssapi: conf.env.LIB_SSH = ['gssapi_krb5'] else: - conf.check_cc(fragment=""" + conf.check_cxx(fragment=""" #include \n int main () {\n ssh_new ();\n @@ -501,7 +501,7 @@ def configure(conf): conf.check_cxx(fragment=""" #include \n - int main() { boost::thread t (); }\n + int main() { boost::thread t; }\n """, msg='Checking for boost threading library', libpath='/usr/local/lib', -- cgit v1.2.3 From 69da43180e638518ed47424f2eba20cd25f2e093 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 22:47:51 +0200 Subject: Fix some ignored return values. --- src/lib/cross_linux.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc index 25fd3490e..28b8a4b41 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 > @@ -378,7 +381,10 @@ unprivileged () cerr << "getresuid() failed.\n"; exit (EXIT_FAILURE); } - seteuid (ruid); + if (seteuid(ruid) == -1) { + cerr << "seteuid() failed.\n"; + exit (EXIT_FAILURE); + } } PrivilegeEscalator::~PrivilegeEscalator () -- cgit v1.2.3 From 16d50c8309bad5547bd07a3a6e78b404d490d93d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 23:08:01 +0200 Subject: Better error handling with Linux privilege escalator. --- src/lib/cross_linux.cc | 7 ++++--- src/lib/exceptions.h | 10 ++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc index 28b8a4b41..e17f188b9 100644 --- a/src/lib/cross_linux.cc +++ b/src/lib/cross_linux.cc @@ -379,11 +379,9 @@ unprivileged () uid_t ruid, euid, suid; if (getresuid(&ruid, &euid, &suid) == -1) { cerr << "getresuid() failed.\n"; - exit (EXIT_FAILURE); } if (seteuid(ruid) == -1) { cerr << "seteuid() failed.\n"; - exit (EXIT_FAILURE); } } @@ -394,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/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 -- cgit v1.2.3 From 7555175e605aab5567020ce48b00bfa6f4d2b726 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jul 2020 23:52:23 +0200 Subject: Hide some windows warnings. --- src/lib/util.cc | 2 ++ src/lib/warnings.h | 1 + 2 files changed, 3 insertions(+) (limited to 'src/lib') diff --git a/src/lib/util.cc b/src/lib/util.cc index b6ca34d22..7ba9242fa 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -233,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/ @@ -289,6 +290,7 @@ exception_handler(struct _EXCEPTION_POINTERS * info) return EXCEPTION_CONTINUE_SEARCH; } +DCPOMATIC_ENABLE_WARNINGS #endif void diff --git a/src/lib/warnings.h b/src/lib/warnings.h index bfb666e1b..4414755f5 100644 --- a/src/lib/warnings.h +++ b/src/lib/warnings.h @@ -21,6 +21,7 @@ #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\"") #define DCPOMATIC_ENABLE_WARNINGS \ -- cgit v1.2.3 From c622a06189181a3a6ad356094c9a3cf4e1f5a722 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 27 Jul 2020 01:35:57 +0200 Subject: Hide warnings triggered by Ubuntu 20.04's gcc. --- src/lib/warnings.h | 1 + src/tools/dcpomatic.cc | 3 +++ src/tools/dcpomatic_kdm.cc | 3 +++ src/tools/dcpomatic_server.cc | 3 +++ src/wx/about_dialog.cc | 3 +++ src/wx/about_dialog.h | 3 +++ src/wx/audio_dialog.h | 3 +++ src/wx/audio_mapping_view.cc | 3 +++ src/wx/audio_mapping_view.h | 7 +++++-- src/wx/audio_plot.h | 3 +++ src/wx/closed_captions_dialog.h | 3 +++ src/wx/config_dialog.h | 3 +++ src/wx/content_advanced_dialog.h | 3 +++ src/wx/content_sub_panel.h | 7 +++++-- src/wx/content_view.h | 3 +++ src/wx/controls.h | 3 +++ src/wx/custom_scale_dialog.cc | 3 +++ src/wx/custom_scale_dialog.h | 3 +++ src/wx/dir_picker_ctrl.cc | 3 +++ src/wx/disk_warning_dialog.h | 3 +++ src/wx/dkdm_output_panel.cc | 3 +++ src/wx/download_certificate_dialog.h | 3 +++ src/wx/export_dialog.cc | 3 +++ src/wx/file_picker_ctrl.cc | 3 +++ src/wx/film_editor.h | 3 +++ src/wx/film_name_location_dialog.h | 7 +++++-- src/wx/film_viewer.h | 3 +++ src/wx/filter_dialog.h | 3 +++ src/wx/focus_manager.cc | 3 +++ src/wx/fonts_dialog.h | 3 +++ src/wx/gl_video_view.h | 5 ++++- src/wx/hints_dialog.cc | 3 +++ src/wx/hints_dialog.h | 3 +++ src/wx/html_dialog.cc | 3 +++ src/wx/html_dialog.h | 3 +++ src/wx/initial_setup_dialog.h | 3 +++ src/wx/instant_i18n_dialog.h | 3 +++ src/wx/job_manager_view.h | 3 +++ src/wx/kdm_cpl_panel.h | 3 +++ src/wx/kdm_output_panel.cc | 11 ++++++++--- src/wx/kdm_timing_panel.cc | 3 +++ src/wx/kdm_timing_panel.h | 3 +++ src/wx/markers_dialog.h | 3 +++ src/wx/nag_dialog.h | 3 +++ src/wx/name_format_editor.h | 3 +++ src/wx/password_entry.h | 3 +++ src/wx/player_information.h | 3 +++ src/wx/player_stress_tester.h | 3 +++ src/wx/question_dialog.h | 3 +++ src/wx/recipient_dialog.cc | 3 +++ src/wx/recipients_panel.h | 3 +++ src/wx/repeat_dialog.h | 3 +++ src/wx/report_problem_dialog.h | 3 +++ src/wx/rgba_colour_picker.cc | 3 +++ src/wx/rgba_colour_picker.h | 3 +++ src/wx/screen_dialog.cc | 3 +++ src/wx/screens_panel.h | 3 +++ src/wx/self_dkdm_dialog.cc | 5 +++++ src/wx/self_dkdm_dialog.h | 3 +++ src/wx/servers_list_dialog.h | 3 +++ src/wx/simple_video_view.h | 3 +++ src/wx/subtitle_appearance_dialog.cc | 3 +++ src/wx/subtitle_appearance_dialog.h | 3 +++ src/wx/system_font_dialog.h | 3 +++ src/wx/templates_dialog.h | 3 +++ src/wx/text_view.h | 3 +++ src/wx/time_picker.h | 3 +++ src/wx/timeline_content_view.h | 3 +++ src/wx/try_unmount_dialog.h | 3 +++ src/wx/update_dialog.cc | 3 +++ src/wx/update_dialog.h | 3 +++ src/wx/verify_dcp_dialog.cc | 3 +++ src/wx/verify_dcp_dialog.h | 3 +++ src/wx/video_waveform_dialog.h | 3 +++ src/wx/video_waveform_plot.h | 3 +++ src/wx/wx_signal_manager.cc | 5 ++++- src/wx/wx_util.cc | 3 +++ 77 files changed, 244 insertions(+), 11 deletions(-) (limited to 'src/lib') diff --git a/src/lib/warnings.h b/src/lib/warnings.h index 4414755f5..f55f657bf 100644 --- a/src/lib/warnings.h +++ b/src/lib/warnings.h @@ -22,6 +22,7 @@ _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\"") #define DCPOMATIC_ENABLE_WARNINGS \ diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 75b4025aa..3680e2802 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -84,14 +84,17 @@ #include "lib/text_content.h" #include "lib/dcpomatic_log.h" #include "lib/subtitle_encoder.h" +#include "lib/warnings.h" #include #include +DCPOMATIC_DISABLE_WARNINGS #include #include #include #include #include #include +DCPOMATIC_ENABLE_WARNINGS #ifdef __WXGTK__ #include #endif diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index 84573797e..1d623abcd 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -51,10 +51,13 @@ #include #include #include +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include #include #include #include +DCPOMATIC_ENABLE_WARNINGS #ifdef __WXOSX__ #include #endif 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 #include #include +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 #include +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 +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 +DCPOMATIC_ENABLE_WARNINGS #include #include 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 #include +DCPOMATIC_DISABLE_WARNINGS #include #include #include #include +DCPOMATIC_ENABLE_WARNINGS #include #include 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 -#include #include "lib/audio_mapping.h" +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS +#include +DCPOMATIC_ENABLE_WARNINGS +#include /** @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 +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 +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 #include #include +DCPOMATIC_DISABLE_WARNINGS #include #include #include #include +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include 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 -#include #include "lib/film.h" #include "lib/config.h" +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS +#include +DCPOMATIC_ENABLE_WARNINGS +#include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include #include #include +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 +DCPOMATIC_DISABLE_WARNINGS #include #include +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 #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include using namespace std; 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 +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 +DCPOMATIC_ENABLE_WARNINGS #endif #include 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 +DCPOMATIC_DISABLE_WARNINGS #include #include +DCPOMATIC_ENABLE_WARNINGS class DownloadCertificatePanel; 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 +DCPOMATIC_ENABLE_WARNINGS #include 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 #include #include +DCPOMATIC_ENABLE_WARNINGS #include using namespace std; 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 +DCPOMATIC_ENABLE_WARNINGS #include 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 -#include #include "wx_util.h" #include "table_dialog.h" +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS +#include +#include +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 +DCPOMATIC_DISABLE_WARNINGS #include +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 +DCPOMATIC_ENABLE_WARNINGS #include 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 +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 #include +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include +#include +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +DCPOMATIC_DISABLE_WARNINGS #include #include +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_ENABLE_WARNINGS class wxHtmlLinkEvent; 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 +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 +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 +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +DCPOMATIC_DISABLE_WARNINGS #include +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 #include #ifdef DCPOMATIC_USE_OWN_PICKER #include "dir_picker_ctrl.h" #else +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #endif +DCPOMATIC_DISABLE_WARNINGS #include +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 #include +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 +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 +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 +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +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 #include +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include #include +DCPOMATIC_ENABLE_WARNINGS #include 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 #include #include +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 #include +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 +DCPOMATIC_ENABLE_WARNINGS #include 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 +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 +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 #include +DCPOMATIC_DISABLE_WARNINGS #include #include +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 #ifdef DCPOMATIC_USE_OWN_PICKER #include "dir_picker_ctrl.h" #else +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #endif +DCPOMATIC_DISABLE_WARNINGS #include #include #include +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 #include +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_DISABLE_WARNINGS #include +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 #include #include #include +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 +DCPOMATIC_ENABLE_WARNINGS #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 #include +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_ENABLE_WARNINGS #include 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 +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 +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 +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include 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 +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_ENABLE_WARNINGS #include 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 +DCPOMATIC_ENABLE_WARNINGS #include #include #include 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 #include "wx_signal_manager.h" +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS +#include +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 +DCPOMATIC_DISABLE_WARNINGS #include #include #include #include +DCPOMATIC_ENABLE_WARNINGS #include using std::string; -- cgit v1.2.3 From 6bb766d3875ee7972c566a5a88585dad06cd7fd6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 27 Jul 2020 10:24:50 +0200 Subject: Don't try to hide Wdeprecated-copy when it doesn't exist. --- src/lib/warnings.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/lib') diff --git a/src/lib/warnings.h b/src/lib/warnings.h index f55f657bf..d182526ff 100644 --- a/src/lib/warnings.h +++ b/src/lib/warnings.h @@ -18,12 +18,20 @@ */ +#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") -- cgit v1.2.3 From 99c1d1f247343b884af0b51389311484ed265d3b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 27 Jul 2020 11:05:08 +0200 Subject: Fix some unused variable warnings on macOS. --- src/lib/cross_osx.cc | 4 ++-- src/tools/dcpomatic_disk.cc | 3 +++ src/tools/dcpomatic_disk_writer.cc | 2 +- wscript | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index aa05df016..e91d3df16 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -245,7 +245,7 @@ home_directory () } string -command_and_read (string cmd) +command_and_read (string) { return ""; } @@ -515,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 (context); diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc index 55f2bd440..b94d4bf94 100644 --- a/src/tools/dcpomatic_disk.cc +++ b/src/tools/dcpomatic_disk.cc @@ -35,8 +35,11 @@ #include "lib/job_manager.h" #include "lib/disk_writer_messages.h" #include "lib/version.h" +#include "lib/warnings.h" #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #ifdef DCPOMATIC_WINDOWS #include #endif diff --git a/src/tools/dcpomatic_disk_writer.cc b/src/tools/dcpomatic_disk_writer.cc index 1e6d10fbf..2c3753e57 100644 --- a/src/tools/dcpomatic_disk_writer.cc +++ b/src/tools/dcpomatic_disk_writer.cc @@ -569,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/wscript b/wscript index b9e7d6a64..a333f95d8 100644 --- a/wscript +++ b/wscript @@ -549,6 +549,7 @@ def configure(conf): #include \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') -- cgit v1.2.3