diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-11-19 14:54:22 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-11-27 09:55:17 +0100 |
commit | c2709d9fe2711a3729225ec9168f7acf5a7ba23c (patch) | |
tree | 812bfb01d6e04fb52f8f80a68b1d6de2ef255e4e | |
parent | 5ce6f448ae3d00707202a2d52cf3d718431297f8 (diff) |
avoid some compiler warnings in Skia VCL code
Mostly warnings from the 'casttovoid' Clang plugin, which is rather
annoying here.
Change-Id: I3d69697143f690211cdd26d1b9a4c0efe9397197
-rw-r--r-- | vcl/backendtest/outputdevice/common.cxx | 2 | ||||
-rw-r--r-- | vcl/inc/skia/gdiimpl.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/skia/salbmp.hxx | 4 | ||||
-rw-r--r-- | vcl/skia/SkiaHelper.cxx | 5 | ||||
-rw-r--r-- | vcl/skia/gdiimpl.cxx | 49 | ||||
-rw-r--r-- | vcl/skia/salbmp.cxx | 32 | ||||
-rw-r--r-- | vcl/source/bitmap/salbmp.cxx | 2 |
7 files changed, 36 insertions, 61 deletions
diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx index 34e37e771f1f..a7e857ffd1fd 100644 --- a/vcl/backendtest/outputdevice/common.cxx +++ b/vcl/backendtest/outputdevice/common.cxx @@ -262,7 +262,7 @@ TestResult OutputDeviceTestCommon::checkAALines(Bitmap& rBitmap) return checkHorizontalVerticalDiagonalLines(rBitmap, constLineColor, 30); // 30 color values threshold delta } -void checkResult(TestResult eResult, TestResult & eTotal) +static void checkResult(TestResult eResult, TestResult & eTotal) { if (eTotal == TestResult::Failed) return; diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx index 0036b2d89f7a..517bad0db5c8 100644 --- a/vcl/inc/skia/gdiimpl.hxx +++ b/vcl/inc/skia/gdiimpl.hxx @@ -251,7 +251,8 @@ protected: friend inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& stream, const SkiaSalGraphicsImpl* graphics) { // O - offscreen, G - GPU-based, R - raster - return stream << (void*)graphics << " " << Size(graphics->GetWidth(), graphics->GetHeight()) + return stream << static_cast<const void*>(graphics) << " " + << Size(graphics->GetWidth(), graphics->GetHeight()) << (graphics->isOffscreen() ? "O" : "") << (graphics->isGPU() ? "G" : "R"); } diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx index c5922685c5b7..ed0f374162d6 100644 --- a/vcl/inc/skia/salbmp.hxx +++ b/vcl/inc/skia/salbmp.hxx @@ -83,8 +83,8 @@ private: operator<<(std::basic_ostream<charT, traits>& stream, const SkiaSalBitmap* bitmap) { // TODO GPU-based, once it's done // B - has SkBitmap, A - has alpha SkBitmap, D - has data buffer - return stream << (void*)bitmap << " " << bitmap->GetSize() << "/" << bitmap->mBitCount - << (!bitmap->mBitmap.drawsNothing() ? "B" : "") + return stream << static_cast<const void*>(bitmap) << " " << bitmap->GetSize() << "/" + << bitmap->mBitCount << (!bitmap->mBitmap.drawsNothing() ? "B" : "") << (!bitmap->mAlphaBitmap.drawsNothing() ? "A" : "") << (bitmap->mBuffer.get() ? "D" : ""); } diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx index 810e8f9b0b11..040f189be74f 100644 --- a/vcl/skia/SkiaHelper.cxx +++ b/vcl/skia/SkiaHelper.cxx @@ -103,8 +103,9 @@ static bool initRenderMethodToUse() SkiaHelper::RenderMethod SkiaHelper::renderMethodToUse() { static bool methodToUseInited = initRenderMethodToUse(); - (void)methodToUseInited; // Used just to ensure thread-safe one-time init. - return methodToUse; + if (methodToUseInited) // Used just to ensure thread-safe one-time init. + return methodToUse; + abort(); } void SkiaHelper::disableRenderMethod(RenderMethod method) diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index 271f1a61321c..dfa7eb7a7320 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -439,10 +439,9 @@ void SkiaSalGraphicsImpl::SetFillColor() { mFillColor = SALCOLOR_NONE; } void SkiaSalGraphicsImpl::SetFillColor(Color nColor) { mFillColor = nColor; } -void SkiaSalGraphicsImpl::SetXORMode(bool bSet, bool bInvertOnly) +void SkiaSalGraphicsImpl::SetXORMode(bool, bool) { - (void)bSet; - (void)bInvertOnly; + // TODO } void SkiaSalGraphicsImpl::SetROPLineColor(SalROPColor nROPColor) @@ -631,9 +630,9 @@ bool SkiaSalGraphicsImpl::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDev const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin eLineJoin, css::drawing::LineCap eLineCap, double fMiterMinimumAngle, - bool bPixelSnapHairline) + bool /*bPixelSnapHairline*/) { - (void)bPixelSnapHairline; + //(void)bPixelSnapHairline; // TODO if (rPolyLine.count() == 0 || fTransparency < 0.0 || fTransparency >= 1.0 || mLineColor == SALCOLOR_NONE) @@ -720,32 +719,22 @@ bool SkiaSalGraphicsImpl::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDev return true; } -bool SkiaSalGraphicsImpl::drawPolyLineBezier(sal_uInt32 nPoints, const SalPoint* pPtAry, - const PolyFlags* pFlgAry) +bool SkiaSalGraphicsImpl::drawPolyLineBezier(sal_uInt32, const SalPoint*, const PolyFlags*) { - (void)nPoints; - (void)pPtAry; - (void)pFlgAry; + // TODO? return false; } -bool SkiaSalGraphicsImpl::drawPolygonBezier(sal_uInt32 nPoints, const SalPoint* pPtAry, - const PolyFlags* pFlgAry) +bool SkiaSalGraphicsImpl::drawPolygonBezier(sal_uInt32, const SalPoint*, const PolyFlags*) { - (void)nPoints; - (void)pPtAry; - (void)pFlgAry; + // TODO? return false; } -bool SkiaSalGraphicsImpl::drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32* pPoints, - const SalPoint* const* pPtAry, - const PolyFlags* const* pFlgAry) +bool SkiaSalGraphicsImpl::drawPolyPolygonBezier(sal_uInt32, const sal_uInt32*, + const SalPoint* const*, const PolyFlags* const*) { - (void)nPoly; - (void)pPoints; - (void)pPtAry; - (void)pFlgAry; + // TODO? return false; } @@ -1005,15 +994,9 @@ void SkiaSalGraphicsImpl::invert(sal_uInt32 nPoints, const SalPoint* pPointArray invert(aPolygon, eFlags); } -bool SkiaSalGraphicsImpl::drawEPS(long nX, long nY, long nWidth, long nHeight, void* pPtr, - sal_uInt32 nSize) +bool SkiaSalGraphicsImpl::drawEPS(long, long, long, long, void*, sal_uInt32) { - (void)nX; - (void)nY; - (void)nWidth; - (void)nHeight; - (void)pPtr; - (void)nSize; + // TODO? return false; } @@ -1122,11 +1105,9 @@ bool SkiaSalGraphicsImpl::drawAlphaRect(long nX, long nY, long nWidth, long nHei return true; } -bool SkiaSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolygon, - const Gradient& rGradient) +bool SkiaSalGraphicsImpl::drawGradient(const tools::PolyPolygon&, const Gradient&) { - (void)rPolygon; - (void)rGradient; + // TODO? return false; } diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx index c1ff1f13e9e3..de49400cd481 100644 --- a/vcl/skia/salbmp.cxx +++ b/vcl/skia/salbmp.cxx @@ -164,15 +164,11 @@ bool SkiaSalBitmap::Create(const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount) // TODO copy data SAL_INFO("vcl.skia", "copy(" << this << "): (" << &src << ")"); abort(); - return true; } -bool SkiaSalBitmap::Create(const css::uno::Reference<css::rendering::XBitmapCanvas>& rBitmapCanvas, - Size& rSize, bool bMask) +bool SkiaSalBitmap::Create(const css::uno::Reference<css::rendering::XBitmapCanvas>&, Size&, bool) { - (void)rBitmapCanvas; - (void)rSize; - (void)bMask; + // TODO? return false; } @@ -187,9 +183,9 @@ Size SkiaSalBitmap::GetSize() const { return mSize; } sal_uInt16 SkiaSalBitmap::GetBitCount() const { return mBitCount; } -BitmapBuffer* SkiaSalBitmap::AcquireBuffer(BitmapAccessMode nMode) +BitmapBuffer* SkiaSalBitmap::AcquireBuffer(BitmapAccessMode /*nMode*/) { - (void)nMode; // TODO + //(void)nMode; // TODO if (mBitmap.drawsNothing() && !mBuffer) return nullptr; BitmapBuffer* buffer = new BitmapBuffer; @@ -257,27 +253,23 @@ void SkiaSalBitmap::ReleaseBuffer(BitmapBuffer* pBuffer, BitmapAccessMode nMode) delete pBuffer; } -bool SkiaSalBitmap::GetSystemData(BitmapSystemData& rData) +bool SkiaSalBitmap::GetSystemData(BitmapSystemData&) { - (void)rData; + // TODO? return false; } bool SkiaSalBitmap::ScalingSupported() const { return false; } -bool SkiaSalBitmap::Scale(const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag) +bool SkiaSalBitmap::Scale(const double&, const double&, BmpScaleFlag) { - (void)rScaleX; - (void)rScaleY; - (void)nScaleFlag; + // TODO? return false; } -bool SkiaSalBitmap::Replace(const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol) +bool SkiaSalBitmap::Replace(const Color&, const Color&, sal_uInt8) { - (void)rSearchColor; - (void)rReplaceColor; - (void)nTol; + // TODO? return false; } @@ -298,10 +290,10 @@ const SkBitmap& SkiaSalBitmap::GetSkBitmap() const // Convert 24bpp RGB/BGR to 32bpp RGBA/BGRA. std::unique_ptr<sal_uInt8[]> data(new sal_uInt8[mSize.Height() * mSize.Width() * 4]); sal_uInt8* dest = data.get(); - for (int y = 0; y < mSize.Height(); ++y) + for (long y = 0; y < mSize.Height(); ++y) { const sal_uInt8* src = mBuffer.get() + mScanlineSize * y; - for (int x = 0; x < mSize.Width(); ++x) + for (long x = 0; x < mSize.Width(); ++x) { *dest++ = *src++; *dest++ = *src++; diff --git a/vcl/source/bitmap/salbmp.cxx b/vcl/source/bitmap/salbmp.cxx index 28a46ccc262b..c9aca589edba 100644 --- a/vcl/source/bitmap/salbmp.cxx +++ b/vcl/source/bitmap/salbmp.cxx @@ -148,7 +148,7 @@ std::unique_ptr< sal_uInt8[] > SalBitmap::convertDataBitCount( const sal_uInt8* { assert( bitCount == 1 || bitCount == 4 || bitCount == 8 ); static const int bpp[] = { 1, 3, 3, 4, 4 }; - std::unique_ptr< sal_uInt8[] > data( new sal_uInt8[width * height * bpp[ (int)type ]] ); + std::unique_ptr< sal_uInt8[] > data( new sal_uInt8[width * height * bpp[ static_cast<int>(type) ]] ); std::unique_ptr<ImplPixelFormat> pSrcFormat(ImplPixelFormat::GetFormat(bitCount, palette)); const sal_uInt8* pSrcData = src; |