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/fontmanager | |
parent | 33875d862ad5d870cfd1f67d5ef9ad91b8be740f (diff) |
Clean up C-style casts from pointers to void
Change-Id: Iad602cece6e328c7f5d5f36adb294c97b152ade3
Diffstat (limited to 'vcl/generic/fontmanager')
-rw-r--r-- | vcl/generic/fontmanager/fontconfig.cxx | 4 | ||||
-rw-r--r-- | vcl/generic/fontmanager/fontmanager.cxx | 6 | ||||
-rw-r--r-- | vcl/generic/fontmanager/parseAFM.cxx | 32 |
3 files changed, 21 insertions, 21 deletions
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx index 2a354cca4cf4..f872164e9a63 100644 --- a/vcl/generic/fontmanager/fontconfig.cxx +++ b/vcl/generic/fontmanager/fontconfig.cxx @@ -919,7 +919,7 @@ IMPL_LINK_NOARG(PrintFontManager, autoInstallFontLangSupport) return -1; } - gchar **fonts = (gchar**)g_malloc((m_aCurrentRequests.size() + 1) * sizeof(gchar*)); + gchar **fonts = static_cast<gchar**>(g_malloc((m_aCurrentRequests.size() + 1) * sizeof(gchar*))); gchar **font = fonts; for (std::vector<OString>::const_iterator aI = m_aCurrentRequests.begin(); aI != m_aCurrentRequests.end(); ++aI) *font++ = const_cast<gchar*>(aI->getStr()); @@ -1088,7 +1088,7 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi // update rMissingCodes by removing resolved unicodes if( !rMissingCodes.isEmpty() ) { - sal_uInt32* pRemainingCodes = (sal_uInt32*)alloca( rMissingCodes.getLength() * sizeof(sal_uInt32) ); + sal_uInt32* pRemainingCodes = static_cast<sal_uInt32*>(alloca( rMissingCodes.getLength() * sizeof(sal_uInt32) )); int nRemainingLen = 0; FcCharSet* unicodes; if (!FcPatternGetCharSet(pSet->fonts[0], FC_CHARSET, 0, &unicodes)) diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index c98ccc522d3c..f2b67d1aca84 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -472,7 +472,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( MultiAtomProvider* pProvider, // first transform the character codes to unicode // note: this only works with single byte encodings - sal_Unicode* pUnicodes = (sal_Unicode*)alloca( pInfo->numOfChars * sizeof(sal_Unicode)); + sal_Unicode* pUnicodes = static_cast<sal_Unicode*>(alloca( pInfo->numOfChars * sizeof(sal_Unicode))); CharMetricInfo* pChar = pInfo->cmi; int i; @@ -979,7 +979,7 @@ std::vector<fontID> PrintFontManager::findFontFileIDs( int nDirID, const OString OUString PrintFontManager::convertTrueTypeName( void* pRecord ) const { - NameRecord* pNameRecord = (NameRecord*)pRecord; + NameRecord* pNameRecord = static_cast<NameRecord*>(pRecord); OUString aValue; if( ( pNameRecord->platformID == 3 && ( pNameRecord->encodingID == 0 || pNameRecord->encodingID == 1 ) ) // MS, Unicode @@ -1128,7 +1128,7 @@ void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OU ::std::set< OUString > aSet; NameRecord* pNameRecords = NULL; - int nNameRecords = GetTTNameRecords( (TrueTypeFont*)pTTFont, &pNameRecords ); + int nNameRecords = GetTTNameRecords( static_cast<TrueTypeFont*>(pTTFont), &pNameRecords ); if( nNameRecords && pNameRecords ) { LanguageTag aSystem(""); diff --git a/vcl/generic/fontmanager/parseAFM.cxx b/vcl/generic/fontmanager/parseAFM.cxx index e3a3170a14ab..267ef1c2c248 100644 --- a/vcl/generic/fontmanager/parseAFM.cxx +++ b/vcl/generic/fontmanager/parseAFM.cxx @@ -120,7 +120,7 @@ FileInputStream::FileInputStream(const char* pFilename) struct stat aStat; if (!fstat(fileno(fp), &aStat) && S_ISREG(aStat.st_mode) && aStat.st_size > 0) { - m_pMemory = (char*)rtl_allocateMemory( aStat.st_size ); + m_pMemory = static_cast<char*>(rtl_allocateMemory( aStat.st_size )); m_nLen = (unsigned int)fread( m_pMemory, 1, aStat.st_size, fp ); } fclose( fp ); @@ -666,7 +666,7 @@ reallocFontMetrics( void **pp_fontmetrics, int *p_oldcount, int n_newcount, unsi if (*p_oldcount == n_newcount) return ok; - p_tmpmetrics = (char*)realloc(*pp_fontmetrics, n_newcount * n_size); + p_tmpmetrics = static_cast<char*>(realloc(*pp_fontmetrics, n_newcount * n_size)); if (p_tmpmetrics == NULL) return storageProblem; @@ -816,7 +816,7 @@ static int parseCharMetrics( FileInputStream* fp, FontInfo* fi) tail = &(node->next); } - *tail = (Ligature *) calloc(1, sizeof(Ligature)); + *tail = static_cast<Ligature *>(calloc(1, sizeof(Ligature))); if ((keyword = token(fp,tokenlen)) != NULL) (*tail)->succ = (char *)strdup(keyword); if ((keyword = token(fp,tokenlen)) != NULL) @@ -1169,8 +1169,8 @@ static int parseCompCharData( FileInputStream* fp, FontInfo* fi) fi->ccd[pos].ccName = strdup( keyword ); if ((keyword = token(fp,tokenlen)) != NULL) fi->ccd[pos].numOfPieces = atoi(keyword); - fi->ccd[pos].pieces = (Pcc *) - calloc(fi->ccd[pos].numOfPieces, sizeof(Pcc)); + fi->ccd[pos].pieces = static_cast<Pcc *>( + calloc(fi->ccd[pos].numOfPieces, sizeof(Pcc))); j = 0; ccount++; } @@ -1252,12 +1252,12 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags) char *keyword; /* used to store a token */ - (*fi) = (FontInfo *) calloc(1, sizeof(FontInfo)); + (*fi) = static_cast<FontInfo *>(calloc(1, sizeof(FontInfo))); if ((*fi) == NULL) { error = storageProblem; return error; } if (flags & P_G) { - (*fi)->gfi = (GlobalFontInfo *) calloc(1, sizeof(GlobalFontInfo)); + (*fi)->gfi = static_cast<GlobalFontInfo *>(calloc(1, sizeof(GlobalFontInfo))); if ((*fi)->gfi == NULL) { error = storageProblem; return error; } } @@ -1281,8 +1281,8 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags) (*fi)->numOfChars = atoi(keyword); if (flags & (P_M ^ P_W)) { - (*fi)->cmi = (CharMetricInfo *) - calloc((*fi)->numOfChars, sizeof(CharMetricInfo)); + (*fi)->cmi = static_cast<CharMetricInfo *>( + calloc((*fi)->numOfChars, sizeof(CharMetricInfo))); if ((*fi)->cmi == NULL) { error = storageProblem; return error; } code = parseCharMetrics(&aFile, *fi); } @@ -1290,7 +1290,7 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags) { if (flags & P_W) { - (*fi)->cwi = (int *) calloc(256, sizeof(int)); + (*fi)->cwi = static_cast<int *>(calloc(256, sizeof(int))); if ((*fi)->cwi == NULL) { error = storageProblem; @@ -1331,8 +1331,8 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags) if ((flags & P_T) && keyword) { (*fi)->numOfTracks = atoi(keyword); - (*fi)->tkd = (TrackKernData *) - calloc((*fi)->numOfTracks, sizeof(TrackKernData)); + (*fi)->tkd = static_cast<TrackKernData *>( + calloc((*fi)->numOfTracks, sizeof(TrackKernData))); if ((*fi)->tkd == NULL) { error = storageProblem; @@ -1346,8 +1346,8 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags) if ((flags & P_P) && keyword) { (*fi)->numOfPairs = atoi(keyword); - (*fi)->pkd = (PairKernData *) - calloc((*fi)->numOfPairs, sizeof(PairKernData)); + (*fi)->pkd = static_cast<PairKernData *>( + calloc((*fi)->numOfPairs, sizeof(PairKernData))); if ((*fi)->pkd == NULL) { error = storageProblem; @@ -1361,8 +1361,8 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags) if ((flags & P_C) && keyword) { (*fi)->numOfComps = atoi(keyword); - (*fi)->ccd = (CompCharData *) - calloc((*fi)->numOfComps, sizeof(CompCharData)); + (*fi)->ccd = static_cast<CompCharData *>( + calloc((*fi)->numOfComps, sizeof(CompCharData))); if ((*fi)->ccd == NULL) { error = storageProblem; |