From 0526aa64c2eba08b218f3811866ab0cc507ac99b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 22 Apr 2014 09:09:20 +0100 Subject: coverity#708207 Uninitialized scalar field Change-Id: I8d74ddcf551e4a853dcf04a4ba1f33a46579ed06 --- include/tools/bigint.hxx | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/tools/bigint.hxx b/include/tools/bigint.hxx index 387d663639f0..e90f91b5dce2 100644 --- a/include/tools/bigint.hxx +++ b/include/tools/bigint.hxx @@ -58,7 +58,14 @@ private: TOOLS_DLLPRIVATE bool ABS_IsLess(BigInt const &) const; public: - BigInt(); + BigInt() + : nVal(0) + , nLen(0) + , bIsNeg(false) + , bIsBig(false) + , bIsSet(false) + { + } BigInt(short nValue) : nVal(nValue) @@ -86,14 +93,24 @@ public: , bIsSet(true) { } - BigInt( double nVal ); - BigInt( sal_uInt16 nVal ); - BigInt( sal_uInt32 nVal ); - BigInt( const BigInt& rBigInt ); - BigInt( const OUString& rString ); + + BigInt( double nVal ); + + BigInt(sal_uInt16 nValue) + : nVal(nValue) + , nLen(0) + , bIsNeg(false) + , bIsBig(false) + , bIsSet(true) + { + } + + BigInt( sal_uInt32 nVal ); + BigInt( const BigInt& rBigInt ); + BigInt( const OUString& rString ); #ifdef _TLBIGINT_INT64 - BigInt( const SbxINT64 &r ); - BigInt( const SbxUINT64 &r ); + BigInt( const SbxINT64 &r ); + BigInt( const SbxUINT64 &r ); #endif operator short() const; @@ -144,20 +161,6 @@ public: friend class Fraction; }; -inline BigInt::BigInt() -{ - bIsSet = false; - bIsBig = false; - nVal = 0; -} - -inline BigInt::BigInt( sal_uInt16 nValue ) -{ - bIsSet = true; - bIsBig = false; - nVal = nValue; -} - inline BigInt::operator short() const { if ( !bIsBig && nVal >= SHRT_MIN && nVal <= SHRT_MAX ) -- cgit