Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile warnings #479

Merged
merged 6 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 7 additions & 22 deletions IlmBase/Half/half.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ class half
// Constructors
//-------------

half (); // no initialization
half () = default; // no initialization
half (float f);

// rule of 5
~half () = default;
half (const half &) = default;
half (half &&) noexcept = default;

//--------------------
// Conversion to float
Expand All @@ -118,7 +121,8 @@ class half
// Assignment
//-----------

half & operator = (half h);
half & operator = (const half &h) = default;
half & operator = (half &&h) noexcept = default;
half & operator = (float f);

half & operator += (half h);
Expand Down Expand Up @@ -417,17 +421,6 @@ HALF_EXPORT void printBits (char c[35], float f);
//---------------------------------------------------------------------------


//--------------------
// Simple constructors
//--------------------

inline
half::half ()
{
// no initialization
}


//----------------------------
// Half-from-float constructor
//----------------------------
Expand Down Expand Up @@ -575,14 +568,6 @@ half::operator - () const
}


inline half &
half::operator = (half h)
{
_h = h._h;
return *this;
}


inline half &
half::operator = (float f)
{
Expand Down
1 change: 0 additions & 1 deletion IlmBase/Half/halfFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ halfFunction<T>::halfFunction (Function f,
{
#ifndef ILMBASE_HAVE_LARGE_STACK
_lut = new T[1<<16];
memset (_lut, 0 , (1<<16) * sizeof(T));
#endif

for (int i = 0; i < (1 << 16); i++)
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testSize.h>
#include <testArithmetic.h>
#include <testError.h>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testArithmetic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testArithmetic.h>
#include "half.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testBitPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBitPatterns.h>
#include "half.h"
#include <float.h>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testClassification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testClassification.h>
#include "half.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testError.h>
#include "half.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testFunction.h>
#include "halfFunction.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testLimits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testLimits.h>
#include "halfLimits.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testSize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testSize.h>
#include "half.h"
#include <iostream>
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/IexTest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBaseExc.h>

Expand Down
4 changes: 3 additions & 1 deletion IlmBase/IexTest/testBaseExc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBaseExc.h>
#include <Iex.h>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/IlmThread/IlmThreadSemaphorePosix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ Semaphore::Semaphore (unsigned int value)

Semaphore::~Semaphore ()
{
#ifdef NDEBUG
::sem_destroy (&_semaphore);
#else
int error = ::sem_destroy (&_semaphore);
assert (error == 0);
#endif
}


Expand Down
3 changes: 2 additions & 1 deletion IlmBase/Imath/ImathFrustum.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ void Frustum<T>::modifyNearAndFar(T n, T f)
Line3<T> upperRight( Vec3<T>(0,0,0), Vec3<T>(_right,_top,-_nearPlane) );
Plane3<T> nearPlane( Vec3<T>(0,0,-1), n );

Vec3<T> ll,ur;
Vec3<T> ll = Vec3<T> (0, 0, 0);
Vec3<T> ur = Vec3<T> (0, 0, 0);
nearPlane.intersect(lowerLeft,ll);
nearPlane.intersect(upperRight,ur);

Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testVec.h>
#include <testRoots.h>
Expand Down
3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBoxAlgo.h>
#include "ImathBoxAlgo.h"
Expand Down
3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testBoxAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBoxAlgo.h>
#include "ImathBoxAlgo.h"
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testColor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testColor.h>
#include "ImathColor.h"
Expand Down
3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testExtractEuler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testExtractEuler.h>
#include "ImathMatrixAlgo.h"
Expand Down
14 changes: 10 additions & 4 deletions IlmBase/ImathTest/testExtractSHRT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testExtractSHRT.h>
#include "ImathMatrixAlgo.h"
Expand Down Expand Up @@ -67,10 +70,14 @@ testMatrix (const M33f M)
// angle back to a matrix, N.
//

V2f s, t;
float h, r;
V2f s(0.f), t(0.f);
kdt3rd marked this conversation as resolved.
Show resolved Hide resolved
float h, r= 0.f;

extractSHRT (M, s, h, r, t, true);
if (!extractSHRT (M, s, h, r, t, true))
{
cout << "Unable to extractSHRT" << std::endl;
assert(false);
}

M33f N;

Expand Down Expand Up @@ -443,4 +450,3 @@ testExtractSHRT ()
cerr << " Caught exception: " << e.what () << endl;
}
}

10 changes: 6 additions & 4 deletions IlmBase/ImathTest/testFrustum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testFrustum.h>
#include "ImathFrustum.h"
Expand Down Expand Up @@ -225,7 +227,7 @@ testFrustum ()
(void)badFrustum.projectionMatrix();
assert (!"near == far didn't throw an exception");
}
catch (IEX_NAMESPACE::DivzeroExc)
catch (IEX_NAMESPACE::DivzeroExc &)
{
caught = true;
}
Expand All @@ -239,7 +241,7 @@ testFrustum ()
(void)badFrustum.projectionMatrix();
assert (!"left == right didn't throw an exception");
}
catch (IEX_NAMESPACE::DivzeroExc)
catch (IEX_NAMESPACE::DivzeroExc &)
{
caught = true;
}
Expand All @@ -253,7 +255,7 @@ testFrustum ()
(void)badFrustum.projectionMatrix();
assert (!"top == bottom didn't throw an exception");
}
catch (IEX_NAMESPACE::DivzeroExc)
catch (IEX_NAMESPACE::DivzeroExc &)
{
caught = true;
}
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testFrustumTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testFrustumTest.h>
#include "ImathFrustum.h"
Expand Down
3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testFun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testFun.h>
#include "ImathFun.h"
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testInvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testInvert.h>
#include "ImathMatrix.h"
Expand Down
6 changes: 4 additions & 2 deletions IlmBase/ImathTest/testJacobiEigenSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include "ImathMatrix.h"
#include "ImathMatrixAlgo.h"
#include <iostream>
Expand Down Expand Up @@ -309,5 +313,3 @@ testJacobiEigenSolver()

cout << "************ ALL PASS ************" << endl;
}


3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testLineAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testLineAlgo.h>
#include "ImathLineAlgo.h"
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testMatrix.h>
#include "ImathMatrix.h"
Expand Down
Loading