Skip to content

Commit

Permalink
sonar fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Nov 14, 2019
1 parent cf8b35c commit ba3d5ef
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 17 deletions.
6 changes: 6 additions & 0 deletions OpenEXR/IlmImf/ImfAcesFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class AcesOutputFile::Data
Data();
~Data();

Data (const Data& other) = delete;
const Data operator = (const Data& other) = delete;

RgbaOutputFile * rgbaFile;
};

Expand Down Expand Up @@ -338,6 +341,9 @@ class AcesInputFile::Data
Data();
~Data();

Data (const Data& other) = delete;
const Data operator = (const Data& other) = delete;

void initColorConversion ();

RgbaInputFile * rgbaFile;
Expand Down
1 change: 1 addition & 0 deletions OpenEXR/IlmImf/ImfAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class TypedAttribute: public Attribute
TypedAttribute (const TypedAttribute<T> &other);
virtual ~TypedAttribute ();

const TypedAttribute& operator = (const TypedAttribute& other) = delete;

//--------------------------------
// Access to the attribute's value
Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/IlmImf/ImfAutoArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
AutoArray (): _data (new T [size]) { memset(_data, 0, size*sizeof(T)); }
~AutoArray () {delete [] _data;}

AutoArray (const AutoArray& other) = delete;
const AutoArray& operator = (const AutoArray& other) = delete;

operator T * () {return _data;}
operator const T * () const {return _data;}

Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/IlmImf/ImfB44Compressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class B44Compressor: public Compressor
IMF_EXPORT
virtual ~B44Compressor ();

B44Compressor (const B44Compressor& other) = delete;
const B44Compressor& operator = (const B44Compressor& other) = delete;

IMF_EXPORT
virtual int numScanLines () const;

Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/IlmImf/ImfDeepScanLineInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ struct DeepScanLineInputFile::Data: public Mutex
Data (int numThreads);
~Data ();

Data (const Data& data) = delete;
const Data& operator = (const Data& data) = delete;

inline LineBuffer * getLineBuffer (int number); // hash function from line
// buffer indices into our
// vector of line buffers
Expand Down
2 changes: 2 additions & 0 deletions OpenEXR/IlmImf/ImfDeepScanLineInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class DeepScanLineInputFile : public GenericInputFile
int version, /*version field from file*/
int numThreads = globalThreadCount());

DeepScanLineInputFile (const DeepScanLineInputFile& other) = delete;
const DeepScanLineInputFile& operator = (const DeepScanLineInputFile& other) = delete;

//-----------------------------------------
// Destructor -- deallocates internal data
Expand Down
2 changes: 2 additions & 0 deletions OpenEXR/IlmImf/ImfDeepScanLineOutputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ struct DeepScanLineOutputFile::Data
Data (int numThreads);
~Data ();

Data (const Data& other) = delete;
const Data& operator = (const Data& other) = delete;

inline LineBuffer * getLineBuffer (int number);// hash function from line
// buffer indices into our
Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ struct DeepTiledInputFile::Data: public Mutex
Data (int numThreads);
~Data ();

Data (const Data& other) = delete;
const Data& operator = (const Data& other) = delete;

inline TileBuffer * getTileBuffer (int number);
// hash function from tile indices
// into our vector of tile buffers
Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ struct DeepTiledOutputFile::Data
Data (int numThreads);
~Data ();

Data (const Data& other) = delete;
const Data& operator = (const Data& other) = delete;

inline TileBuffer * getTileBuffer (int number);
// hash function from tile
// buffer coords into our
Expand Down
2 changes: 2 additions & 0 deletions OpenEXR/IlmImf/ImfDwaCompressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class DwaCompressor: public Compressor
IMF_EXPORT
virtual ~DwaCompressor ();

const DwaCompressor& operator = (const DwaCompressor& other) = delete;

IMF_EXPORT
virtual int numScanLines () const;

Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfDwaCompressorSimd.h
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,7 @@ dctForward8x8 (float *data)

#endif /* IMF_HAVE_SSE2 */

} // anonymous namespace
} // namespace

OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT

Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/IlmImf/ImfFastHuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ class FastHufDecoder
IMF_EXPORT
~FastHufDecoder ();

FastHufDecoder (const FastHufDecoder& other) = delete;
const FastHufDecoder& operator = (const FastHufDecoder& other) = delete;

IMF_EXPORT
static bool enabled ();

Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/IlmImf/ImfInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ struct InputFile::Data : public Mutex
Data (int numThreads);
~Data ();

Data (const Data& other) = delete;
const Data& operator = (const Data& other) = delete;

void deleteCachedBuffer();
};

Expand Down
19 changes: 11 additions & 8 deletions OpenEXR/IlmImf/ImfKeyCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,17 @@ KeyCode::KeyCode (const KeyCode &other)
KeyCode &
KeyCode::operator = (const KeyCode &other)
{
_filmMfcCode = other._filmMfcCode;
_filmType = other._filmType;
_prefix = other._prefix;
_count = other._count;
_perfOffset = other._perfOffset;
_perfsPerFrame = other._perfsPerFrame;
_perfsPerCount = other._perfsPerCount;

if (this != &other)
{
_filmMfcCode = other._filmMfcCode;
_filmType = other._filmType;
_prefix = other._prefix;
_count = other._count;
_perfOffset = other._perfOffset;
_perfsPerFrame = other._perfsPerFrame;
_perfsPerCount = other._perfsPerCount;
}

return *this;
}

