Kaydet (Commit) b97aa3fa authored tarafından Daniel Robertson's avatar Daniel Robertson Kaydeden (comit) Noel Grandin

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/17175Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst e5fc4649
...@@ -172,7 +172,7 @@ void GIFLZWCompressor::StartCompression( SvStream& rGIF, sal_uInt16 nPixelSize ) ...@@ -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 ) if( pIDOS )
{ {
......
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
~GIFLZWCompressor(); ~GIFLZWCompressor();
void StartCompression( SvStream& rGIF, sal_uInt16 nPixelSize ); void StartCompression( SvStream& rGIF, sal_uInt16 nPixelSize );
void Compress( HPBYTE pSrc, sal_uLong nSize ); void Compress( sal_uInt8* pSrc, sal_uLong nSize );
void EndCompression(); void EndCompression();
}; };
......
...@@ -31,8 +31,7 @@ ...@@ -31,8 +31,7 @@
// - Memory - // - Memory -
typedef sal_uInt8* HPBYTE; typedef sal_uInt8* Scanline;
typedef HPBYTE Scanline;
typedef const sal_uInt8* ConstScanline; typedef const sal_uInt8* ConstScanline;
...@@ -216,19 +215,19 @@ public: ...@@ -216,19 +215,19 @@ public:
inline sal_uLong GetBlueMask() const; inline sal_uLong GetBlueMask() const;
inline void GetColorFor8Bit( BitmapColor& rColor, const sal_uInt8* pPixel ) 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 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 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 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 GetColorFor32Bit( BitmapColor& rColor, const sal_uInt8* pPixel ) const;
inline void GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8& rAlpha, 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 - // - BitmapBuffer -
...@@ -651,7 +650,7 @@ inline void ColorMask::GetColorFor8Bit( BitmapColor& rColor, const sal_uInt8* pP ...@@ -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 ); 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 ); *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 ...@@ -663,7 +662,7 @@ inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, const sal_uInt8
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor ); 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 ); 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 ...@@ -678,7 +677,7 @@ inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, const sal_uInt8
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor ); 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 ); 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 ...@@ -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 ); 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 ); 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 ); 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& ...@@ -715,7 +714,7 @@ inline void ColorMask::GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8&
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor ); 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 ); 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[ 0 ] = (sal_uInt8) nVal; pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL );
......
...@@ -63,13 +63,13 @@ GIFLZWDecompressor::~GIFLZWDecompressor() ...@@ -63,13 +63,13 @@ GIFLZWDecompressor::~GIFLZWDecompressor()
delete[] pTable; 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& rCount, bool& rEOI )
{ {
sal_uLong nTargetSize = 4096; sal_uLong nTargetSize = 4096;
sal_uLong nCount = 0; sal_uLong nCount = 0;
HPBYTE pTarget = static_cast<HPBYTE>(rtl_allocateMemory( nTargetSize )); sal_uInt8* pTarget = static_cast<sal_uInt8*>(rtl_allocateMemory( nTargetSize ));
HPBYTE pTmpTarget = pTarget; sal_uInt8* pTmpTarget = pTarget;
nBlockBufSize = cBufSize; nBlockBufSize = cBufSize;
nBlockBufPos = 0; nBlockBufPos = 0;
...@@ -83,7 +83,7 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize, ...@@ -83,7 +83,7 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize,
{ {
sal_uLong nNewSize = nTargetSize << 1; sal_uLong nNewSize = nTargetSize << 1;
sal_uLong nOffset = pTmpTarget - pTarget; 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 ); memcpy( pTmp, pTarget, nTargetSize );
rtl_freeMemory( pTarget ); rtl_freeMemory( pTarget );
......
...@@ -26,10 +26,10 @@ struct GIFLZWTableEntry; ...@@ -26,10 +26,10 @@ struct GIFLZWTableEntry;
class GIFLZWDecompressor class GIFLZWDecompressor
{ {
GIFLZWTableEntry* pTable; GIFLZWTableEntry* pTable;
HPBYTE pOutBuf; sal_uInt8* pOutBuf;
HPBYTE pOutBufData; sal_uInt8* pOutBufData;
HPBYTE pBlockBuf; sal_uInt8* pBlockBuf;
sal_uLong nInputBitsBuf; sal_uLong nInputBitsBuf;
sal_uInt16 nTableSize; sal_uInt16 nTableSize;
sal_uInt16 nClearCode; sal_uInt16 nClearCode;
...@@ -38,7 +38,7 @@ class GIFLZWDecompressor ...@@ -38,7 +38,7 @@ class GIFLZWDecompressor
sal_uInt16 nOldCode; sal_uInt16 nOldCode;
sal_uInt16 nOutBufDataLen; sal_uInt16 nOutBufDataLen;
sal_uInt16 nInputBitsBufSize; sal_uInt16 nInputBitsBufSize;
bool bEOIFound; bool bEOIFound;
sal_uInt8 nDataSize; sal_uInt8 nDataSize;
sal_uInt8 nBlockBufSize; sal_uInt8 nBlockBufSize;
sal_uInt8 nBlockBufPos; sal_uInt8 nBlockBufPos;
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
explicit GIFLZWDecompressor( sal_uInt8 cDataSize ); explicit GIFLZWDecompressor( sal_uInt8 cDataSize );
~GIFLZWDecompressor(); ~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 #endif
......
...@@ -420,8 +420,8 @@ sal_uLong GIFReader::ReadNextBlock() ...@@ -420,8 +420,8 @@ sal_uLong GIFReader::ReadNextBlock()
nRet = 3UL; nRet = 3UL;
else else
{ {
bool bEOI; bool bEOI;
HPBYTE pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, bEOI ); sal_uInt8* pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, bEOI );
nRet = ( bEOI ? 3 : 1 ); nRet = ( bEOI ? 3 : 1 );
...@@ -437,7 +437,7 @@ sal_uLong GIFReader::ReadNextBlock() ...@@ -437,7 +437,7 @@ sal_uLong GIFReader::ReadNextBlock()
return nRet; 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++ ) for( sal_uLong i = 0UL; i < nCount; i++ )
{ {
...@@ -457,9 +457,9 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount ) ...@@ -457,9 +457,9 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount )
// ( happens at the end of the image ) // ( happens at the end of the image )
if( ( nMinY > nLastImageY ) && ( nLastImageY < ( nImageHeight - 1 ) ) ) if( ( nMinY > nLastImageY ) && ( nLastImageY < ( nImageHeight - 1 ) ) )
{ {
HPBYTE pScanline8 = pAcc8->GetScanline( nYAcc ); sal_uInt8* pScanline8 = pAcc8->GetScanline( nYAcc );
sal_uLong nSize8 = pAcc8->GetScanlineSize(); sal_uLong nSize8 = pAcc8->GetScanlineSize();
HPBYTE pScanline1 = 0; sal_uInt8* pScanline1 = 0;
sal_uLong nSize1 = 0; sal_uLong nSize1 = 0;
if( bGCTransparent ) if( bGCTransparent )
......
...@@ -57,7 +57,7 @@ class GIFReader : public GraphicReader ...@@ -57,7 +57,7 @@ class GIFReader : public GraphicReader
BitmapPalette aGPalette; BitmapPalette aGPalette;
BitmapPalette aLPalette; BitmapPalette aLPalette;
SvStream& rIStm; SvStream& rIStm;
HPBYTE pSrcBuf; sal_uInt8* pSrcBuf;
GIFLZWDecompressor* pDecomp; GIFLZWDecompressor* pDecomp;
BitmapWriteAccess* pAcc8; BitmapWriteAccess* pAcc8;
BitmapWriteAccess* pAcc1; BitmapWriteAccess* pAcc1;
...@@ -97,7 +97,7 @@ class GIFReader : public GraphicReader ...@@ -97,7 +97,7 @@ class GIFReader : public GraphicReader
bool ReadExtension(); bool ReadExtension();
bool ReadLocalHeader(); bool ReadLocalHeader();
sal_uLong ReadNextBlock(); sal_uLong ReadNextBlock();
void FillImages( HPBYTE pBytes, sal_uLong nCount ); void FillImages( sal_uInt8* pBytes, sal_uLong nCount );
void CreateNewBitmaps(); void CreateNewBitmaps();
bool ProcessGIF(); bool ProcessGIF();
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
// - Inlines - // - 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 ]; BYTE& rByte = pScanline[ nX >> 1 ];
...@@ -951,11 +951,11 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode ...@@ -951,11 +951,11 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode
void WinSalBitmap::ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf, void WinSalBitmap::ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
const Size& rSizePixel, bool bRLE4 ) const Size& rSizePixel, bool bRLE4 )
{ {
HPBYTE pRLE = (HPBYTE) pSrcBuf; sal_uInt8* pRLE = (sal_uInt8*) pSrcBuf;
HPBYTE pDIB = (HPBYTE) pDstBuf; sal_uInt8* pDIB = (sal_uInt8*) pDstBuf;
HPBYTE pRow = (HPBYTE) pDstBuf; sal_uInt8* pRow = (sal_uInt8*) pDstBuf;
sal_uLong nWidthAl = AlignedWidth4Bytes( rSizePixel.Width() * ( bRLE4 ? 4UL : 8UL ) ); 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 nCountByte;
sal_uLong nRunByte; sal_uLong nRunByte;
sal_uLong i; sal_uLong i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment