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 >
{
public:
OInputStream( const Sequence< sal_Int8 >&seq ) :
nPos( 0 ),
m_seq( seq )
{}
explicit OInputStream( const Sequence< sal_Int8 >&seq )
: nPos(0)
, m_seq(seq)
{}
public:
virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )

View File

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