[Libreoffice-commits] core.git: filter/source include/vcl vcl/source vcl/win

Daniel Robertson danlrobertson89 at gmail.com
Tue Jul 28 23:51:58 PDT 2015


 filter/source/graphicfilter/egif/giflzwc.cxx |    2 +-
 filter/source/graphicfilter/egif/giflzwc.hxx |    2 +-
 include/vcl/salbtype.hxx                     |   23 +++++++++++------------
 vcl/source/filter/igif/decode.cxx            |    8 ++++----
 vcl/source/filter/igif/decode.hxx            |   12 ++++++------
 vcl/source/filter/igif/gifread.cxx           |   10 +++++-----
 vcl/source/filter/igif/gifread.hxx           |    4 ++--
 vcl/win/source/gdi/salbmp.cxx                |   10 +++++-----
 8 files changed, 35 insertions(+), 36 deletions(-)

New commits:
commit b97aa3faa03e5944aac8f3c35a8c198fba295e83
Author: Daniel Robertson <danlrobertson89 at gmail.com>
Date:   Fri Jul 17 12:28:01 2015 -0400

    Remove the unnecessary type definition: HPBYTE
    
    HPBYTE is a duplicate defintion of Scanline as seen below.
    
    include/vcl/salbtype.hxx:
    
    34: typedef sal_uInt8*        HPBYTE;
    35: typedef HPBYTE            Scanline;
    
    Remove the definition of HPBYTE and inline the definition of
    Scanline. Replace all instances with sal_uInt8*.
    
    Change-Id: I8a79a9d6c45af57fbabf8d3e6a04a1b5eba15a7b
    Reviewed-on: https://gerrit.libreoffice.org/17175
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/filter/source/graphicfilter/egif/giflzwc.cxx b/filter/source/graphicfilter/egif/giflzwc.cxx
index 49d996a..f845c9c 100644
--- a/filter/source/graphicfilter/egif/giflzwc.cxx
+++ b/filter/source/graphicfilter/egif/giflzwc.cxx
@@ -172,7 +172,7 @@ void GIFLZWCompressor::StartCompression( SvStream& rGIF, sal_uInt16 nPixelSize )
 
 
 
-void GIFLZWCompressor::Compress( HPBYTE pSrc, sal_uLong nSize )
+void GIFLZWCompressor::Compress( sal_uInt8* pSrc, sal_uLong nSize )
 {
     if( pIDOS )
     {
diff --git a/filter/source/graphicfilter/egif/giflzwc.hxx b/filter/source/graphicfilter/egif/giflzwc.hxx
index 992e51c..6159e55 100644
--- a/filter/source/graphicfilter/egif/giflzwc.hxx
+++ b/filter/source/graphicfilter/egif/giflzwc.hxx
@@ -48,7 +48,7 @@ public:
                                 ~GIFLZWCompressor();
 
     void                        StartCompression( SvStream& rGIF, sal_uInt16 nPixelSize );
-    void                        Compress( HPBYTE pSrc, sal_uLong nSize );
+    void                        Compress( sal_uInt8* pSrc, sal_uLong nSize );
     void                        EndCompression();
 };
 
diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index f4ce3cb..673c285 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -31,8 +31,7 @@
 
 // - Memory -
 
-typedef sal_uInt8*        HPBYTE;
-typedef HPBYTE            Scanline;
+typedef sal_uInt8*        Scanline;
 typedef const sal_uInt8*  ConstScanline;
 
 
@@ -216,19 +215,19 @@ public:
     inline sal_uLong    GetBlueMask() const;
 
     inline void         GetColorFor8Bit( BitmapColor& rColor, const sal_uInt8* pPixel ) const;
-    inline void         SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
+    inline void         SetColorFor8Bit( const BitmapColor& rColor, sal_uInt8* pPixel ) const;
 
     inline void         GetColorFor16BitMSB( BitmapColor& rColor, const sal_uInt8* pPixel ) const;
-    inline void         SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pPixel ) const;
+    inline void         SetColorFor16BitMSB( const BitmapColor& rColor, sal_uInt8* pPixel ) const;
     inline void         GetColorFor16BitLSB( BitmapColor& rColor, const sal_uInt8* pPixel ) const;
-    inline void         SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pPixel ) const;
+    inline void         SetColorFor16BitLSB( const BitmapColor& rColor, sal_uInt8* pPixel ) const;
 
     inline void         GetColorFor24Bit( BitmapColor& rColor, const sal_uInt8* pPixel ) const;
-    inline void         SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
+    inline void         SetColorFor24Bit( const BitmapColor& rColor, sal_uInt8* pPixel ) const;
 
     inline void         GetColorFor32Bit( BitmapColor& rColor, const sal_uInt8* pPixel ) const;
     inline void         GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8& rAlpha, const sal_uInt8* pPixel ) const;
