diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:08:26 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:09:28 +0100 |
commit | 18804c92e10c7f4572b9698b1cf6dc86db8d6f32 (patch) | |
tree | 871d06b7a7430c9b5ef93910ab46eb26ead5ffa6 /vcl/generic/print | |
parent | 33875d862ad5d870cfd1f67d5ef9ad91b8be740f (diff) |
Clean up C-style casts from pointers to void
Change-Id: Iad602cece6e328c7f5d5f36adb294c97b152ade3
Diffstat (limited to 'vcl/generic/print')
-rw-r--r-- | vcl/generic/print/common_gfx.cxx | 2 | ||||
-rw-r--r-- | vcl/generic/print/genprnpsp.cxx | 4 | ||||
-rw-r--r-- | vcl/generic/print/genpspgraphics.cxx | 4 | ||||
-rw-r--r-- | vcl/generic/print/glyphset.cxx | 12 | ||||
-rw-r--r-- | vcl/generic/print/printerjob.cxx | 2 | ||||
-rw-r--r-- | vcl/generic/print/prtsetup.cxx | 8 | ||||
-rw-r--r-- | vcl/generic/print/text_gfx.cxx | 20 |
7 files changed, 26 insertions, 26 deletions
diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx index cc7c4d992f9c..769bb9893507 100644 --- a/vcl/generic/print/common_gfx.cxx +++ b/vcl/generic/print/common_gfx.cxx @@ -1219,7 +1219,7 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize bSuccess = nOutLength == nSize; // corresponding EndDocument - if( ((char*)pPtr)[ nSize-1 ] != '\n' ) + if( static_cast<char*>(pPtr)[ nSize-1 ] != '\n' ) WritePS( mpPageBody, "\n" ); WritePS( mpPageBody, "%%EndDocument\n" ); diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx index 0eb63379c35a..7a0ab922eca8 100644 --- a/vcl/generic/print/genprnpsp.cxx +++ b/vcl/generic/print/genprnpsp.cxx @@ -232,7 +232,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) if( rData.getStreamBuffer( pBuffer, nBytes ) ) { pJobSetup->mnDriverDataLen = nBytes; - pJobSetup->mpDriverData = (sal_uInt8*)pBuffer; + pJobSetup->mpDriverData = static_cast<sal_uInt8*>(pBuffer); } else { @@ -563,7 +563,7 @@ bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) void* pBuffer = NULL; aInfo.getStreamBuffer( pBuffer, nBytes ); pJobSetup->mnDriverDataLen = nBytes; - pJobSetup->mpDriverData = (sal_uInt8*)pBuffer; + pJobSetup->mpDriverData = static_cast<sal_uInt8*>(pBuffer); // copy everything to job setup copyJobDataToJobSetup( pJobSetup, aInfo ); diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx index af73d8a9c77e..d121ba6ca2eb 100644 --- a/vcl/generic/print/genpspgraphics.cxx +++ b/vcl/generic/print/genpspgraphics.cxx @@ -1248,7 +1248,7 @@ void GenPspGraphics::DoFreeEmbedFontData( const void* pData, long nLen ) { #if defined( UNX ) if( pData ) - munmap( (char*)pData, nLen ); + munmap( const_cast<void *>(pData), nLen ); #else (void)nLen; rtl_freeMemory( (void *)pData ); @@ -1332,7 +1332,7 @@ const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs rInfo.m_nFontType = FontSubsetInfo::SFNT_TTF; break; case psp::fonttype::Type1: { - const bool bPFA = ((*(unsigned char*)pFile) < 0x80); + const bool bPFA = *static_cast<unsigned char*>(pFile) < 0x80; rInfo.m_nFontType = bPFA ? FontSubsetInfo::TYPE1_PFA : FontSubsetInfo::TYPE1_PFB; } break; diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx index 3ac8d8dd28e9..37bd752525f8 100644 --- a/vcl/generic/print/glyphset.cxx +++ b/vcl/generic/print/glyphset.cxx @@ -448,8 +448,8 @@ void GlyphSet::DrawGlyphs( const sal_Int32* pDeltaArray, const bool bUseGlyphs) { - unsigned char *pGlyphID = (unsigned char*)alloca (nLen * sizeof(unsigned char)); - sal_Int32 *pGlyphSetID = (sal_Int32*)alloca (nLen * sizeof(sal_Int32)); + unsigned char *pGlyphID = static_cast<unsigned char*>(alloca (nLen * sizeof(unsigned char))); + sal_Int32 *pGlyphSetID = static_cast<sal_Int32*>(alloca (nLen * sizeof(sal_Int32))); std::set< sal_Int32 > aGlyphSet; // convert unicode to font glyph id and font subset @@ -464,8 +464,8 @@ void GlyphSet::DrawGlyphs( // loop over all glyph sets to detect substrings that can be xshown together // without changing the postscript font - sal_Int32 *pDeltaSubset = (sal_Int32*)alloca (nLen * sizeof(sal_Int32)); - unsigned char *pGlyphSubset = (unsigned char*)alloca (nLen * sizeof(unsigned char)); + sal_Int32 *pDeltaSubset = static_cast<sal_Int32*>(alloca (nLen * sizeof(sal_Int32))); + unsigned char *pGlyphSubset = static_cast<unsigned char*>(alloca (nLen * sizeof(unsigned char))); std::set< sal_Int32 >::iterator aSet; for (aSet = aGlyphSet.begin(); aSet != aGlyphSet.end(); ++aSet) @@ -545,8 +545,8 @@ GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint, } int nChar; - unsigned char *pGlyphID = (unsigned char*)alloca (nLen * sizeof(unsigned char)); - sal_Int32 *pGlyphSetID = (sal_Int32*)alloca (nLen * sizeof(sal_Int32)); + unsigned char *pGlyphID = static_cast<unsigned char*>(alloca (nLen * sizeof(unsigned char))); + sal_Int32 *pGlyphSetID = static_cast<sal_Int32*>(alloca (nLen * sizeof(sal_Int32))); // convert unicode to glyph id and char set (font subset) for (nChar = 0; nChar < nLen; nChar++) diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx index 7cfeeade1273..f3aa39df8125 100644 --- a/vcl/generic/print/printerjob.cxx +++ b/vcl/generic/print/printerjob.cxx @@ -66,7 +66,7 @@ AppendPS (FILE* pDst, osl::File* pSrc, unsigned char* pBuffer, if (nBlockSize == 0) nBlockSize = nBLOCKSIZE; if (pBuffer == NULL) - pBuffer = (unsigned char*)alloca (nBlockSize); + pBuffer = static_cast<unsigned char*>(alloca (nBlockSize)); sal_uInt64 nIn = 0; sal_uInt64 nOut = 0; diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index ed598b6cb19b..cbe60c35f3f5 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -258,7 +258,7 @@ IMPL_LINK( RTSPaperPage, SelectHdl, ListBox*, pBox ) } if( pKey ) { - PPDValue* pValue = (PPDValue*)pBox->GetSelectEntryData(); + PPDValue* pValue = static_cast<PPDValue*>(pBox->GetSelectEntryData()); m_pParent->m_aJobData.m_aContext.setValue( pKey, pValue ); update(); } @@ -412,13 +412,13 @@ IMPL_LINK( RTSDevicePage, SelectHdl, ListBox*, pBox ) { if( pBox == m_pPPDKeyBox ) { - const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetSelectEntryData(); + const PPDKey* pKey = static_cast<PPDKey*>(m_pPPDKeyBox->GetSelectEntryData()); FillValueBox( pKey ); } else if( pBox == m_pPPDValueBox ) { - const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetSelectEntryData(); - const PPDValue* pValue = (PPDValue*)m_pPPDValueBox->GetSelectEntryData(); + const PPDKey* pKey = static_cast<PPDKey*>(m_pPPDKeyBox->GetSelectEntryData()); + const PPDValue* pValue = static_cast<PPDValue*>(m_pPPDValueBox->GetSelectEntryData()); if (pKey && pValue) { m_pParent->m_aJobData.m_aContext.setValue( pKey, pValue ); diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx index dec130475a41..569a10e4ed35 100644 --- a/vcl/generic/print/text_gfx.cxx +++ b/vcl/generic/print/text_gfx.cxx @@ -197,9 +197,9 @@ void PrinterGfx::DrawGlyphs( // vertical glyphs can have an additional rotation ... sigh. // so break up text in chunks of normal glyphs and print out // specially rotated glyphs extra - sal_GlyphId* pTempGlyphIds = (sal_GlyphId*)alloca(sizeof(sal_Int32)*nLen); - sal_Int32* pTempDelta = (sal_Int32*)alloca(sizeof(sal_Int32)*nLen); - sal_Unicode* pTempUnicodes = (sal_Unicode*)alloca(sizeof(sal_Unicode)*nLen); + sal_GlyphId* pTempGlyphIds = static_cast<sal_GlyphId*>(alloca(sizeof(sal_Int32)*nLen)); + sal_Int32* pTempDelta = static_cast<sal_Int32*>(alloca(sizeof(sal_Int32)*nLen)); + sal_Unicode* pTempUnicodes = static_cast<sal_Unicode*>(alloca(sizeof(sal_Unicode)*nLen)); sal_Int16 nTempLen = 0; sal_Int32 nTempFirstDelta = 0; Point aRotPoint; @@ -314,7 +314,7 @@ PrinterGfx::DrawText ( sal_Unicode *pEffectiveStr; if ( aFont.IsSymbolFont() ) { - pEffectiveStr = (sal_Unicode*)alloca(nLen * sizeof(pStr[0])); + pEffectiveStr = static_cast<sal_Unicode*>(alloca(nLen * sizeof(pStr[0]))); for (int i = 0; i < nLen; i++) pEffectiveStr[i] = pStr[i] < 256 ? pStr[i] + 0xF000 : pStr[i]; } @@ -323,8 +323,8 @@ PrinterGfx::DrawText ( pEffectiveStr = const_cast<sal_Unicode*>(pStr); } - fontID *pFontMap = (fontID*) alloca(nLen * sizeof(fontID)); - sal_Int32 *pCharWidth = (sal_Int32*) alloca(nLen * sizeof(sal_Int32)); + fontID *pFontMap = static_cast<fontID*>(alloca(nLen * sizeof(fontID))); + sal_Int32 *pCharWidth = static_cast<sal_Int32*>(alloca(nLen * sizeof(sal_Int32))); for( int n = 0; n < nLen; n++ ) { @@ -335,7 +335,7 @@ PrinterGfx::DrawText ( } // setup a new delta array, use virtual resolution of 1000 - sal_Int32* pNewDeltaArray = (sal_Int32*)alloca( sizeof( sal_Int32 )*nLen ); + sal_Int32* pNewDeltaArray = static_cast<sal_Int32*>(alloca( sizeof( sal_Int32 )*nLen )); if ( pDeltaArray != 0) { for (int i = 0; i < nLen - 1; i++) @@ -438,7 +438,7 @@ bool PrinterGfx::drawVerticalizedText( if (!rMgr.getFontInfo(mnFontID, aInfo)) return false; - sal_Int32* pDelta = (sal_Int32*)alloca( nLen * sizeof(sal_Int32) ); + sal_Int32* pDelta = static_cast<sal_Int32*>(alloca( nLen * sizeof(sal_Int32) )); int nTextScale = maVirtualStatus.mnTextWidth ? maVirtualStatus.mnTextWidth : maVirtualStatus.mnTextHeight; int nNormalAngle = mnTextAngle; @@ -447,7 +447,7 @@ bool PrinterGfx::drawVerticalizedText( double fSin = sin( -2.0*M_PI*nNormalAngle/3600 ); double fCos = cos( -2.0*M_PI*nNormalAngle/3600 ); - bool* pGsubFlags = (bool*)alloca( nLen * sizeof(bool) ); + bool* pGsubFlags = static_cast<bool*>(alloca( nLen * sizeof(bool) )); rMgr.hasVerticalSubstitutions( mnFontID, pStr, nLen, pGsubFlags ); Point aPoint( rPoint ); @@ -546,7 +546,7 @@ PrinterGfx::LicenseWarning(const Point& rPoint, const sal_Unicode* pStr, PSSetFont (aFontName, RTL_TEXTENCODING_ISO_8859_1); sal_Size nSize = 4 * nLen; - unsigned char* pBuffer = (unsigned char*)alloca (nSize* sizeof(unsigned char)); + unsigned char* pBuffer = static_cast<unsigned char*>(alloca (nSize* sizeof(unsigned char))); ConverterFactory &rCvt = GetConverterFactory (); nSize = rCvt.Convert (pStr, nLen, pBuffer, nSize, RTL_TEXTENCODING_ISO_8859_1); |