vcl/inc/impfontcharmap.hxx | 2 +- vcl/source/font/PhysicalFontFace.cxx | 2 +- vcl/source/font/fontcharmap.cxx | 6 +++--- vcl/source/fontsubset/sft.cxx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
New commits: commit b711a008dfce399c03cd34272c37d7cc60f93363 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Sep 9 11:06:35 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Sep 9 13:41:24 2022 +0200 ofz: Undefined-shift Change-Id: Ida81135280ff61c3a8e96e8f5ed977959e169f61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139716 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx index b2d47dc9f2b7..1334dc76b262 100644 --- a/vcl/inc/impfontcharmap.hxx +++ b/vcl/inc/impfontcharmap.hxx @@ -50,7 +50,7 @@ private: const bool m_bSymbolic; }; -bool VCL_DLLPUBLIC HasSymbolCmap(const char* pRawData, int nRawLength); +bool VCL_DLLPUBLIC HasSymbolCmap(const unsigned char* pRawData, int nRawLength); #endif // INCLUDED_VCL_INC_IMPFONTCHARMAP_HXX diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx index 9c1a1b586423..e3a4638b3139 100644 --- a/vcl/source/font/PhysicalFontFace.cxx +++ b/vcl/source/font/PhysicalFontFace.cxx @@ -237,7 +237,7 @@ FontCharMapRef PhysicalFontFace::GetFontCharMap() const if (pBlob) { unsigned int nSize = 0; - auto* pData = hb_blob_get_data(pBlob, &nSize); + auto* pData = reinterpret_cast<const unsigned char*>(hb_blob_get_data(pBlob, &nSize)); bSymbol = HasSymbolCmap(pData, nSize); hb_blob_destroy(pBlob); } diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index 450521cc6008..70fb51375580 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -71,9 +71,9 @@ bool ImplFontCharMap::isDefaultMap() const return bIsDefault; } -static unsigned GetUShort(const char* p) { return((p[0]<<8) | p[1]);} +static unsigned GetUShort(const unsigned char* p) { return((p[0]<<8) | p[1]);} -bool HasSymbolCmap(const char* pCmap, int nLength) +bool HasSymbolCmap(const unsigned char* pCmap, int nLength) { // parse the table header and check for validity if( !pCmap || (nLength < 24) ) @@ -86,7 +86,7 @@ bool HasSymbolCmap(const char* pCmap, int nLength) if( (nSubTables <= 0) || (nSubTables > (nLength - 24) / 8) ) return false; - for (const char* p = pCmap + 4; --nSubTables >= 0; p += 8) + for (const unsigned char* p = pCmap + 4; --nSubTables >= 0; p += 8) { int nPlatform = GetUShort(p); int nEncoding = GetUShort(p + 2); diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 41918cb12e6f..93c09b31f0c5 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1299,7 +1299,7 @@ SFErrCodes AbstractTrueTypeFont::indexGlyphData() if (!m_xCharMap.is()) { table = this->table(O_cmap, table_size); - m_bIsSymbolFont = HasSymbolCmap(reinterpret_cast<const char*>(table), table_size); + m_bIsSymbolFont = HasSymbolCmap(reinterpret_cast<const unsigned char*>(table), table_size); } return SFErrCodes::Ok;