Try to fix clashes caused by ERROR, WARNING etc. as variables.
authorCarl Hetherington <cth@carlh.net>
Wed, 21 May 2014 21:34:49 +0000 (22:34 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 21 May 2014 21:34:49 +0000 (22:34 +0100)
16 files changed:
src/lib/config.cc
src/lib/cross.cc
src/lib/dcp_video_frame.cc
src/lib/encoder.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_decoder.cc
src/lib/film.cc
src/lib/image_proxy.cc
src/lib/log.cc
src/lib/log.h
src/lib/player.cc
src/lib/scp_dcp_job.cc
src/lib/server.cc
src/lib/transcode_job.cc
src/lib/writer.cc
src/wx/config_dialog.cc

index 6d029dd1fa1e545f7ebf0d28bac9ed840737f310..b97ad559dc949c8f21da787e51611e6bf4e48a0b 100644 (file)
@@ -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<int> ("MaximumJ2KBandwidth").get_value_or (250000000);
        _allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate");
 
-       _log_types = f.optional_number_child<int> ("LogTypes").get_value_or (Log::GENERAL | Log::WARNING | Log::ERROR);
+       _log_types = f.optional_number_child<int> ("LogTypes").get_value_or (Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR);
 }
 
 void
index 9247baa97c2da963ba69d1b3bdeded56e0a780f7..730cfe1d0f46a8457652d29cfbad0b0e64a9ae9d 100644 (file)
@@ -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;
index 265cbaae8cc7d7a895382fcbcc55a1e0b85f3168..6cf987648773031a5cb2ed859f3fe4596446fe04 100644 (file)
@@ -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"
 
index 05da6bbdf53db33e0ec62847bd2e0a6e02c4b9c8..ee43476c95153c3d6ed3295f6eb7c04a8fe96a12 100644 (file)
@@ -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;
index 5d0a6a309aac4263aa3c6409c5a518065e72f020..41a3724a29cfee6b19523a776fd0edcb773542ea 100644 (file)
@@ -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;
index 6351c7e2200edaa73c14e3bc100a865c755df71e..5fe34ce14fb3430749f522b93de4aa2971621ff3 100644 (file)
@@ -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;
index 206400da2fce8cc223cf9d82bb3346af5911de3b..5fde0447a35d17e4803e517c79c09e71a0da11f9 100644 (file)
@@ -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.
index c0e75c77c6343dd943e2399db5f0624a0561ccb8..ec5b6655521a10a20ac46c12793772d1954f976d 100644 (file)
@@ -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;
index be32315d108a5bad7c84d49dd8c5a858f452fa39..a2f420ce1b0b8211f0cd3d6e23d759a00c477afc 100644 (file)
@@ -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<string>::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;
                }
        }
 }
index 641ce186d40cf72fdfaf8f75e571ea470e7c5d90..c11daf61708f23d9b0578cad8062e8dd2d652b74 100644 (file)
@@ -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);
index a90350922edcd88af9b06a87a0572232fe33dee7..b112760ef412a024fa581c9779ca5be4b1c65138 100644 (file)
@@ -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;
index 30bfc3441ae80c72aad9de4d330a4dfd4a76028a..63784081356e9eb0fc4d81ea97d551a7078e224d 100644 (file)
@@ -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;
index c4c98a4c9f0ea6da1106e1c3f3b46dad959883c4..6b4064cd7ebae77fdca24040228c7a5169cf9505 100644 (file)
 
 #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;
index fb9a5917956109a8bbe1dcfd57df7d93fa322890..ef15f9f5e9865968ecee6f6b87e0437e672d1e66 100644 (file)
@@ -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;
index b058c2801160d301142e00509159aa7a243b57a1..b175843ed62bb0c975543b980c1bd4dc66f83fc9 100644 (file)
@@ -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
index 109ff9f87b065a734e6eaf4014589580932034ba..684d2496e67feb3a53e7903efd6d03e048c955a7 100644 (file)
@@ -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);
        }