summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-06-13 12:51:48 +0100
committerCarl Hetherington <cth@carlh.net>2014-06-13 12:51:48 +0100
commit7bca4c05ca38b218c252b0fe98a866806d9a2ded (patch)
tree959c021c95049e3a064f3a7b377d26d78c9cc4a3
parent4c8229e08772f498f1ece36fff51c0be8cf3636c (diff)
Work around symbol clash with ERROR on Win32/mingw.
-rw-r--r--src/asset.cc2
-rw-r--r--src/content.cc7
-rw-r--r--src/cpl.cc6
-rw-r--r--src/dcp.cc2
-rw-r--r--src/mono_picture_mxf.cc2
-rw-r--r--src/mxf.cc4
-rw-r--r--src/picture_mxf.cc14
-rw-r--r--src/reel.cc6
-rw-r--r--src/sound_mxf.cc6
-rw-r--r--src/subtitle_content.h2
-rw-r--r--src/types.h12
-rw-r--r--tools/dcpdiff.cc2
12 files changed, 31 insertions, 34 deletions
diff --git a/src/asset.cc b/src/asset.cc
index 6bf8fec5..80b01082 100644
--- a/src/asset.cc
+++ b/src/asset.cc
@@ -106,7 +106,7 @@ bool
Asset::equals (boost::shared_ptr<const Asset> other, EqualityOptions, function<void (NoteType, string)> note) const
{
if (_hash != other->_hash) {
- note (ERROR, "Asset hashes differ");
+ note (DCP_ERROR, "Asset hashes differ");
return false;
}
diff --git a/src/content.cc b/src/content.cc
index 50db005a..007d5cbc 100644
--- a/src/content.cc
+++ b/src/content.cc
@@ -27,9 +27,6 @@
#include <boost/function.hpp>
#include <iostream>
-/* We need this here for the #undef ERROR for Windows */
-#include "types.h"
-
using namespace std;
using namespace boost;
using namespace dcp;
@@ -57,12 +54,12 @@ Content::equals (shared_ptr<const Content> other, EqualityOptions opt, boost::fu
}
if (_edit_rate != other->_edit_rate) {
- note (ERROR, "content edit rates differ");
+ note (DCP_ERROR, "content edit rates differ");
return false;
}
if (_intrinsic_duration != other->_intrinsic_duration) {
- note (ERROR, "asset intrinsic durations differ");
+ note (DCP_ERROR, "asset intrinsic durations differ");
return false;
}
diff --git a/src/cpl.cc b/src/cpl.cc
index fcfa9efa..535fd77f 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -179,17 +179,17 @@ CPL::equals (CPL const & other, EqualityOptions opt, boost::function<void (NoteT
if (_annotation_text != other._annotation_text && !opt.cpl_annotation_texts_can_differ) {
stringstream s;
s << "annotation texts differ: " << _annotation_text << " vs " << other._annotation_text << "\n";
- note (ERROR, s.str ());
+ note (DCP_ERROR, s.str ());
return false;
}
if (_content_kind != other._content_kind) {
- note (ERROR, "content kinds differ");
+ note (DCP_ERROR, "content kinds differ");
return false;
}
if (_reels.size() != other._reels.size()) {
- note (ERROR, String::compose ("reel counts differ (%1 vs %2)", _reels.size(), other._reels.size()));
+ note (DCP_ERROR, String::compose ("reel counts differ (%1 vs %2)", _reels.size(), other._reels.size()));
return false;
}
diff --git a/src/dcp.cc b/src/dcp.cc
index a7c6869d..96798751 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -172,7 +172,7 @@ bool
DCP::equals (DCP const & other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
{
if (_assets.size() != other._assets.size()) {
- note (ERROR, String::compose ("Asset counts differ: %1 vs %2", _assets.size(), other._assets.size()));
+ note (DCP_ERROR, String::compose ("Asset counts differ: %1 vs %2", _assets.size(), other._assets.size()));
return false;
}
diff --git a/src/mono_picture_mxf.cc b/src/mono_picture_mxf.cc
index 4af24008..815d8820 100644
--- a/src/mono_picture_mxf.cc
+++ b/src/mono_picture_mxf.cc
@@ -107,7 +107,7 @@ MonoPictureMXF::equals (shared_ptr<const Content> other, EqualityOptions opt, bo
return false;
}
- note (PROGRESS, String::compose ("Comparing video frame %1 of %2", i, _intrinsic_duration));
+ note (DCP_PROGRESS, String::compose ("Comparing video frame %1 of %2", i, _intrinsic_duration));
shared_ptr<const MonoPictureFrame> frame_A = get_frame (i);
shared_ptr<const MonoPictureFrame> frame_B = other_picture->get_frame (i);
diff --git a/src/mxf.cc b/src/mxf.cc
index dd4d2efc..def53c15 100644
--- a/src/mxf.cc
+++ b/src/mxf.cc
@@ -98,12 +98,12 @@ MXF::equals (shared_ptr<const Content> other, EqualityOptions opt, boost::functi
shared_ptr<const MXF> other_mxf = dynamic_pointer_cast<const MXF> (other);
if (!other_mxf) {
- note (ERROR, "comparing an MXF asset with a non-MXF asset");
+ note (DCP_ERROR, "comparing an MXF asset with a non-MXF asset");
return false;
}
if (_file != other_mxf->file ()) {
- note (ERROR, "MXF names differ");
+ note (DCP_ERROR, "MXF names differ");
if (!opt.mxf_names_can_differ) {
return false;
}
diff --git a/src/picture_mxf.cc b/src/picture_mxf.cc
index 4a8e477b..e3a43e37 100644
--- a/src/picture_mxf.cc
+++ b/src/picture_mxf.cc
@@ -94,12 +94,12 @@ PictureMXF::descriptor_equals (
// a.QuantizationDefault != b.QuantizationDefault
) {
- note (ERROR, "video MXF picture descriptors differ");
+ note (DCP_ERROR, "video MXF picture descriptors differ");
return false;
}
if (a.ContainerDuration != b.ContainerDuration) {
- note (ERROR, "video container durations differ");
+ note (DCP_ERROR, "video container durations differ");
}
// for (unsigned int j = 0; j < ASDCP::JP2K::MaxComponents; ++j) {
@@ -118,7 +118,7 @@ PictureMXF::frame_buffer_equals (
) const
{
if (size_A == size_B && memcmp (data_A, data_B, size_A) == 0) {
- note (NOTE, "J2K identical");
+ note (DCP_NOTE, "J2K identical");
/* Easy result; the J2K data is identical */
return true;
}
@@ -136,7 +136,7 @@ PictureMXF::frame_buffer_equals (
for (int c = 0; c < 3; ++c) {
if (image_A->size() != image_B->size()) {
- note (ERROR, String::compose ("image sizes for frame %1 differ", frame));
+ note (DCP_ERROR, String::compose ("image sizes for frame %1 differ", frame));
return false;
}
@@ -162,11 +162,11 @@ PictureMXF::frame_buffer_equals (
double const std_dev = sqrt (double (total_squared_deviation) / abs_diffs.size());
- note (NOTE, String::compose ("mean difference %1, deviation %2", mean, std_dev));
+ note (DCP_NOTE, String::compose ("mean difference %1, deviation %2", mean, std_dev));
if (mean > opt.max_mean_pixel_error) {
note (
- ERROR,
+ DCP_ERROR,
String::compose ("mean %1 out of range %2 in frame %3", mean, opt.max_mean_pixel_error, frame)
);
@@ -175,7 +175,7 @@ PictureMXF::frame_buffer_equals (
if (std_dev > opt.max_std_dev_pixel_error) {
note (
- ERROR,
+ DCP_ERROR,
String::compose ("standard deviation %1 out of range %2 in frame %3", std_dev, opt.max_std_dev_pixel_error, frame)
);
diff --git a/src/reel.cc b/src/reel.cc
index 34b520b4..08a0c936 100644
--- a/src/reel.cc
+++ b/src/reel.cc
@@ -98,7 +98,7 @@ bool
Reel::equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
{
if ((_main_picture && !other->_main_picture) || (!_main_picture && other->_main_picture)) {
- note (ERROR, "reel has different assets");
+ note (DCP_ERROR, "reel has different assets");
return false;
}
@@ -107,7 +107,7 @@ Reel::equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::f
}
if ((_main_sound && !other->_main_sound) || (!_main_sound && other->_main_sound)) {
- note (ERROR, "reel has different assets");
+ note (DCP_ERROR, "reel has different assets");
return false;
}
@@ -116,7 +116,7 @@ Reel::equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::f
}
if ((_main_subtitle && !other->_main_subtitle) || (!_main_subtitle && other->_main_subtitle)) {
- note (ERROR, "reel has different assets");
+ note (DCP_ERROR, "reel has different assets");
return false;
}
diff --git a/src/sound_mxf.cc b/src/sound_mxf.cc
index fa48a6c1..ff2167d9 100644
--- a/src/sound_mxf.cc
+++ b/src/sound_mxf.cc
@@ -122,7 +122,7 @@ SoundMXF::equals (shared_ptr<const Content> other, EqualityOptions opt, boost::f
// desc_A.ChannelFormat != desc_B.ChannelFormat ||
) {
- note (ERROR, "audio MXF picture descriptors differ");
+ note (DCP_ERROR, "audio MXF picture descriptors differ");
return false;
}
@@ -139,7 +139,7 @@ SoundMXF::equals (shared_ptr<const Content> other, EqualityOptions opt, boost::f
}
if (buffer_A.Size() != buffer_B.Size()) {
- note (ERROR, String::compose ("sizes of audio data for frame %1 differ", i));
+ note (DCP_ERROR, String::compose ("sizes of audio data for frame %1 differ", i));
return false;
}
@@ -147,7 +147,7 @@ SoundMXF::equals (shared_ptr<const Content> other, EqualityOptions opt, boost::f
for (uint32_t i = 0; i < buffer_A.Size(); ++i) {
int const d = abs (buffer_A.RoData()[i] - buffer_B.RoData()[i]);
if (d > opt.max_audio_sample_error) {
- note (ERROR, String::compose ("PCM data difference of %1", d));
+ note (DCP_ERROR, String::compose ("PCM data difference of %1", d));
return false;
}
}
diff --git a/src/subtitle_content.h b/src/subtitle_content.h
index 2c606921..1ddb9122 100644
--- a/src/subtitle_content.h
+++ b/src/subtitle_content.h
@@ -55,7 +55,7 @@ public:
boost::function<void (NoteType, std::string)> note
) const {
/* XXX */
- note (ERROR, "subtitle content not compared yet");
+ note (DCP_ERROR, "subtitle content not compared yet");
return true;
}
diff --git a/src/types.h b/src/types.h
index ece7d44c..5ef04bd3 100644
--- a/src/types.h
+++ b/src/types.h
@@ -137,13 +137,13 @@ struct EqualityOptions
bool mxf_names_can_differ;
};
-/* Win32 defines this */
-#undef ERROR
-
+/* I've been unable to make mingw happy with ERROR as a symbol, so
+ I'm using a DCP_ prefix here.
+*/
enum NoteType {
- PROGRESS,
- ERROR,
- NOTE
+ DCP_PROGRESS,
+ DCP_ERROR,
+ DCP_NOTE
};
enum Standard {
diff --git a/tools/dcpdiff.cc b/tools/dcpdiff.cc
index e7b4f59f..3f19ee24 100644
--- a/tools/dcpdiff.cc
+++ b/tools/dcpdiff.cc
@@ -53,7 +53,7 @@ help (string n)
void
note (NoteType t, string n)
{
- if (t == ERROR || verbose) {
+ if (t == DCP_ERROR || verbose) {
cout << " " << n << "\n";
}
}