Expand Down
2 changes: 2 additions & 0 deletions OpenEXR/IlmImf/ImfKeyCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class KeyCode
IMF_EXPORT
KeyCode (const KeyCode &other);
IMF_EXPORT
~KeyCode() = default;
IMF_EXPORT
KeyCode & operator = (const KeyCode &other);


Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/IlmImf/dwaLookups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ namespace {
{
}

LutHeaderWorker(const LutHeaderWorker& other) = delete;
const LutHeaderWorker& operator = (const LutHeaderWorker& other) = delete;

~LutHeaderWorker()
{
delete[] _offset;
Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImfTest/testInputPart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#include <ImfInputPart.h>
#include <ImfTiledOutputPart.h>
#include <ImfPartType.h>
#include <ImfMisc.h>
//#include <ImfMisc.h>

namespace IMF = OPENEXR_IMF_NAMESPACE;
using namespace IMF;
Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImfTest/testMultiPartFileMixingBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#include <ImfDeepTiledInputPart.h>
#include <ImfDeepScanLineInputPart.h>
#include <ImfPartType.h>
#include <ImfMisc.h>
//#include <ImfMisc.h>
#include <ImfSystemSpecific.h>

namespace IMF = OPENEXR_IMF_NAMESPACE;
Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/exrmaketiled/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ class Image
Image (const IMATH_NAMESPACE::Box2i &dataWindow);
~Image ();

Image (const Image& other) = delete;
const Image & operator = (const Image& other) = delete;

const IMATH_NAMESPACE::Box2i & dataWindow () const;
void resize (const IMATH_NAMESPACE::Box2i &dataWindow);

Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/exrmaketiled/makeTiled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include "ImfStandardAttributes.h"
#include "ImathFun.h"
#include "Iex.h"
#include "ImfMisc.h"
//#include "ImfMisc.h"

#include <map>
#include <algorithm>
Expand Down
3 changes: 3 additions & 0 deletions OpenEXR/exrmultiview/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ class Image
Image (const IMATH_NAMESPACE::Box2i &dataWindow);
~Image ();

Image (const Image& other) = delete;
const Image & operator = (const Image& other) = delete;

const IMATH_NAMESPACE::Box2i & dataWindow () const;
void resize (const IMATH_NAMESPACE::Box2i &dataWindow);

Expand Down
2 changes: 1 addition & 1 deletion PyIlmBase/PyImath/PyImathFixedVArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ FixedVArray<T>::FixedVArray(FixedVArray<T>& other, const FixedArray<int>& mask)
{
if (mask[i])
{
_indices[j] = i;
_indices[j] = i; // NOSONAR - suppress SonarCloud warning.
j++;
}
}
Expand Down
10 changes: 6 additions & 4 deletions PyIlmBase/PyImath/PyImathStringTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ struct StringTableIndex
StringTableIndex() : _index(0) {}
StringTableIndex (const StringTableIndex &si) : _index (si._index) {}
explicit StringTableIndex (index_type i) : _index (i) {}

~StringTableIndex() = default;

const StringTableIndex & operator = (const StringTableIndex &si)
{
_index = si._index; return *this;
_index = si._index; // NOSONAR - suppress SonarCloud warning
return *this;
}

bool operator == (const StringTableIndex &si) const
Expand Down Expand Up @@ -110,7 +112,7 @@ struct StringTableEntry
T s;
};

namespace {
namespace PyImath {

using boost::multi_index_container;
using namespace boost::multi_index;
Expand All @@ -131,7 +133,7 @@ class StringTableDetailT {
> StringTableContainer;
};

} // namespace
} // namespace PyImath

typedef StringTableDetailT<std::string> StringTableDetail;
typedef StringTableDetailT<std::wstring> WStringTableDetail;
Expand Down
6 changes: 6 additions & 0 deletions PyIlmBase/PyImath/PyImathUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class PyAcquireLock
public:
PYIMATH_EXPORT PyAcquireLock();
PYIMATH_EXPORT ~PyAcquireLock();
PYIMATH_EXPORT PyAcquireLock(const PyAcquireLock& other) = delete;
PYIMATH_EXPORT PyAcquireLock & operator = (PyAcquireLock& other) = delete;

private:
PyGILState_STATE _gstate;
};
Expand All @@ -84,6 +87,9 @@ class PyReleaseLock
public:
PYIMATH_EXPORT PyReleaseLock();
PYIMATH_EXPORT ~PyReleaseLock();
PYIMATH_EXPORT PyReleaseLock(const PyReleaseLock& other) = delete;
PYIMATH_EXPORT PyReleaseLock & operator = (PyReleaseLock& other) = delete;

private:
PyThreadState *_save;

Expand Down

0 comments on commit ba3d5ef

Please sign in to comment.