diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2018-07-16 09:53:56 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2018-07-16 11:22:30 +0200 |
commit | 311131fca0242e9465f03b6b1267906790a385c8 (patch) | |
tree | 377c968fb1e239bb97388f0c05f671d921db3832 /vcl/source/gdi/impvect.cxx | |
parent | d41682505503819dab82ced563e4501133924f90 (diff) |
cppcheck: useInitializationList in vcl
reorder members of GIFLZWDecompressor to ease initialization.
use rtl_allocateZeroMemory in ImplVectMap to avoid memset in ctor.
Change-Id: Icfcfe73ec7e52988036995d8dbc604361aee893b
Reviewed-on: https://gerrit.libreoffice.org/57481
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'vcl/source/gdi/impvect.cxx')
-rw-r--r-- | vcl/source/gdi/impvect.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 94680d99255d..0c6acb105fda 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -204,15 +204,13 @@ public: }; ImplVectMap::ImplVectMap( long nWidth, long nHeight ) : + mpBuf ( static_cast<Scanline>(rtl_allocateZeroMemory(nWidth * nHeight)) ), + mpScan ( static_cast<Scanline*>(rtl_allocateMemory(nHeight * sizeof(Scanline))) ), mnWidth ( nWidth ), mnHeight( nHeight ) { const long nWidthAl = ( nWidth >> 2 ) + 1; - const long nSize = nWidthAl * nHeight; - Scanline pTmp = mpBuf = static_cast<Scanline>(rtl_allocateMemory( nSize )); - - memset( mpBuf, 0, nSize ); - mpScan = static_cast<Scanline*>(rtl_allocateMemory( nHeight * sizeof( Scanline ) )); + Scanline pTmp = mpBuf; for( long nY = 0; nY < nHeight; pTmp += nWidthAl ) mpScan[ nY++ ] = pTmp; @@ -281,9 +279,9 @@ public: ImplChain::ImplChain() : mnArraySize ( 1024 ), - mnCount ( 0 ) + mnCount ( 0 ), + mpCodes ( new sal_uInt8[mnArraySize] ) { - mpCodes.reset( new sal_uInt8[ mnArraySize ] ); } void ImplChain::ImplGetSpace() |