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 )
void GIFLZWCompressor::Compress( HPBYTE pSrc, sal_uLong nSize )
void GIFLZWCompressor::Compress( sal_uInt8* pSrc, sal_uLong nSize )
{
if( pIDOS )
{
......
......@@ -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();
};
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -27,9 +27,9 @@ struct GIFLZWTableEntry;
class GIFLZWDecompressor
{
GIFLZWTableEntry* pTable;
HPBYTE pOutBuf;
HPBYTE pOutBufData;
HPBYTE pBlockBuf;
sal_uInt8* pOutBuf;
sal_uInt8* pOutBufData;
sal_uInt8* pBlockBuf;
sal_uLong nInputBitsBuf;
sal_uInt16 nTableSize;
sal_uInt16 nClearCode;
......@@ -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
......
......@@ -421,7 +421,7 @@ sal_uLong GIFReader::ReadNextBlock()
else
{
bool bEOI;
HPBYTE pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, 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 )
......
......@@ -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();
......
......@@ -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;
......
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