cppcheck: noExplicitConstructor

Change-Id: I452a204616d98e1071b7bf43ad457c6a2376cf91
This commit is contained in:
Caolán McNamara
2015-04-12 21:05:30 +01:00
parent db1aa2b78e
commit 417b9403fe
2 changed files with 26 additions and 15 deletions

View File

@@ -62,10 +62,10 @@ using namespace ::com::sun::star::io;
class OInputStream : public WeakImplHelper1 < XInputStream > class OInputStream : public WeakImplHelper1 < XInputStream >
{ {
public: public:
OInputStream( const Sequence< sal_Int8 >&seq ) : explicit OInputStream( const Sequence< sal_Int8 >&seq )
nPos( 0 ), : nPos(0)
m_seq( seq ) , m_seq(seq)
{} {}
public: public:
virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )

View File

@@ -98,12 +98,17 @@ class WLevDisPatternMem
sal_Unicode *cp; sal_Unicode *cp;
bool *bp; bool *bp;
public: public:
WLevDisPatternMem( sal_Int32 s ) { cp = new sal_Unicode[ s ]; explicit WLevDisPatternMem( sal_Int32 s )
bp = new bool[ s ]; : cp(new sal_Unicode[s])
} , bp(new bool[s])
~WLevDisPatternMem() { if (cp) delete [] cp; {
if (bp) delete [] bp; }
}
~WLevDisPatternMem()
{
delete [] cp;
delete [] bp;
}
sal_Unicode* GetcPtr() const { return cp; } sal_Unicode* GetcPtr() const { return cp; }
bool* GetbPtr() const { return bp; } bool* GetbPtr() const { return bp; }
}; };
@@ -112,12 +117,18 @@ class WLevDisDistanceMem
{ {
int* p; int* p;
public: public:
WLevDisDistanceMem( size_t s ) { p = 0; NewMem(s); } explicit WLevDisDistanceMem( size_t s )
~WLevDisDistanceMem() { if (p) delete [] p; } : p(0)
{
NewMem(s);
}
~WLevDisDistanceMem() { delete [] p; }
int* GetPtr() const { return p; } int* GetPtr() const { return p; }
int* NewMem( size_t s ) { if (p) delete [] p; int* NewMem( size_t s )
return (p = new int[ s<3 ? 3 : s ]); {
} delete [] p;
return (p = new int[ s<3 ? 3 : s ]);
}
}; };
/** Weighted Levenshtein Distance (WLD) /** Weighted Levenshtein Distance (WLD)