From 2935d9d158cf35496a35107f9c4ab7d2929cf6c3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 21 May 2014 22:34:49 +0100 Subject: [PATCH] Try to fix clashes caused by ERROR, WARNING etc. as variables. --- src/lib/config.cc | 4 ++-- src/lib/cross.cc | 4 ++-- src/lib/dcp_video_frame.cc | 2 +- src/lib/encoder.cc | 6 +++--- src/lib/ffmpeg_content.cc | 2 +- src/lib/ffmpeg_decoder.cc | 6 +++--- src/lib/film.cc | 4 ++-- src/lib/image_proxy.cc | 2 +- src/lib/log.cc | 20 ++++++++++---------- src/lib/log.h | 8 ++++---- src/lib/player.cc | 2 +- src/lib/scp_dcp_job.cc | 2 +- src/lib/server.cc | 8 ++++---- src/lib/transcode_job.cc | 4 ++-- src/lib/writer.cc | 6 +++--- src/wx/config_dialog.cc | 16 ++++++++-------- 16 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/lib/config.cc b/src/lib/config.cc index 6d029dd1f..b97ad559d 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -73,7 +73,7 @@ Config::Config () , _check_for_updates (false) , _check_for_test_updates (false) , _maximum_j2k_bandwidth (250000000) - , _log_types (Log::GENERAL | Log::WARNING | Log::ERROR) + , _log_types (Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR) { _allowed_dcp_frame_rates.push_back (24); _allowed_dcp_frame_rates.push_back (25); @@ -191,7 +191,7 @@ Config::read () _maximum_j2k_bandwidth = f.optional_number_child ("MaximumJ2KBandwidth").get_value_or (250000000); _allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate"); - _log_types = f.optional_number_child ("LogTypes").get_value_or (Log::GENERAL | Log::WARNING | Log::ERROR); + _log_types = f.optional_number_child ("LogTypes").get_value_or (Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR); } void diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 9247baa97..730cfe1d0 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -46,8 +46,8 @@ #include "i18n.h" -#define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_ERROR(...) log->log (String::compose (__VA_ARGS__), Log::ERROR); +#define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_ERROR(...) log->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); using std::pair; using std::list; diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc index 265cbaae8..6cf987648 100644 --- a/src/lib/dcp_video_frame.cc +++ b/src/lib/dcp_video_frame.cc @@ -63,7 +63,7 @@ #include "cross.h" #include "player_video_frame.h" -#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), Log::GENERAL); +#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); #include "i18n.h" diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 05da6bbdf..ee43476c9 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -39,9 +39,9 @@ #include "i18n.h" -#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::ERROR); -#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TIMING); +#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); +#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); using std::pair; using std::string; diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 5d0a6a309..41a3724a2 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -34,7 +34,7 @@ extern "C" { #include "i18n.h" -#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); +#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); using std::string; using std::stringstream; diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 6351c7e22..5fe34ce14 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -46,9 +46,9 @@ extern "C" { #include "i18n.h" -#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_ERROR(...) film->log()->log (String::compose (__VA_ARGS__), Log::ERROR); -#define LOG_WARNING(...) film->log()->log (__VA_ARGS__, Log::WARNING); +#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_ERROR(...) film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); +#define LOG_WARNING(...) film->log()->log (__VA_ARGS__, Log::TYPE_WARNING); using std::cout; using std::string; diff --git a/src/lib/film.cc b/src/lib/film.cc index 206400da2..5fde0447a 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -81,8 +81,8 @@ using libdcp::Size; using libdcp::Signer; using libdcp::raw_convert; -#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, Log::GENERAL); +#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, Log::TYPE_GENERAL); /* 5 -> 6 * AudioMapping XML changed. diff --git a/src/lib/image_proxy.cc b/src/lib/image_proxy.cc index c0e75c77c..ec5b66555 100644 --- a/src/lib/image_proxy.cc +++ b/src/lib/image_proxy.cc @@ -28,7 +28,7 @@ #include "i18n.h" -#define LOG_TIMING(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::TIMING); +#define LOG_TIMING(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); using std::cout; using std::string; diff --git a/src/lib/log.cc b/src/lib/log.cc index be32315d1..a2f420ce1 100644 --- a/src/lib/log.cc +++ b/src/lib/log.cc @@ -34,10 +34,10 @@ using namespace std; using boost::algorithm::is_any_of; using boost::algorithm::split; -int const Log::GENERAL = 0x1; -int const Log::WARNING = 0x2; -int const Log::ERROR = 0x4; -int const Log::TIMING = 0x8; +int const Log::TYPE_GENERAL = 0x1; +int const Log::TYPE_WARNING = 0x2; +int const Log::TYPE_ERROR = 0x4; +int const Log::TYPE_TIMING = 0x8; Log::Log () : _types (0) @@ -69,11 +69,11 @@ Log::log (string message, int type) stringstream s; s << a.substr (0, a.length() - 1) << N_(": "); - if (type & ERROR) { + if (type & TYPE_ERROR) { s << "ERROR: "; } - if (type & WARNING) { + if (type & TYPE_WARNING) { s << "WARNING: "; } @@ -118,13 +118,13 @@ Log::set_types (string t) for (vector::const_iterator i = types.begin(); i != types.end(); ++i) { if (*i == N_("general")) { - _types |= GENERAL; + _types |= TYPE_GENERAL; } else if (*i == N_("warning")) { - _types |= WARNING; + _types |= TYPE_WARNING; } else if (*i == N_("error")) { - _types |= ERROR; + _types |= TYPE_ERROR; } else if (*i == N_("timing")) { - _types |= TIMING; + _types |= TYPE_TIMING; } } } diff --git a/src/lib/log.h b/src/lib/log.h index 641ce186d..c11daf617 100644 --- a/src/lib/log.h +++ b/src/lib/log.h @@ -37,10 +37,10 @@ public: Log (); virtual ~Log () {} - static const int GENERAL; - static const int WARNING; - static const int ERROR; - static const int TIMING; + static const int TYPE_GENERAL; + static const int TYPE_WARNING; + static const int TYPE_ERROR; + static const int TYPE_TIMING; void log (std::string message, int type); void microsecond_log (std::string message, int type); diff --git a/src/lib/player.cc b/src/lib/player.cc index a90350922..b112760ef 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -37,7 +37,7 @@ #include "scaler.h" #include "player_video_frame.h" -#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); +#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); using std::list; using std::cout; diff --git a/src/lib/scp_dcp_job.cc b/src/lib/scp_dcp_job.cc index 30bfc3441..637840813 100644 --- a/src/lib/scp_dcp_job.cc +++ b/src/lib/scp_dcp_job.cc @@ -37,7 +37,7 @@ #include "i18n.h" -#define LOG_GENERAL_NC(...) _film->log()->microsecond_log (__VA_ARGS__, Log::GENERAL); +#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_GENERAL); using std::string; using std::stringstream; diff --git a/src/lib/server.cc b/src/lib/server.cc index c4c98a4c9..6b4064cd7 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -41,10 +41,10 @@ #include "i18n.h" -#define LOG_GENERAL(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_GENERAL_NC(...) _log->microsecond_log (__VA_ARGS__, Log::GENERAL); -#define LOG_ERROR(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::ERROR); -#define LOG_ERROR_NC(...) _log->microsecond_log (__VA_ARGS__, Log::ERROR); +#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_GENERAL_NC(...) _log->log (__VA_ARGS__, Log::TYPE_GENERAL); +#define LOG_ERROR(...) _log->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); +#define LOG_ERROR_NC(...) _log->log (__VA_ARGS__, Log::TYPE_ERROR); using std::string; using std::stringstream; diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index fb9a59179..ef15f9f5e 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -30,8 +30,8 @@ #include "i18n.h" -#define LOG_GENERAL_NC(...) _film->log()->microsecond_log (__VA_ARGS__, Log::GENERAL); -#define LOG_ERROR_NC(...) _film->log()->microsecond_log (__VA_ARGS__, Log::ERROR); +#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_GENERAL); +#define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_ERROR); using std::string; using std::stringstream; diff --git a/src/lib/writer.cc b/src/lib/writer.cc index b058c2801..b175843ed 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -40,9 +40,9 @@ #include "i18n.h" -#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::GENERAL); -#define LOG_TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TIMING); -#define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, Log::WARNING); +#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); +#define LOG_TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); +#define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_WARNING); /* OS X strikes again */ #undef set_key diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 109ff9f87..684d2496e 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -764,13 +764,13 @@ public: _maximum_j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&AdvancedPage::maximum_j2k_bandwidth_changed, this)); _allow_any_dcp_frame_rate->SetValue (config->allow_any_dcp_frame_rate ()); _allow_any_dcp_frame_rate->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::allow_any_dcp_frame_rate_changed, this)); - _log_general->SetValue (config->log_types() & Log::GENERAL); + _log_general->SetValue (config->log_types() & Log::TYPE_GENERAL); _log_general->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this)); - _log_warning->SetValue (config->log_types() & Log::WARNING); + _log_warning->SetValue (config->log_types() & Log::TYPE_WARNING); _log_warning->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this)); - _log_error->SetValue (config->log_types() & Log::ERROR); + _log_error->SetValue (config->log_types() & Log::TYPE_ERROR); _log_error->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this)); - _log_timing->SetValue (config->log_types() & Log::TIMING); + _log_timing->SetValue (config->log_types() & Log::TYPE_TIMING); _log_timing->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this)); return panel; @@ -792,16 +792,16 @@ private: { int types = 0; if (_log_general->GetValue ()) { - types |= Log::GENERAL; + types |= Log::TYPE_GENERAL; } if (_log_warning->GetValue ()) { - types |= Log::WARNING; + types |= Log::TYPE_WARNING; } if (_log_error->GetValue ()) { - types |= Log::ERROR; + types |= Log::TYPE_ERROR; } if (_log_timing->GetValue ()) { - types |= Log::TIMING; + types |= Log::TYPE_TIMING; } Config::instance()->set_log_types (types); } -- 2.30.2