From 455e4011f7052c5d1fb4693a573e0998cf6badc8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 1 Nov 2017 15:54:13 +0200 Subject: improve constparam loplugin lots of little fixes to make the logic less pessimistic Change-Id: If368822984250b11b98c56f5890177a1402e8660 Reviewed-on: https://gerrit.libreoffice.org/44168 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/source/fontsubset/sft.cxx | 14 +++++++------- vcl/source/fontsubset/ttcr.cxx | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'vcl/source/fontsubset') diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index ea5b2d6ce8ce..19e40cb6d61c 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -267,7 +267,7 @@ static const sal_uInt8* getTable( TrueTypeFont const *ttf, sal_uInt32 ord) return ttf->tables[ord]; } -static sal_uInt32 getTableSize(TrueTypeFont *ttf, sal_uInt32 ord) +static sal_uInt32 getTableSize(TrueTypeFont const *ttf, sal_uInt32 ord) { return ttf->tlens[ord]; } @@ -367,7 +367,7 @@ static void GetMetrics(TrueTypeFont const *ttf, sal_uInt32 glyphID, TTGlyphMetri static int GetTTGlyphOutline(TrueTypeFont *, sal_uInt32 , ControlPoint **, TTGlyphMetrics *, std::vector< sal_uInt32 >* ); /* returns the number of control points, allocates the pointArray */ -static int GetSimpleTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **pointArray, TTGlyphMetrics *metrics) +static int GetSimpleTTOutline(TrueTypeFont const *ttf, sal_uInt32 glyphID, ControlPoint **pointArray, TTGlyphMetrics *metrics) { const sal_uInt8* table = getTable(ttf, O_glyf); const sal_uInt32 nTableSize = getTableSize(ttf, O_glyf); @@ -693,7 +693,7 @@ static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint /*- returns the number of items in the path -*/ -static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **path) +static int BSplineToPSPath(ControlPoint const *srcA, int srcCount, PSPathElement **path) { std::vector< PSPathElement > aPathList; int nPathCount = 0; @@ -2314,12 +2314,12 @@ sal_uInt16 MapChar(TrueTypeFont const *ttf, sal_uInt16 ch) #endif -int GetTTGlyphCount( TrueTypeFont* ttf ) +int GetTTGlyphCount( TrueTypeFont const * ttf ) { return ttf->nglyphs; } -bool GetSfntTable( TrueTypeFont* ttf, int nSubtableIndex, +bool GetSfntTable( TrueTypeFont const * ttf, int nSubtableIndex, const sal_uInt8** ppRawBytes, int* pRawLength ) { if( (nSubtableIndex < 0) || (nSubtableIndex >= NUM_TAGS) ) @@ -2330,7 +2330,7 @@ bool GetSfntTable( TrueTypeFont* ttf, int nSubtableIndex, return bOk; } -TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, const sal_uInt16 *glyphArray, int nGlyphs, bool vertical) +TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont const *ttf, const sal_uInt16 *glyphArray, int nGlyphs, bool vertical) { const sal_uInt8* pTable; sal_uInt32 n; @@ -2539,7 +2539,7 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID) return d; } -int GetTTNameRecords(TrueTypeFont *ttf, NameRecord **nr) +int GetTTNameRecords(TrueTypeFont const *ttf, NameRecord **nr) { const sal_uInt8* table = getTable(ttf, O_name); int nTableSize = getTableSize(ttf, O_name ); diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx index e8c1b744054e..2b30cb35ebc5 100644 --- a/vcl/source/fontsubset/ttcr.cxx +++ b/vcl/source/fontsubset/ttcr.cxx @@ -591,7 +591,7 @@ static int GetRawData_glyf(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le } /* cmap packers */ -static sal_uInt8 *PackCmapType0(CmapSubTable *s, sal_uInt32 *length) +static sal_uInt8 *PackCmapType0(CmapSubTable const *s, sal_uInt32 *length) { sal_uInt8* ptr = static_cast(smalloc(262)); sal_uInt8 *p = ptr + 6; -- cgit