Skip to content

Commit

Permalink
Use namespace macros to facilitate building with --enable-customusern…
Browse files Browse the repository at this point in the history
…amespace
  • Loading branch information
KevinJW committed Nov 12, 2015
1 parent 30cbf49 commit 04b1c7e
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
26 changes: 13 additions & 13 deletions OpenEXR/IlmImf/ImfFastHuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ FastHufDecoder::FastHufDecoder
{
if (currByte - table > numBytes)
{
throw Iex::InputExc ("Error decoding Huffman table "
throw IEX_NAMESPACE::InputExc ("Error decoding Huffman table "
"(Truncated table data).");
}

Expand All @@ -146,7 +146,7 @@ FastHufDecoder::FastHufDecoder
{
if (currByte - table > numBytes)
{
throw Iex::InputExc ("Error decoding Huffman table "
throw IEX_NAMESPACE::InputExc ("Error decoding Huffman table "
"(Truncated table data).");
}

Expand All @@ -155,7 +155,7 @@ FastHufDecoder::FastHufDecoder

if (symbol + runLen > maxSymbol + 1)
{
throw Iex::InputExc ("Error decoding Huffman table "
throw IEX_NAMESPACE::InputExc ("Error decoding Huffman table "
"(Run beyond end of table).");
}

Expand All @@ -168,7 +168,7 @@ FastHufDecoder::FastHufDecoder

if (symbol + runLen > maxSymbol + 1)
{
throw Iex::InputExc ("Error decoding Huffman table "
throw IEX_NAMESPACE::InputExc ("Error decoding Huffman table "
"(Run beyond end of table).");
}

Expand Down Expand Up @@ -256,7 +256,7 @@ FastHufDecoder::FastHufDecoder
int symbol = *i >> 6;

if (mapping[codeLen] >= _numSymbols)
throw Iex::InputExc ("Huffman decode error "
throw IEX_NAMESPACE::InputExc ("Huffman decode error "
"(Invalid symbol in header).");

_idToSymbol[mapping[codeLen]] = symbol;
Expand Down Expand Up @@ -401,7 +401,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
}
else
{
throw Iex::InputExc ("Huffman decode error "
throw IEX_NAMESPACE::InputExc ("Huffman decode error "
"(Overrun).");
}
break;
Expand Down Expand Up @@ -578,7 +578,7 @@ FastHufDecoder::decode
int numDstElems)
{
if (numSrcBits < 128)
throw Iex::InputExc ("Error choosing Huffman decoder implementation "
throw IEX_NAMESPACE::InputExc ("Error choosing Huffman decoder implementation "
"(insufficient number of bits).");

//
Expand Down Expand Up @@ -662,7 +662,7 @@ FastHufDecoder::decode

if (codeLen > _maxCodeLength)
{
throw Iex::InputExc ("Huffman decode error "
throw IEX_NAMESPACE::InputExc ("Huffman decode error "
"(Decoded an invalid symbol).");
}

Expand All @@ -673,7 +673,7 @@ FastHufDecoder::decode
}
else
{
throw Iex::InputExc ("Huffman decode error "
throw IEX_NAMESPACE::InputExc ("Huffman decode error "
"(Decoded an invalid symbol).");
}
}
Expand Down Expand Up @@ -710,19 +710,19 @@ FastHufDecoder::decode

if (dstIdx < 1)
{
throw Iex::InputExc ("Huffman decode error (RLE code "
throw IEX_NAMESPACE::InputExc ("Huffman decode error (RLE code "
"with no previous symbol).");
}

if (dstIdx + rleCount > numDstElems)
{
throw Iex::InputExc ("Huffman decode error (Symbol run "
throw IEX_NAMESPACE::InputExc ("Huffman decode error (Symbol run "
"beyond expected output buffer length).");
}

if (rleCount <= 0)
{
throw Iex::InputExc("Huffman decode error"
throw IEX_NAMESPACE::InputExc("Huffman decode error"
" (Invalid RLE length)");
}

Expand Down Expand Up @@ -760,7 +760,7 @@ FastHufDecoder::decode

if (numSrcBits != 0)
{
throw Iex::InputExc ("Huffman decode error (Compressed data remains "
throw IEX_NAMESPACE::InputExc ("Huffman decode error (Compressed data remains "
"after filling expected output buffer).");
}
}
Expand Down
18 changes: 9 additions & 9 deletions OpenEXR/IlmImf/ImfZip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,42 @@

OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER

Imf::Zip::Zip(size_t maxRawSize):
Zip::Zip(size_t maxRawSize):
_maxRawSize(maxRawSize),
_tmpBuffer(0)
{
_tmpBuffer = new char[_maxRawSize];
}

Imf::Zip::Zip(size_t maxScanLineSize, size_t numScanLines):
Zip::Zip(size_t maxScanLineSize, size_t numScanLines):
_maxRawSize(0),
_tmpBuffer(0)
{
_maxRawSize = uiMult (maxScanLineSize, numScanLines);
_tmpBuffer = new char[_maxRawSize];
}

Imf::Zip::~Zip()
Zip::~Zip()
{
if (_tmpBuffer) delete[] _tmpBuffer;
}

size_t
Imf::Zip::maxRawSize()
Zip::maxRawSize()
{
return _maxRawSize;
}

size_t
Imf::Zip::maxCompressedSize()
Zip::maxCompressedSize()
{
return uiAdd (uiAdd (_maxRawSize,
size_t (ceil (_maxRawSize * 0.01))),
size_t (100));
}

int
Imf::Zip::compress(const char *raw, int rawSize, char *compressed)
Zip::compress(const char *raw, int rawSize, char *compressed)
{
//
// Reorder the pixel data.
Expand Down Expand Up @@ -129,14 +129,14 @@ Imf::Zip::compress(const char *raw, int rawSize, char *compressed)
if (Z_OK != ::compress ((Bytef *)compressed, &outSize,
(const Bytef *) _tmpBuffer, rawSize))
{
throw Iex::BaseExc ("Data compression (zlib) failed.");
throw IEX_NAMESPACE::BaseExc ("Data compression (zlib) failed.");
}

return outSize;
}

int
Imf::Zip::uncompress(const char *compressed, int compressedSize,
Zip::uncompress(const char *compressed, int compressedSize,
char *raw)
{
//
Expand All @@ -148,7 +148,7 @@ Imf::Zip::uncompress(const char *compressed, int compressedSize,
if (Z_OK != ::uncompress ((Bytef *)_tmpBuffer, &outSize,
(const Bytef *) compressed, compressedSize))
{
throw Iex::InputExc ("Data decompression (zlib) failed.");
throw IEX_NAMESPACE::InputExc ("Data decompression (zlib) failed.");
}

//
Expand Down
10 changes: 5 additions & 5 deletions OpenEXR/IlmImf/dwaLookups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ namespace {
class LutHeaderWorker
{
public:
class Runner : public IlmThread::Thread
class Runner : public ILMTHREAD_NAMESPACE::Thread
{
public:
Runner(LutHeaderWorker &worker, bool output):
IlmThread::Thread(),
ILMTHREAD_NAMESPACE::Thread(),
_worker(worker),
_output(output)
{
Expand All @@ -87,7 +87,7 @@ namespace {
private:
LutHeaderWorker &_worker;
bool _output;
IlmThread::Semaphore _semaphore;
ILMTHREAD_NAMESPACE::Semaphore _semaphore;

}; // class LutHeaderWorker::Runner

Expand Down Expand Up @@ -436,7 +436,7 @@ generateToNonlinear()
int
cpuCount()
{
if (!IlmThread::supportsThreads()) return 1;
if (!ILMTHREAD_NAMESPACE::supportsThreads()) return 1;

int cpuCount = 1;

Expand Down Expand Up @@ -492,7 +492,7 @@ generateLutHeader()
}
}

if (IlmThread::supportsThreads()) {
if (ILMTHREAD_NAMESPACE::supportsThreads()) {
std::vector<LutHeaderWorker::Runner*> runners;
for (size_t i=0; i<workers.size(); ++i) {
runners.push_back( new LutHeaderWorker::Runner(*workers[i], (i==0)) );
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImfTest/compareDwa.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

void compareDwa(int width,
int height,
const OPENEXR_IMF_NAMESPACE::Array2D<Imf::Rgba> &src,
const OPENEXR_IMF_NAMESPACE::Array2D<Imf::Rgba> &test,
const OPENEXR_IMF_NAMESPACE::Array2D<OPENEXR_IMF_NAMESPACE::Rgba> &src,
const OPENEXR_IMF_NAMESPACE::Array2D<OPENEXR_IMF_NAMESPACE::Rgba> &test,
OPENEXR_IMF_NAMESPACE::RgbaChannels channels);

#endif
2 changes: 1 addition & 1 deletion OpenEXR/IlmImfUtil/ImfDeepImageLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ DeepImageLevel::initializeSampleLists ()


void
DeepImageLevel::resize (const Imath::Box2i& dataWindow)
DeepImageLevel::resize (const IMATH_NAMESPACE::Box2i& dataWindow)
{
//
// Note: if the following code throws an exception, then the image level
Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImfUtil/ImfFlatImageLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ FlatImageLevel::~FlatImageLevel ()


void
FlatImageLevel::resize (const Imath::Box2i& dataWindow)
FlatImageLevel::resize (const IMATH_NAMESPACE::Box2i& dataWindow)
{
//
// Note: if the following code throws an exception, then the image level
Expand Down
4 changes: 2 additions & 2 deletions OpenEXR/IlmImfUtil/ImfImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,15 @@ Image::levelHeight (int ly) const


void
Image::resize (const Imath::Box2i &dataWindow)
Image::resize (const IMATH_NAMESPACE::Box2i &dataWindow)
{
resize (dataWindow, _levelMode, _levelRoundingMode);
}


void
Image::resize
(const Imath::Box2i &dataWindow,
(const IMATH_NAMESPACE::Box2i &dataWindow,
LevelMode levelMode,
LevelRoundingMode levelRoundingMode)
{
Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImfUtil/ImfImageLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ImageLevel::~ImageLevel ()


void
ImageLevel::resize (const Imath::Box2i& dataWindow)
ImageLevel::resize (const IMATH_NAMESPACE::Box2i& dataWindow)
{
if (dataWindow.max.x < dataWindow.min.x - 1||
dataWindow.max.y < dataWindow.min.y - 1)
Expand Down

0 comments on commit 04b1c7e

Please sign in to comment.