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
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;
#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>
#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;
#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>
*/
#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>
*/
#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;
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];
}
#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>
#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>
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
#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"
{
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> >
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 ()
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
#include "dcpomatic_log.h"
#include "config.h"
#include "exceptions.h"
+#include "warnings.h"
#include <dcp/raw_convert.h>
#include <glib.h>
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>
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 ()
}
string
-command_and_read (string cmd)
+command_and_read (string)
{
return "";
}
}
-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);
}
+
+void
+make_foreground_application ()
+{
+ ProcessSerialNumber serial;
+DCPOMATIC_DISABLE_WARNINGS
+ GetCurrentProcess (&serial);
+DCPOMATIC_ENABLE_WARNINGS
+ TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+}
+
#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
{
#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>
#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;
#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>
#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>
}
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
}
std::string _message;
int _number;
};
+
+
+class PrivilegeError : public std::runtime_error
+{
+public:
+ explicit PrivilegeError (std::string s)
+ : std::runtime_error (s)
+ {}
+};
+
#endif
{
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);
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)) {
}
}
}
+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.
{
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;
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
{
return _ffmpeg_content->subtitle_stream()->stream(_format_context)->codec;
}
+DCPOMATIC_ENABLE_WARNINGS
int
FFmpeg::avio_read (uint8_t* buffer, int const amount)
#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>
#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;
{
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? */
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
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 ());
return;
}
+DCPOMATIC_DISABLE_WARNINGS
while (copy_packet.size > 0) {
int frame_finished;
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) {
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);
*/
+#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>
#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>
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)
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,
}
AVCodecContext* context = _format_context->streams[_packet.stream_index]->codec;
+DCPOMATIC_ENABLE_WARNINGS
if (_video_stream && _packet.stream_index == _video_stream.get()) {
video_packet (context);
#endif
}
+
void
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()]);
}
}
}
+
void
FFmpegExaminer::audio_packet (AVCodecContext* context, shared_ptr<FFmpegAudioStream> stream)
{
}
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));
}
return t;
}
+
optional<double>
FFmpegExaminer::video_frame_rate () const
{
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");
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);
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);
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;
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;
#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"
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;
}
return _pos;
}
+DCPOMATIC_DISABLE_WARNINGS
ImageProxy::Result
FFmpegImageProxy::image (optional<dcp::Size>) const
return Result (_image, 0);
}
+DCPOMATIC_ENABLE_WARNINGS
+
void
FFmpegImageProxy::add_metadata (xmlpp::Node* node) const
{
#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>
}
*/
#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>
#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;
*/
#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"
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);
}
#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>
#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"
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
}
#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>
#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"
#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>
*/
#include "rgba.h"
+#include "warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/lexical_cast.hpp>
using std::string;
#include "config.h"
#include "cross.h"
#include "compose.hpp"
+#include "warnings.h"
#include <sys/stat.h>
#include "i18n.h"
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) {
*/
-#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>
#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;
#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;
#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>
#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>
#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>
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/
return EXCEPTION_CONTINUE_SEARCH;
}
+DCPOMATIC_ENABLE_WARNINGS
#endif
void
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
*/
-#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>
{
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 {
av_frame_unref (_frame);
}
}
+DCPOMATIC_ENABLE_WARNINGS
return images;
}
--- /dev/null
+/*
+ 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")
"""
if bld.env.TARGET_OSX:
- obj.framework = ['IOKit', 'Foundation', 'DiskArbitration']
+ obj.framework = ['IOKit', 'Foundation', 'DiskArbitration', 'ApplicationServices']
obj.source = sources + ' version.cc'
#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>
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 ();
#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
unsetenv ("UBUNTU_MENUPROXY");
#endif
-#ifdef __WXOSX__
- ProcessSerialNumber serial;
- GetCurrentProcess (&serial);
- TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+ make_foreground_application ();
#endif
dcpomatic_setup_path_encoding ();
#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>
}
#endif
+DCPOMATIC_DISABLE_WARNINGS
#include <glibmm.h>
+DCPOMATIC_ENABLE_WARNINGS
+
#include <unistd.h>
#include <sys/types.h>
#include <boost/filesystem.hpp>
#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;
/* 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 {
#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
unsetenv ("UBUNTU_MENUPROXY");
#endif
-#ifdef __WXOSX__
- ProcessSerialNumber serial;
- GetCurrentProcess (&serial);
- TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+ make_foreground_application ();
#endif
dcpomatic_setup_path_encoding ();
#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>
unsetenv ("UBUNTU_MENUPROXY");
#endif
-#ifdef __WXOSX__
- ProcessSerialNumber serial;
- GetCurrentProcess (&serial);
- TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+ make_foreground_application ();
#endif
dcpomatic_setup_path_encoding ();
#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;
unsetenv ("UBUNTU_MENUPROXY");
#endif
-#ifdef __WXOSX__
- ProcessSerialNumber serial;
- GetCurrentProcess (&serial);
- TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+ make_foreground_application ();
#endif
dcpomatic_setup_path_encoding ();
#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>
#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;
* @brief The "about DCP-o-matic" dialogue box.
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class wxNotebook;
#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>
#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>
*
*/
-#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,
#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>
#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;
#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>
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/shared_ptr.hpp>
#include <vector>
#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;
*/
#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>
#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>
#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;
*/
+#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
#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;
#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
{
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class DiskWarningDialog : public wxDialog
{
#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"
#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>
*/
+#include "lib/warnings.h"
#include <dcp/certificate.h>
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
#include <wx/notebook.h>
+DCPOMATIC_ENABLE_WARNINGS
class DownloadCertificatePanel;
#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;
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class DriveWipeWarningDialog : public wxDialog
{
#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;
#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;
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class FilePickerCtrl : public wxPanel
{
*/
#include "lib/film.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
class wxNotebook;
*/
-#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;
#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;
* @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;
*/
#include "focus_manager.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/textctrl.h>
+DCPOMATIC_ENABLE_WARNINGS
FocusManager* FocusManager::_instance;
*/
+#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>
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 ();
#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>
#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;
*/
#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>
#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)
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class wxHtmlLinkEvent;
#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
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class InitialSetupDialog : public wxDialog
{
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class InstantI18NDialog : public wxDialog
{
* @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>
*/
#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
{
*/
-#include "lib/config.h"
-#include "lib/cinema.h"
-#include "lib/send_kdm_email_job.h"
#include "kdm_output_panel.h"
#include "kdm_timing_panel.h"
#include "confirm_kdm_email_dialog.h"
#include "name_format_editor.h"
#include "check_box.h"
#include "dcpomatic_button.h"
+#include "lib/config.h"
+#include "lib/cinema.h"
+#include "lib/send_kdm_email_job.h"
+#include "lib/warnings.h"
#include <dcp/exceptions.h>
#include <dcp/types.h>
#ifdef DCPOMATIC_USE_OWN_PICKER
#include "dir_picker_ctrl.h"
#else
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/filepicker.h>
+DCPOMATIC_ENABLE_WARNINGS
#endif
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/stdpaths.h>
+DCPOMATIC_ENABLE_WARNINGS
using std::pair;
using std::string;
#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;
*/
+#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>
*/
+#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>
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class MessageDialog : public wxDialog
{
*/
#include "lib/config.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class NagDialog : public wxDialog
{
#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>
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
class CheckBox;
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/scoped_ptr.hpp>
#include <boost/weak_ptr.hpp>
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
#include <boost/filesystem.hpp>
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class QuestionDialog : public wxDialog
{
#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;
*/
#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>
*/
+#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
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/dialog.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/shared_ptr.hpp>
class wxTextCtrl;
#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)
*/
#include "lib/rgba.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class wxColourPickerCtrl;
class wxSlider;
#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;
*/
+#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>
#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;
*/
#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>
*/
#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
#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;
#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;
#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>
* 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>
#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
{
*/
+#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
*/
#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>
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
class wxSpinCtrl;
#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;
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
class TryUnmountDialog : public wxDialog
{
#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;
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/optional.hpp>
class UpdateDialog : public wxDialog
#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;
*/
#include <dcp/verify.h>
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <list>
class wxRichTextCtrl;
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/weak_ptr.hpp>
class VideoWaveformPlot;
*/
+#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>
*/
-#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)
#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;
#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>
name += "prores";
extension = "mov";
break;
+ case EXPORT_FORMAT_H264_PCM:
+ case EXPORT_FORMAT_SUBTITLES_DCP:
+ BOOST_REQUIRE (false);
}
name = String::compose("%1_test%2", name, number);
* @brief Some simple tests of FFmpegAudioStream.
*/
-#include <boost/test/unit_test.hpp>
-#include <libxml++/libxml++.h>
-#include <libcxml/cxml.h>
+#include "lib/film.h"
#include "lib/ffmpeg_content.h"
#include "lib/ffmpeg_audio_stream.h"
-#include "lib/film.h"
+#include "lib/warnings.h"
+#include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
+#include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
+#include <boost/test/unit_test.hpp>
using std::pair;
using std::list;
*/
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <Magick++.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
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')
'-Wall',
'-Wextra',
'-Wwrite-strings',
- '-Wsign-conversion',
- # Remove auto_ptr warnings from libxml++-2.6
- '-Wno-deprecated-declarations',
+ # I tried and failed to ignore these with _Pragma
'-Wno-ignored-qualifiers',
- '-Wno-parentheses',
'-D_FILE_OFFSET_BITS=64'])
if conf.options.force_cpp11:
conf.env.append_value('CXXFLAGS', ['-std=c++11', '-DBOOST_NO_CXX11_SCOPED_ENUMS'])
+ if conf.options.warnings_are_errors:
+ conf.env.append_value('CXXFLAGS', '-Werror')
+
if conf.env['CXX_NAME'] == 'gcc':
gcc = conf.env['CC_VERSION']
- if int(gcc[0]) >= 4 and int(gcc[1]) > 1:
- conf.env.append_value('CXXFLAGS', ['-Wno-unused-result'])
- if int(gcc[0]) >= 9:
- conf.env.append_value('CXXFLAGS', ['-Wno-deprecated-copy'])
+ if int(gcc[0]) >= 8:
+ # I tried and failed to ignore these with _Pragma
+ conf.env.append_value('CXXFLAGS', ['-Wno-cast-function-type'])
+ elif int(gcc[0]) == 7:
+ # There appears to be a GCC bug which lingered from major versions 5--7 and which
+ # flags up these warnings all over the place in boost::optional.
+ # These seems to be the only practical way to hide it
+ conf.env.append_value('CXXFLAGS', ['-Wno-maybe-uninitialized'])
have_c11 = int(gcc[0]) >= 4 and int(gcc[1]) >= 8 and int(gcc[2]) >= 1
else:
have_c11 = False
# OSX
if conf.env.TARGET_OSX:
- conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_OSX', '-Wno-unused-function', '-Wno-unused-parameter', '-Wno-unused-local-typedef', '-Wno-potentially-evaluated-expression'])
+ conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_OSX'])
conf.env.append_value('LINKFLAGS', '-headerpad_max_install_names')
- else:
- # Avoid the endless warnings about _t uninitialized in optional<>
- conf.env.append_value('CXXFLAGS', '-Wno-maybe-uninitialized')
#
# Dependencies.
if conf.options.workaround_gssapi:
conf.env.LIB_SSH = ['gssapi_krb5']
else:
- conf.check_cc(fragment="""
+ conf.check_cxx(fragment="""
#include <libssh/libssh.h>\n
int main () {\n
- ssh_session s = ssh_new ();\n
+ ssh_new ();\n
return 0;\n
}
""",
conf.check_cxx(fragment="""
#include <boost/thread.hpp>\n
- int main() { boost::thread t (); }\n
+ int main() { boost::thread t; }\n
""",
msg='Checking for boost threading library',
libpath='/usr/local/lib',
deps.append('boost_filesystem%s' % boost_lib_suffix)
conf.check_cxx(fragment="""
#include <boost/process.hpp>\n
- int main() { boost::process::child* c = new boost::process::child("foo"); }\n
+ int main() { new boost::process::child("foo"); }\n
""",
+ cxxflags='-Wno-unused-parameter',
msg='Checking for boost process library',
lib=deps,
uselib_store='BOOST_PROCESS')