summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-02 11:28:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-02 11:28:51 +0200
commitc56a8863cde2ccd96dc6b75ad2c7d208c8190414 (patch)
tree2845284704ae482af3ba1f907bbe5239bba49c00
parent132e8ca43e4f28c2b4b9842ce2b977e0f25b0730 (diff)
loplugin:cstylecast: deal with those that are (technically) const_cast
Change-Id: I1a9aa868d3724a7d14c181e45d956cdf2423e40c
-rw-r--r--vcl/generic/fontmanager/fontconfig.cxx2
-rw-r--r--vcl/generic/fontmanager/fontmanager.cxx2
-rw-r--r--vcl/generic/print/genpspgraphics.cxx2
-rw-r--r--vcl/headless/svpbmp.cxx2
-rw-r--r--vcl/inc/ilstbox.hxx2
-rw-r--r--vcl/quartz/ctfonts.cxx2
-rw-r--r--vcl/source/filter/jpeg/JpegReader.cxx6
-rw-r--r--vcl/source/filter/jpeg/jpegc.cxx4
-rw-r--r--vcl/source/gdi/bmpacc.cxx4
-rw-r--r--vcl/source/gdi/dibtools.cxx6
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2
-rw-r--r--vcl/source/gdi/salgdilayout.cxx4
-rw-r--r--vcl/source/outdev/polygon.cxx2
-rw-r--r--vcl/source/window/window.cxx2
-rw-r--r--vcl/unx/gtk/window/gtksalmenu.cxx4
15 files changed, 23 insertions, 23 deletions
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index 756173607afb..59ed6aee9bd8 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -671,7 +671,7 @@ bool PrintFontManager::addFontconfigDir( const OString& rDirName )
const int nVersion = FcGetVersion();
if( nVersion <= 20400 )
return false;
- const char* pDirName = (const char*)rDirName.getStr();
+ const char* pDirName = rDirName.getStr();
bool bDirOk = (FcConfigAppFontAddDir(FcConfigGetCurrent(), reinterpret_cast<FcChar8 const *>(pDirName) ) == FcTrue);
#if OSL_DEBUG_LEVEL > 1
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index b90abdce98e5..2f4b49a09f3e 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -2190,7 +2190,7 @@ std::list< OString > PrintFontManager::getAdobeNameFromUnicode( sal_Unicode aCha
if( aRet.begin() == aRet.end() && aChar != 0 )
{
sal_Char aBuf[8];
- sal_Int32 nChars = snprintf( (char*)aBuf, sizeof( aBuf ), "uni%.4hX", aChar );
+ sal_Int32 nChars = snprintf( aBuf, sizeof( aBuf ), "uni%.4hX", aChar );
aRet.push_back( OString( aBuf, nChars ) );
}
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 0a1bedc6f95d..e6df23672fae 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -479,7 +479,7 @@ bool GenPspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt8* const* pFlgAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
- m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, reinterpret_cast<Point const * const *>(pPtAry), (sal_uInt8**)pFlgAry);
+ m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, reinterpret_cast<Point const * const *>(pPtAry), pFlgAry);
return true;
}
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index 901526ea7fea..a63a5fe040e0 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -245,7 +245,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( BitmapAccessMode )
pBuf->mnHeight = aSize.getY();
pBuf->mnScanlineSize = m_aBitmap->getScanlineStride();
pBuf->mnBitCount = nBitCount;
- pBuf->mpBits = (sal_uInt8*)m_aBitmap->getBuffer().get();
+ pBuf->mpBits = m_aBitmap->getBuffer().get();
if( nBitCount <= 8 )
{
if( m_aBitmap->getScanlineFormat() == FORMAT_EIGHT_BIT_GREY ||
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index 363483e209f7..39746dc7f35f 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -112,7 +112,7 @@ public:
sal_Int32 InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry, bool bSort );
void RemoveEntry( sal_Int32 nPos );
- const ImplEntryType* GetEntryPtr( sal_Int32 nPos ) const { return (const ImplEntryType*) GetEntry( nPos ); }
+ const ImplEntryType* GetEntryPtr( sal_Int32 nPos ) const { return GetEntry( nPos ); }
ImplEntryType* GetMutableEntryPtr( sal_Int32 nPos ) const { return GetEntry( nPos ); }
void Clear();
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 16cde931b610..607fbd9f62c8 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -249,7 +249,7 @@ int CoreTextFontData::GetFontTable( const char pTagName[5], unsigned char* pResu
if( pResultBuf && (nByteLength > 0))
{
const CFRange aFullRange = CFRangeMake( 0, nByteLength);
- CFDataGetBytes( pDataRef, aFullRange, (UInt8*)pResultBuf);
+ CFDataGetBytes( pDataRef, aFullRange, reinterpret_cast<UInt8*>(pResultBuf));
}
CFRelease( pDataRef);
diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx
index 5785224a7602..24b2626ebc5f 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -327,7 +327,7 @@ void JPEGReader::FillBitmap()
for( long nY = 0L; nY < nHeight; nY++ )
{
- pTmp = (sal_uInt8*) mpBuffer + nY * nAlignedWidth;
+ pTmp = mpBuffer + nY * nAlignedWidth;
for( long nX = 0L; nX < nWidth; nX++ )
{
@@ -351,7 +351,7 @@ void JPEGReader::FillBitmap()
// then CopyScanline can use a memcpy to do the data transport. CopyScanline can also
// do the needed conversion from BMP_FORMAT_24BIT_TC_RGB (and it works well), but this
// is not faster that the old loop below using SetPixel.
- sal_uInt8* aSource((sal_uInt8*)mpBuffer + nY * nAlignedWidth);
+ sal_uInt8* aSource(mpBuffer + nY * nAlignedWidth);
sal_uInt8* aEnd(aSource + (nWidth * 3));
for(sal_uInt8* aTmp(aSource); aTmp < aEnd; aTmp += 3)
@@ -364,7 +364,7 @@ void JPEGReader::FillBitmap()
else
{
// old version: WritePixel
- pTmp = (sal_uInt8*) mpBuffer + nY * nAlignedWidth;
+ pTmp = mpBuffer + nY * nAlignedWidth;
for( long nX = 0L; nX < nWidth; nX++ )
{
diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
index 9762e5a2fb10..45c69adf833d 100644
--- a/vcl/source/filter/jpeg/jpegc.cxx
+++ b/vcl/source/filter/jpeg/jpegc.cxx
@@ -184,7 +184,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
int i;
int j;
unsigned char *pSLB = pScanLineBuffer.get();
- jpeg_read_scanlines( &cinfo, (JSAMPARRAY) &pSLB, 1 );
+ jpeg_read_scanlines( &cinfo, reinterpret_cast<JSAMPARRAY>(&pSLB), 1 );
// convert CMYK to RGB
for( i=0, j=0; i < nScanLineBufferComponents; i+=4, j+=3 )
{
@@ -199,7 +199,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
}
else
{
- jpeg_read_scanlines( &cinfo, (JSAMPARRAY) &pTmp, 1 );
+ jpeg_read_scanlines( &cinfo, reinterpret_cast<JSAMPARRAY>(&pTmp), 1 );
}
/* PENDING ??? */
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx
index 2e7982f07a68..ef2983c19393 100644
--- a/vcl/source/gdi/bmpacc.cxx
+++ b/vcl/source/gdi/bmpacc.cxx
@@ -361,7 +361,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
else
nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL));
- sal_uInt8* pLastBytes = (sal_uInt8*)GetBuffer() + ( nScanSize - nBytes );
+ sal_uInt8* pLastBytes = reinterpret_cast<sal_uInt8*>(GetBuffer()) + ( nScanSize - nBytes );
for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize )
{
*pLastBytes &= nMask;
@@ -373,7 +373,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
else if( nBits & 0x1f )
{
sal_uInt32 nMask = 0xffffffff << ( ( nScanSize << 3 ) - nBits );
- sal_uInt8* pLast4Bytes = (sal_uInt8*) GetBuffer() + ( nScanSize - 4 );
+ sal_uInt8* pLast4Bytes = reinterpret_cast<sal_uInt8*>(GetBuffer()) + ( nScanSize - 4 );
#ifdef OSL_LITENDIAN
nMask = OSL_SWAPDWORD( nMask );
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 4267cce75d7d..85fe8e83160d 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -1047,13 +1047,13 @@ bool ImplWriteDIBBits(SvStream& rOStm, BitmapReadAccess& rAcc, BitmapReadAccess*
SVBT32 aVal32;
UInt32ToSVBT32( rMask.GetRedMask(), aVal32 );
- rOStm.Write( (sal_uInt8*) aVal32, 4UL );
+ rOStm.Write( aVal32, 4UL );
UInt32ToSVBT32( rMask.GetGreenMask(), aVal32 );
- rOStm.Write( (sal_uInt8*) aVal32, 4UL );
+ rOStm.Write( aVal32, 4UL );
UInt32ToSVBT32( rMask.GetBlueMask(), aVal32 );
- rOStm.Write( (sal_uInt8*) aVal32, 4UL );
+ rOStm.Write( aVal32, 4UL );
rImageSize = rOStm.Tell();
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index fe1b8330ffb8..e750d3a3bfcf 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2112,7 +2112,7 @@ void PDFWriterImpl::emitComment( const char* pComment )
{
OStringBuffer aLine( 64 );
aLine.append( "% " );
- aLine.append( (const sal_Char*)pComment );
+ aLine.append( pComment );
aLine.append( "\n" );
writeBuffer( aLine.getStr(), aLine.getLength() );
}
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index f25b95658005..9a30c336cab1 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -435,7 +435,7 @@ void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints,
mirror( nPoints, pPtAry[i], pPtAry2[i], pOutDev );
}
- drawPolyPolygon( nPoly, pPoints, (PCONSTSALPOINT*)pPtAry2 );
+ drawPolyPolygon( nPoly, pPoints, const_cast<PCONSTSALPOINT*>(pPtAry2) );
for(i=0; i<nPoly; i++)
delete [] pPtAry2[i];
@@ -502,7 +502,7 @@ bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt32* i
mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_pOutDev );
}
- bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, (PCONSTSALPOINT*)pPtAry2, i_pFlgAry );
+ bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, const_cast<PCONSTSALPOINT const *>(pPtAry2), i_pFlgAry );
for(i=0; i<i_nPoly; i++)
delete [] pPtAry2[i];
diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx
index 9b703a09be79..208906d7c766 100644
--- a/vcl/source/outdev/polygon.cxx
+++ b/vcl/source/outdev/polygon.cxx
@@ -347,7 +347,7 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const tools::PolyPolyg
{
pPointAry = aStackAry1;
pPointAryAry = aStackAry2;
- pFlagAryAry = (const sal_uInt8**)aStackAry3;
+ pFlagAryAry = const_cast<const sal_uInt8**>(aStackAry3);
}
do
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index c9129b6b03e4..72433b09ec4a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -835,7 +835,7 @@ void Window::ReleaseGraphics( bool bRelease )
ImplSVData* pSVData = ImplGetSVData();
- vcl::Window* pWindow = (vcl::Window*)this;
+ vcl::Window* pWindow = this;
if ( bRelease )
pWindow->mpWindowImpl->mpFrame->ReleaseGraphics( mpGraphics );
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 94668ff00a4f..4cd662208a59 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -804,7 +804,7 @@ bool GtkSalMenu::IsItemVisible( unsigned nPos )
bool bVisible = false;
if ( nPos < maItems.size() )
- bVisible = ( ( GtkSalMenuItem* ) maItems[ nPos ])->mbVisible;
+ bVisible = maItems[ nPos ]->mbVisible;
return bVisible;
}
@@ -821,7 +821,7 @@ void GtkSalMenu::ShowItem( unsigned nPos, bool bShow )
{
SolarMutexGuard aGuard;
if ( nPos < maItems.size() )
- ( ( GtkSalMenuItem* ) maItems[ nPos ] )->mbVisible = bShow;
+ maItems[ nPos ]->mbVisible = bShow;
}
void GtkSalMenu::SetItemText( unsigned, SalMenuItem*, const OUString& )