diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-10-20 15:42:33 +0900 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-11-17 14:15:42 +0000 |
commit | 703f3f452b470687bdc3041abe4f3d75230ac8c1 (patch) | |
tree | 4333630e380aaca2005c90e251dae8be270fb619 /vcl | |
parent | 530bc021ebc5c70237d1b37d783d2e3dd2699aaa (diff) |
vcl: These can be static assertions
Change-Id: I220ae4732f221c7798f162653cad01717afb659f
Reviewed-on: https://gerrit.libreoffice.org/20011
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/win/source/gdi/gdiimpl.cxx | 21 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 4 |
2 files changed, 9 insertions, 16 deletions
diff --git a/vcl/win/source/gdi/gdiimpl.cxx b/vcl/win/source/gdi/gdiimpl.cxx index ad5f22e597b0..c888c2ab0d64 100644 --- a/vcl/win/source/gdi/gdiimpl.cxx +++ b/vcl/win/source/gdi/gdiimpl.cxx @@ -981,8 +981,7 @@ void WinSalGraphicsImpl::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, Sal POINT* pWinPtAry; // for NT, we can handover the array directly - DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ), - "WinSalGraphicsImpl::DrawPolyLine(): POINT != SalPoint" ); + static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); pWinPtAry = (POINT*)pPtAry; // for Windows 95 and its maximum number of points @@ -1648,8 +1647,7 @@ void WinSalGraphicsImpl::drawRect( long nX, long nY, long nWidth, long nHeight ) void WinSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) { // for NT, we can handover the array directly - DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ), - "WinSalGraphicsImpl::DrawPolyLine(): POINT != SalPoint" ); + static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); POINT* pWinPtAry = (POINT*)pPtAry; @@ -1695,8 +1693,7 @@ void WinSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAr void WinSalGraphicsImpl::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) { // for NT, we can handover the array directly - DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ), - "WinSalGraphicsImpl::DrawPolygon(): POINT != SalPoint" ); + static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); POINT* pWinPtAry = (POINT*)pPtAry; // for Windows 95 and its maximum number of points @@ -1732,8 +1729,7 @@ void WinSalGraphicsImpl::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pP else pWinPointAryAry = new POINT[nPolyPolyPoints]; // for NT, we can handover the array directly - DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ), - "WinSalGraphicsImpl::DrawPolyPolygon(): POINT != SalPoint" ); + static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); UINT n = 0; for ( i = 0; i < (UINT)nPoly; i++ ) { @@ -1774,8 +1770,7 @@ bool WinSalGraphicsImpl::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* { #ifdef USE_GDI_BEZIERS // for NT, we can handover the array directly - DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ), - "WinSalGraphicsImpl::DrawPolyLineBezier(): POINT != SalPoint" ); + static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); ImplRenderPath( mrParent.getHDC(), nPoints, pPtAry, pFlgAry ); @@ -1789,8 +1784,7 @@ bool WinSalGraphicsImpl::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* { #ifdef USE_GDI_BEZIERS // for NT, we can handover the array directly - DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ), - "WinSalGraphicsImpl::DrawPolygonBezier(): POINT != SalPoint" ); + static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); POINT aStackAry1[SAL_POLY_STACKBUF]; BYTE aStackAry2[SAL_POLY_STACKBUF]; @@ -1840,8 +1834,7 @@ bool WinSalGraphicsImpl::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt { #ifdef USE_GDI_BEZIERS // for NT, we can handover the array directly - DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ), - "WinSalGraphicsImpl::DrawPolyPolygonBezier(): POINT != SalPoint" ); + static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); sal_uLong nCurrPoly, nTotalPoints; const sal_uInt32* pCurrPoints = pPoints; diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 705335f17a49..697efae532e4 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -1066,7 +1066,7 @@ bool WinSalFrame::PostEvent(ImplSVEvent* pData) void WinSalFrame::SetTitle( const OUString& rTitle ) { - DBG_ASSERT( sizeof( WCHAR ) == sizeof( sal_Unicode ), "WinSalFrame::SetTitle(): WCHAR != sal_Unicode" ); + static_assert( sizeof( WCHAR ) == sizeof( sal_Unicode ), "must be the same size" ); SetWindowTextW( mhWnd, reinterpret_cast<LPCWSTR>(rTitle.getStr()) ); } @@ -2297,7 +2297,7 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf, UINT& rCount, UINT nMaxSize, const sal_Char* pReplace ) { - DBG_ASSERT( sizeof( WCHAR ) == sizeof( sal_Unicode ), "WinSalFrame::ImplGetKeyNameTextW(): WCHAR != sal_Unicode" ); + static_assert( sizeof( WCHAR ) == sizeof( sal_Unicode ), "must be the same size" ); static const int nMaxKeyLen = 350; WCHAR aKeyBuf[ nMaxKeyLen ]; |