-    inline void         SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
+    inline void         SetColorFor32Bit( const BitmapColor& rColor, sal_uInt8* pPixel ) const;
 };
 
 // - BitmapBuffer -
@@ -651,7 +650,7 @@ inline void ColorMask::GetColorFor8Bit( BitmapColor& rColor, const sal_uInt8* pP
     MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
 }
 
-inline void ColorMask::SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
+inline void ColorMask::SetColorFor8Bit( const BitmapColor& rColor, sal_uInt8* pPixel ) const
 {
     *pPixel = (sal_uInt8) COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, mnAlphaChannel );
 }
@@ -663,7 +662,7 @@ inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, const sal_uInt8
     MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
 }
 
-inline void ColorMask::SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pPixel ) const
+inline void ColorMask::SetColorFor16BitMSB( const BitmapColor& rColor, sal_uInt8* pPixel ) const
 {
     const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, mnAlphaChannel );
 
@@ -678,7 +677,7 @@ inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, const sal_uInt8
     MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
 }
 
-inline void ColorMask::SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pPixel ) const
+inline void ColorMask::SetColorFor16BitLSB( const BitmapColor& rColor, sal_uInt8* pPixel ) const
 {
     const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, mnAlphaChannel );
 
@@ -692,7 +691,7 @@ inline void ColorMask::GetColorFor24Bit( BitmapColor& rColor, const sal_uInt8* p
     MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
 }
 
-inline void ColorMask::SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
+inline void ColorMask::SetColorFor24Bit( const BitmapColor& rColor, sal_uInt8* pPixel ) const
 {
     const sal_uInt32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, mnAlphaChannel );
     pPixel[ 0 ] = (sal_uInt8) nVal; pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL ); pPixel[ 2 ] = (sal_uInt8) ( nVal >> 16UL );
@@ -715,7 +714,7 @@ inline void ColorMask::GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8&
     MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
 }
 
-inline void ColorMask::SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
+inline void ColorMask::SetColorFor32Bit( const BitmapColor& rColor, sal_uInt8* pPixel ) const
 {
     const sal_uInt32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, mnAlphaChannel );
     pPixel[ 0 ] = (sal_uInt8) nVal; pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL );
diff --git a/vcl/source/filter/igif/decode.cxx b/vcl/source/filter/igif/decode.cxx
index 0008f63..00d7e75 100644
--- a/vcl/source/filter/igif/decode.cxx
+++ b/vcl/source/filter/igif/decode.cxx
@@ -63,13 +63,13 @@ GIFLZWDecompressor::~GIFLZWDecompressor()
     delete[] pTable;
 }
 
-HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize,
+Scanline GIFLZWDecompressor::DecompressBlock( sal_uInt8* pSrc, sal_uInt8 cBufSize,
                                             sal_uLong& rCount, bool& rEOI )
 {
     sal_uLong   nTargetSize = 4096;
     sal_uLong   nCount = 0;
-    HPBYTE  pTarget = static_cast<HPBYTE>(rtl_allocateMemory( nTargetSize ));
-    HPBYTE  pTmpTarget = pTarget;
+    sal_uInt8*  pTarget = static_cast<sal_uInt8*>(rtl_allocateMemory( nTargetSize ));
+    sal_uInt8*  pTmpTarget = pTarget;
 
     nBlockBufSize = cBufSize;
     nBlockBufPos = 0;
@@ -83,7 +83,7 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize,
         {
             sal_uLong   nNewSize = nTargetSize << 1;
             sal_uLong   nOffset = pTmpTarget - pTarget;
-            HPBYTE  pTmp = static_cast<HPBYTE>(rtl_allocateMemory( nNewSize ));
+            sal_uInt8*  pTmp = static_cast<sal_uInt8*>(rtl_allocateMemory( nNewSize ));
 
             memcpy( pTmp, pTarget, nTargetSize );
             rtl_freeMemory( pTarget );
diff --git a/vcl/source/filter/igif/decode.hxx b/vcl/source/filter/igif/decode.hxx
index 4f5edde..93840f1 100644
--- a/vcl/source/filter/igif/decode.hxx
+++ b/vcl/source/filter/igif/decode.hxx
@@ -26,10 +26,10 @@ struct GIFLZWTableEntry;
 
 class GIFLZWDecompressor
 {
-    GIFLZWTableEntry*   pTable;
-    HPBYTE              pOutBuf;
-    HPBYTE              pOutBufData;
-    HPBYTE              pBlockBuf;
+    GIFLZWTableEntry*       pTable;
+    sal_uInt8*              pOutBuf;
+    sal_uInt8*              pOutBufData;
+    sal_uInt8*              pBlockBuf;
     sal_uLong               nInputBitsBuf;
     sal_uInt16              nTableSize;
     sal_uInt16              nClearCode;
@@ -38,7 +38,7 @@ class GIFLZWDecompressor
     sal_uInt16              nOldCode;
     sal_uInt16              nOutBufDataLen;
     sal_uInt16              nInputBitsBufSize;
-    bool                bEOIFound;
+    bool                    bEOIFound;
     sal_uInt8               nDataSize;
     sal_uInt8               nBlockBufSize;
     sal_uInt8               nBlockBufPos;
@@ -51,7 +51,7 @@ public:
     explicit GIFLZWDecompressor( sal_uInt8 cDataSize );
                         ~GIFLZWDecompressor();
 
-    HPBYTE              DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize, sal_uLong& rCount, bool& rEOI );
+    sal_uInt8*          DecompressBlock( sal_uInt8* pSrc, sal_uInt8 cBufSize, sal_uLong& rCount, bool& rEOI );
 };
 
 #endif
diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx
index 96bea22..e24b2e1 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -420,8 +420,8 @@ sal_uLong GIFReader::ReadNextBlock()
                     nRet = 3UL;
                 else
                 {
-                    bool    bEOI;
-                    HPBYTE  pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, bEOI );
+                    bool       bEOI;
+                    sal_uInt8* pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, bEOI );
 
                     nRet = ( bEOI ? 3 : 1 );
 
