Skip to content

Commit

Permalink
First pass of warning cleanup
Browse files Browse the repository at this point in the history
This fixes g++ -Wall to compile warning free

Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd committed Jul 23, 2019
1 parent b9d93bd commit b5653ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
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
6 changes: 3 additions & 3 deletions IlmBase/ImathTest/testFrustum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,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 +239,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 +253,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

0 comments on commit b5653ed

Please sign in to comment.