diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-08-31 14:14:50 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-08-31 16:34:15 +0000 |
commit | f322c52b89f514b792179c4d7e6ee2c3aa893a4e (patch) | |
tree | 0abd175058dd939b1cb0379c4dd4a9355c2d7997 /rsc/source | |
parent | 2a1431208e4292e8563935f5e8cd0107113f65ea (diff) |
use initializer list ctors for res types
make nSize and nOffInstData const,
let Size() return fixed sizes
Change-Id: I7e2792e1cd990e65582020353054087f94856151
Reviewed-on: https://gerrit.libreoffice.org/28545
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'rsc/source')
-rw-r--r-- | rsc/source/res/rscarray.cxx | 9 | ||||
-rw-r--r-- | rsc/source/res/rscclass.cxx | 7 | ||||
-rw-r--r-- | rsc/source/res/rscclobj.cxx | 9 | ||||
-rw-r--r-- | rsc/source/res/rscconst.cxx | 4 | ||||
-rw-r--r-- | rsc/source/res/rsccont.cxx | 14 | ||||
-rw-r--r-- | rsc/source/res/rscflag.cxx | 6 | ||||
-rw-r--r-- | rsc/source/res/rscmgr.cxx | 2 | ||||
-rw-r--r-- | rsc/source/res/rscrange.cxx | 12 | ||||
-rw-r--r-- | rsc/source/res/rscstr.cxx | 3 | ||||
-rw-r--r-- | rsc/source/res/rsctop.cxx | 2 |
10 files changed, 27 insertions, 41 deletions
diff --git a/rsc/source/res/rscarray.cxx b/rsc/source/res/rscarray.cxx index 595963b67ebc..b73c9324d239 100644 --- a/rsc/source/res/rscarray.cxx +++ b/rsc/source/res/rscarray.cxx @@ -26,9 +26,8 @@ #include <rscarray.hxx> #include <rscdb.hxx> -RscInstNode::RscInstNode( sal_uInt32 nId ) +RscInstNode::RscInstNode(sal_uInt32 nId) : nTypeId(nId) { - nTypeId = nId; } RscInstNode::~RscInstNode() @@ -47,10 +46,10 @@ sal_uInt32 RscInstNode::GetId() const RscArray::RscArray( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper, RscEnum * pTypeCl ) : RscTop( nId, nTypeId, pSuper ) + , pTypeClass(pTypeCl) + , nOffInstData(RscTop::Size()) + , nSize(nOffInstData + ALIGNED_SIZE(sizeof(RscArrayInst))) { - pTypeClass = pTypeCl; - nOffInstData = RscTop::Size(); - nSize = nOffInstData + ALIGNED_SIZE( sizeof( RscArrayInst ) ); } RscArray::~RscArray() diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx index 27500f60cf4a..366d6836b068 100644 --- a/rsc/source/res/rscclass.cxx +++ b/rsc/source/res/rscclass.cxx @@ -30,11 +30,10 @@ RscClass::RscClass( Atom nId, sal_uInt32 nTypeId, RscTop * pSuperCl ) : RscTop( nId, nTypeId, pSuperCl ) + , nSuperSize(RscTop::Size()) + , nSize(nSuperSize + ALIGNED_SIZE(sizeof(RscClassInst ))) + , nEntries(0), pVarTypeList(nullptr) { - nEntries = 0; - pVarTypeList = nullptr; - nSuperSize = RscTop::Size(); - nSize = nSuperSize + ALIGNED_SIZE( sizeof( RscClassInst ) ); } void RscClass::Pre_dtor() diff --git a/rsc/source/res/rscclobj.cxx b/rsc/source/res/rscclobj.cxx index 940163644632..993be7fbd285 100644 --- a/rsc/source/res/rscclobj.cxx +++ b/rsc/source/res/rscclobj.cxx @@ -23,9 +23,8 @@ RefNode::RefNode( Atom nTyp ) + : nTypNameId(nTyp), pObjBiTree(nullptr) { - pObjBiTree = nullptr; - nTypNameId = nTyp; } sal_uInt32 RefNode::GetId() const @@ -58,10 +57,10 @@ ObjNode * RefNode::GetObjNode( const RscId & rRscId ) } ObjNode::ObjNode( const RscId & rId, CLASS_DATA pData, sal_uLong lKey ) + : aRscId(rId) + , pRscObj(pData) + , lFileKey(lKey) { - pRscObj = pData; - aRscId = rId; - lFileKey = lKey; } ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ) diff --git a/rsc/source/res/rscconst.cxx b/rsc/source/res/rscconst.cxx index a61af44b2a47..f45045b9d1da 100644 --- a/rsc/source/res/rscconst.cxx +++ b/rsc/source/res/rscconst.cxx @@ -28,9 +28,8 @@ RscConst::RscConst( Atom nId, sal_uInt32 nTypeId ) : RscTop( nId, nTypeId ) + , pVarArray(nullptr), nEntries(0) { - pVarArray = nullptr; - nEntries = 0; } RscConst::~RscConst() @@ -102,7 +101,6 @@ sal_uInt32 RscConst::GetConstPos( Atom nConst ) RscEnum::RscEnum( Atom nId, sal_uInt32 nTypeId ) : RscConst( nId, nTypeId ) { - nSize = ALIGNED_SIZE( sizeof( RscEnumInst ) ); } ERRTYPE RscEnum::SetConst( const RSCINST & rInst, Atom nConst, sal_Int32 /*nVal*/ ) diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx index 012aa28c0d4d..c3bf6193e6fa 100644 --- a/rsc/source/res/rsccont.cxx +++ b/rsc/source/res/rsccont.cxx @@ -37,14 +37,12 @@ void ENTRY_STRUCT::Destroy() RscBaseCont::RscBaseCont( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper, bool bNoIdent ) - : RscTop( nId, nTypeId, pSuper ) - , nSize( 0 ) -{ - pTypeClass = nullptr; - pTypeClass1 = nullptr; - bNoId = bNoIdent; - nOffInstData = RscTop::Size(); - nSize = nOffInstData + ALIGNED_SIZE( sizeof( RscBaseContInst ) ); + : RscTop(nId, nTypeId, pSuper) + , pTypeClass(nullptr), pTypeClass1(nullptr) + , bNoId(bNoIdent), nOffInstData(RscTop::Size()) + , nSize(nOffInstData + ALIGNED_SIZE(sizeof(RscBaseContInst))) + +{ } RscBaseCont::~RscBaseCont() diff --git a/rsc/source/res/rscflag.cxx b/rsc/source/res/rscflag.cxx index 1c4b04ba1974..4ac6473294cc 100644 --- a/rsc/source/res/rscflag.cxx +++ b/rsc/source/res/rscflag.cxx @@ -29,7 +29,7 @@ RscFlag::RscFlag( Atom nId, sal_uInt32 nTypeId ) { } -sal_uInt32 RscFlag::Size() +sal_uInt32 RscFlag::Size() const { return ALIGNED_SIZE( sizeof( RscFlagInst ) * ( 1 + (nEntries -1) / (sizeof( sal_uInt32 ) * 8) ) ); @@ -294,10 +294,8 @@ ERRTYPE RscFlag::WriteRc( const RSCINST & rInst, RscWriteRc & aMem, RscClient::RscClient( Atom nId, sal_uInt32 nTypeId, RscFlag * pClass, Atom nConstantId ) - : RscTop ( nId, nTypeId ) + : RscTop(nId, nTypeId), pRefClass(pClass), nConstId(nConstantId) { - pRefClass = pClass; - nConstId = nConstantId; } RSCCLASS_TYPE RscClient::GetClassType() const diff --git a/rsc/source/res/rscmgr.cxx b/rsc/source/res/rscmgr.cxx index 682ea0c6ecef..2de220dca5f1 100644 --- a/rsc/source/res/rscmgr.cxx +++ b/rsc/source/res/rscmgr.cxx @@ -31,7 +31,7 @@ RscMgr::RscMgr( Atom nId, sal_uInt32 nTypeId, RscTop * pSuperCl ) { } -sal_uInt32 RscMgr::Size() +sal_uInt32 RscMgr::Size() const { return RscClass::Size() + ALIGNED_SIZE( sizeof( RscMgrInst ) ); } diff --git a/rsc/source/res/rscrange.cxx b/rsc/source/res/rscrange.cxx index 6e379ffdcc64..d243ca8a4be7 100644 --- a/rsc/source/res/rscrange.cxx +++ b/rsc/source/res/rscrange.cxx @@ -26,9 +26,8 @@ RscRange::RscRange( Atom nId, sal_uInt32 nTypeId ) : RscTop( nId, nTypeId ) + , nMin(0), nMax(0) { - nMin = nMax = 0; - nSize = ALIGNED_SIZE( sizeof( RscRangeInst ) ); } RSCCLASS_TYPE RscRange::GetClassType() const @@ -138,9 +137,8 @@ ERRTYPE RscRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem, RscLongRange::RscLongRange( Atom nId, sal_uInt32 nTypeId ) : RscTop( nId, nTypeId ) + , nMin(0), nMax(0) { - nMin = nMax = 0; - nSize = ALIGNED_SIZE( sizeof( RscLongRangeInst ) ); } RSCCLASS_TYPE RscLongRange::GetClassType() const @@ -256,9 +254,8 @@ ERRTYPE RscLongEnumRange::SetConst( const RSCINST & rInst, Atom /*nConst*/, RscIdRange::RscIdRange( Atom nId, sal_uInt32 nTypeId ) : RscTop( nId, nTypeId ) + , nMin(0), nMax(0) { - nSize = ALIGNED_SIZE( sizeof( RscId ) ); - nMin = nMax = 0; } RSCCLASS_TYPE RscIdRange::GetClassType() const @@ -416,9 +413,8 @@ void RscBool::WriteSrc( const RSCINST & rInst, FILE * fOutput, } RscBreakRange::RscBreakRange( Atom nId, sal_uInt32 nTypeId ) - : RscRange( nId, nTypeId ) + : RscRange(nId, nTypeId), nOutRange(0xFFFFFFFF) { - nOutRange = 0xFFFFFFFF; } ERRTYPE RscBreakRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue ) diff --git a/rsc/source/res/rscstr.cxx b/rsc/source/res/rscstr.cxx index 5bd886e44460..f03bf4e8d350 100644 --- a/rsc/source/res/rscstr.cxx +++ b/rsc/source/res/rscstr.cxx @@ -30,9 +30,8 @@ RscString::RscString( Atom nId, sal_uInt32 nTypeId ) : RscTop( nId, nTypeId ) + , pRefClass(nullptr) { - nSize = ALIGNED_SIZE( sizeof( RscStringInst ) ); - pRefClass = nullptr; } RSCCLASS_TYPE RscString::GetClassType() const diff --git a/rsc/source/res/rsctop.cxx b/rsc/source/res/rsctop.cxx index 47fa95a7f1bd..bf172951dab4 100644 --- a/rsc/source/res/rsctop.cxx +++ b/rsc/source/res/rsctop.cxx @@ -66,7 +66,7 @@ RscTop * RscTop::GetTypeClass() const return nullptr; } -sal_uInt32 RscTop::Size() +sal_uInt32 RscTop::Size() const { if( pSuperClass ) return pSuperClass->Size(); |