@@ -437,7 +437,7 @@ sal_uLong GIFReader::ReadNextBlock()
     return nRet;
 }
 
-void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount )
+void GIFReader::FillImages( sal_uInt8* pBytes, sal_uLong nCount )
 {
     for( sal_uLong i = 0UL; i < nCount; i++ )
     {
@@ -457,9 +457,9 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount )
                     // ( happens at the end of the image )
                     if( ( nMinY > nLastImageY ) && ( nLastImageY < ( nImageHeight - 1 ) ) )
                     {
-                        HPBYTE  pScanline8 = pAcc8->GetScanline( nYAcc );
+                        sal_uInt8*  pScanline8 = pAcc8->GetScanline( nYAcc );
                         sal_uLong   nSize8 = pAcc8->GetScanlineSize();
-                        HPBYTE  pScanline1 = 0;
+                        sal_uInt8*  pScanline1 = 0;
                         sal_uLong   nSize1 = 0;
 
                         if( bGCTransparent )
diff --git a/vcl/source/filter/igif/gifread.hxx b/vcl/source/filter/igif/gifread.hxx
index dc161c2..52a4f1f 100644
--- a/vcl/source/filter/igif/gifread.hxx
+++ b/vcl/source/filter/igif/gifread.hxx
@@ -57,7 +57,7 @@ class GIFReader : public GraphicReader
     BitmapPalette       aGPalette;
     BitmapPalette       aLPalette;
     SvStream&           rIStm;
-    HPBYTE              pSrcBuf;
+    sal_uInt8*          pSrcBuf;
     GIFLZWDecompressor* pDecomp;
     BitmapWriteAccess*  pAcc8;
     BitmapWriteAccess*  pAcc1;
@@ -97,7 +97,7 @@ class GIFReader : public GraphicReader
     bool                ReadExtension();
     bool                ReadLocalHeader();
     sal_uLong           ReadNextBlock();
-    void                FillImages( HPBYTE pBytes, sal_uLong nCount );
+    void                FillImages( sal_uInt8* pBytes, sal_uLong nCount );
     void                CreateNewBitmaps();
     bool                ProcessGIF();
 
diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx
index 42088b7..52c2878 100644
--- a/vcl/win/source/gdi/salbmp.cxx
+++ b/vcl/win/source/gdi/salbmp.cxx
@@ -51,7 +51,7 @@
 
 // - Inlines -
 
-inline void ImplSetPixel4( const HPBYTE pScanline, long nX, const BYTE cIndex )
+inline void ImplSetPixel4( const sal_uInt8* pScanline, long nX, const BYTE cIndex )
 {
     BYTE& rByte = pScanline[ nX >> 1 ];
 
@@ -951,11 +951,11 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode
 void WinSalBitmap::ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
                                      const Size& rSizePixel, bool bRLE4 )
 {
-    HPBYTE          pRLE = (HPBYTE) pSrcBuf;
-    HPBYTE          pDIB = (HPBYTE) pDstBuf;
-    HPBYTE          pRow = (HPBYTE) pDstBuf;
+    sal_uInt8*      pRLE = (sal_uInt8*) pSrcBuf;
+    sal_uInt8*      pDIB = (sal_uInt8*) pDstBuf;
+    sal_uInt8*      pRow = (sal_uInt8*) pDstBuf;
     sal_uLong           nWidthAl = AlignedWidth4Bytes( rSizePixel.Width() * ( bRLE4 ? 4UL : 8UL ) );
-    HPBYTE          pLast = pDIB + rSizePixel.Height() * nWidthAl - 1;
+    sal_uInt8*      pLast = pDIB + rSizePixel.Height() * nWidthAl - 1;
     sal_uLong           nCountByte;
     sal_uLong           nRunByte;
     sal_uLong           i;


More information about the Libreoffice-commits mailing list