Kaydet (Commit) 224b770f authored tarafından Noel Grandin's avatar Noel Grandin

remove UL/L suffixes from shift-by-constant expressions

Change-Id: Ia470f643e3eefeccc14183133603db260460bd53
Reviewed-on: https://gerrit.libreoffice.org/41212Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b2cb3196
......@@ -301,7 +301,7 @@ namespace drawinglayer
basegfx::B2DLineJoin aLineJoin)
{
// nSegments is for whole circle, adapt to half circle
const sal_uInt32 nVerSeg(nSegments >> 1L);
const sal_uInt32 nVerSeg(nSegments >> 1);
std::vector< BasePrimitive3D* > aResultVector;
if(nVerSeg)
......
......@@ -87,7 +87,7 @@ namespace drawinglayer
// different from forced to sphere texture coordinates,
// create a old version from it by rotating to old state before applying
// the texture coordinates to emulate old behaviour
fRelativeAngle = F_2PI * ((double)((getHorizontalSegments() >> 1L) - 1L) / (double)getHorizontalSegments());
fRelativeAngle = F_2PI * ((double)((getHorizontalSegments() >> 1) - 1L) / (double)getHorizontalSegments());
basegfx::B3DHomMatrix aRot;
aRot.rotate(0.0, fRelativeAngle, 0.0);
aFill.transform(aRot);
......
......@@ -188,7 +188,7 @@ inline sal_uInt8 Color::GetLuminance() const
{
return static_cast<sal_uInt8>((COLORDATA_BLUE(mnColor) * 29UL +
COLORDATA_GREEN(mnColor) * 151UL +
COLORDATA_RED(mnColor) * 76UL) >> 8UL);
COLORDATA_RED(mnColor) * 76UL) >> 8);
}
inline void Color::Merge( const Color& rMergeColor, sal_uInt8 cTransparency )
......
......@@ -93,7 +93,7 @@ constexpr ColorData RGB_COLORDATA(sal_uInt8 r, sal_uInt8 g, sal_uInt8 b) {
#define COL_AUTHOR9_LIGHT RGB_COLORDATA(255, 231, 199)
#define COLOR_CHANNEL_MERGE( _def_cDst, _def_cSrc, _def_cSrcTrans ) \
((sal_uInt8)((((long)(_def_cDst)-(_def_cSrc))*(_def_cSrcTrans)+(((_def_cSrc)<<8L)|(_def_cDst)))>>8L))
((sal_uInt8)((((long)(_def_cDst)-(_def_cSrc))*(_def_cSrcTrans)+(((_def_cSrc)<<8)|(_def_cDst)))>>8))
#endif
......
......@@ -775,7 +775,7 @@ inline sal_uLong Bitmap::GetColorCount() const
inline sal_uLong Bitmap::GetSizeBytes() const
{
const Size aSizePix( GetSizePixel() );
return( ( (sal_uLong) aSizePix.Width() * aSizePix.Height() * GetBitCount() ) >> 3UL );
return( ( (sal_uLong) aSizePix.Width() * aSizePix.Height() * GetBitCount() ) >> 3 );
}
#endif // INCLUDED_VCL_BITMAP_HXX
......
......@@ -524,7 +524,7 @@ inline void ColorMask::SetColorFor8Bit( const BitmapColor& rColor, sal_uInt8* pP
inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, const sal_uInt8* pPixel ) const
{
const sal_uInt32 nVal = pPixel[ 1 ] | ( (sal_uInt32) pPixel[ 0 ] << 8UL );
const sal_uInt32 nVal = pPixel[ 1 ] | ( (sal_uInt32) pPixel[ 0 ] << 8 );
MASK_TO_COLOR( nVal, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, rColor );
}
......@@ -533,13 +533,13 @@ inline void ColorMask::SetColorFor16BitMSB( const BitmapColor& rColor, sal_uInt8
{
const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, 0/*nAlphaChannel*/ );
pPixel[ 0 ] = (sal_uInt8)(nVal >> 8U);
pPixel[ 0 ] = (sal_uInt8)(nVal >> 8);
pPixel[ 1 ] = (sal_uInt8) nVal;
}
inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, const sal_uInt8* pPixel ) const
{
const sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL );
const sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8 );
MASK_TO_COLOR( nVal, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, rColor );
}
......@@ -549,21 +549,21 @@ inline void ColorMask::SetColorFor16BitLSB( const BitmapColor& rColor, sal_uInt8
const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, 0/*nAlphaChannel*/ );
pPixel[ 0 ] = (sal_uInt8) nVal;
pPixel[ 1 ] = (sal_uInt8)(nVal >> 8U);
pPixel[ 1 ] = (sal_uInt8)(nVal >> 8);
}
inline void ColorMask::GetColorFor32Bit( BitmapColor& rColor, const sal_uInt8* pPixel ) const
{
const sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) |
( (sal_uInt32) pPixel[ 2 ] << 16UL ) | ( (sal_uInt32) pPixel[ 3 ] << 24UL );
const sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8 ) |
( (sal_uInt32) pPixel[ 2 ] << 16 ) | ( (sal_uInt32) pPixel[ 3 ] << 24 );
MASK_TO_COLOR( nVal, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, rColor );
}
inline void ColorMask::GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8& rAlpha, const sal_uInt8* pPixel ) const
{
const sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) |
( (sal_uInt32) pPixel[ 2 ] << 16UL ) | ( (sal_uInt32) pPixel[ 3 ] << 24UL );
const sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8 ) |
( (sal_uInt32) pPixel[ 2 ] << 16 ) | ( (sal_uInt32) pPixel[ 3 ] << 24 );
rAlpha = (sal_uInt8)(nVal >> 24);
MASK_TO_COLOR( nVal, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, rColor );
......@@ -573,9 +573,9 @@ inline void ColorMask::SetColorFor32Bit( const BitmapColor& rColor, sal_uInt8* p
{
const sal_uInt32 nVal = COLOR_TO_MASK( rColor, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, 0/*nAlphaChannel*/ );
pPixel[ 0 ] = (sal_uInt8) nVal;
pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL );
pPixel[ 2 ] = (sal_uInt8) ( nVal >> 16UL );
pPixel[ 3 ] = (sal_uInt8) ( nVal >> 24UL );
pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8 );
pPixel[ 2 ] = (sal_uInt8) ( nVal >> 16 );
pPixel[ 3 ] = (sal_uInt8) ( nVal >> 24 );
}
#endif // INCLUDED_VCL_SALBTYPE_HXX
......
......@@ -24,14 +24,14 @@
#include <rtl/cipher.h>
#define RTL_CIPHER_NTOHL(c, l) \
((l) = ((sal_uInt32)(*((c)++))) << 24L, \
(l) |= ((sal_uInt32)(*((c)++))) << 16L, \
((l) = ((sal_uInt32)(*((c)++))) << 24, \
(l) |= ((sal_uInt32)(*((c)++))) << 16, \
(l) |= ((sal_uInt32)(*((c)++))) << 8L, \
(l) |= ((sal_uInt32)(*((c)++))))
#define RTL_CIPHER_HTONL(l, c) \
(*((c)++) = (sal_uInt8)(((l) >> 24L) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 16L) & 0xff), \
(*((c)++) = (sal_uInt8)(((l) >> 24) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 16) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 8L) & 0xff), \
*((c)++) = (sal_uInt8)(((l) ) & 0xff))
......@@ -45,17 +45,17 @@
SAL_FALLTHROUGH; \
case 7: (xr) |= ((sal_uInt32)(*(--(c)))) << 8L; \
SAL_FALLTHROUGH; \
case 6: (xr) |= ((sal_uInt32)(*(--(c)))) << 16L; \
case 6: (xr) |= ((sal_uInt32)(*(--(c)))) << 16; \
SAL_FALLTHROUGH; \
case 5: (xr) |= ((sal_uInt32)(*(--(c)))) << 24L; \
case 5: (xr) |= ((sal_uInt32)(*(--(c)))) << 24; \
SAL_FALLTHROUGH; \
case 4: (xl) = ((sal_uInt32)(*(--(c)))); \
SAL_FALLTHROUGH; \
case 3: (xl) |= ((sal_uInt32)(*(--(c)))) << 8L; \
SAL_FALLTHROUGH; \
case 2: (xl) |= ((sal_uInt32)(*(--(c)))) << 16L; \
case 2: (xl) |= ((sal_uInt32)(*(--(c)))) << 16; \
SAL_FALLTHROUGH; \
case 1: (xl) |= ((sal_uInt32)(*(--(c)))) << 24L; \
case 1: (xl) |= ((sal_uInt32)(*(--(c)))) << 24; \
} \
}
......@@ -68,17 +68,17 @@
SAL_FALLTHROUGH; \
case 7: *(--(c)) = (sal_uInt8)(((xr) >> 8L) & 0xff); \
SAL_FALLTHROUGH; \
case 6: *(--(c)) = (sal_uInt8)(((xr) >> 16L) & 0xff); \
case 6: *(--(c)) = (sal_uInt8)(((xr) >> 16) & 0xff); \
SAL_FALLTHROUGH; \
case 5: *(--(c)) = (sal_uInt8)(((xr) >> 24L) & 0xff); \
case 5: *(--(c)) = (sal_uInt8)(((xr) >> 24) & 0xff); \
SAL_FALLTHROUGH; \
case 4: *(--(c)) = (sal_uInt8)(((xl) ) & 0xff); \
SAL_FALLTHROUGH; \
case 3: *(--(c)) = (sal_uInt8)(((xl) >> 8L) & 0xff); \
SAL_FALLTHROUGH; \
case 2: *(--(c)) = (sal_uInt8)(((xl) >> 16L) & 0xff); \
case 2: *(--(c)) = (sal_uInt8)(((xl) >> 16) & 0xff); \
SAL_FALLTHROUGH; \
case 1: *(--(c)) = (sal_uInt8)(((xl) >> 24L) & 0xff); \
case 1: *(--(c)) = (sal_uInt8)(((xl) >> 24) & 0xff); \
} \
}
......
......@@ -29,16 +29,16 @@
#define RTL_DIGEST_ROTL(a,n) (((a) << (n)) | ((a) >> (32 - (n))))
#define RTL_DIGEST_HTONL(l,c) \
(*((c)++) = (sal_uInt8)(((l) >> 24L) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 16L) & 0xff), \
(*((c)++) = (sal_uInt8)(((l) >> 24) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 16) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 8L) & 0xff), \
*((c)++) = (sal_uInt8)(((l) ) & 0xff))
#define RTL_DIGEST_LTOC(l,c) \
(*((c)++) = (sal_uInt8)(((l) ) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 8L) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 16L) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 24L) & 0xff))
*((c)++) = (sal_uInt8)(((l) >> 16) & 0xff), \
*((c)++) = (sal_uInt8)(((l) >> 24) & 0xff))
typedef rtlDigestError (SAL_CALL Digest_init_t) (
void *ctx, const sal_uInt8 *Data, sal_uInt32 DatLen);
......@@ -616,9 +616,9 @@ static void endMD5(DigestContextMD5 *ctx)
SAL_FALLTHROUGH;
case 1: X[i] |= ((sal_uInt32)(*(p++))) << 8L;
SAL_FALLTHROUGH;
case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16;
SAL_FALLTHROUGH;
case 3: X[i] |= ((sal_uInt32)(*p)) << 24L;
case 3: X[i] |= ((sal_uInt32)(*p)) << 24;
}
i += 1;
......@@ -1038,9 +1038,9 @@ static void endSHA(DigestContextSHA *ctx)
SAL_FALLTHROUGH;
case 1: X[i] |= ((sal_uInt32)(*(p++))) << 8L;
SAL_FALLTHROUGH;
case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16;
SAL_FALLTHROUGH;
case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24;
}
swapLong(X, i + 1);
......
......@@ -84,7 +84,7 @@ namespace internal
// Costs about 17 cycles on a RISC machine with infinite
// instruction level parallelism (~42 basic
// instructions). Thus I truly doubt this pays off...
return reinterpret_cast< ::std::size_t >(rKey.mxRef.get()) ^ (rKey.mnParagraphIndex << 16L);
return reinterpret_cast< ::std::size_t >(rKey.mxRef.get()) ^ (rKey.mnParagraphIndex << 16);
}
};
......
......@@ -38,7 +38,7 @@
#define WATERMARK_LUM_OFFSET 50
#define WATERMARK_CON_OFFSET -70
#define MAP( cVal0, cVal1, nFrac ) ((sal_uInt8)((((long)(cVal0)<<20L)+nFrac*((long)(cVal1)-(cVal0)))>>20L))
#define MAP( cVal0, cVal1, nFrac ) ((sal_uInt8)((((long)(cVal0)<<20)+nFrac*((long)(cVal1)-(cVal0)))>>20))
GraphicManager::GraphicManager( sal_uLong nCacheSize, sal_uLong nMaxObjCacheSize ) :
......
......@@ -173,7 +173,7 @@ void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegio
int nR = comphelper::rng::uniform_int_distribution(0, 0x7F-1);
int nG = comphelper::rng::uniform_int_distribution(0, 0x7F-1);
int nB = comphelper::rng::uniform_int_distribution(0, 0x7F-1);
const Color aColor(((((nR|0x80)<<8L)|(nG|0x80))<<8L)|(nB|0x80));
const Color aColor(((((nR|0x80)<<8)|(nG|0x80))<<8)|(nB|0x80));
mpOutputDevice->SetLineColor(aColor);
mpOutputDevice->SetFillColor();
......
......@@ -364,9 +364,9 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
{
sal_uInt16 nLuminance((sal_uInt16)pReadAccess->GetLuminance(y, x) + 1);
const BitmapColor aDestColor(
(sal_uInt8)((nLuminance * (sal_uInt16)aShadowColor.GetRed()) >> 8L),
(sal_uInt8)((nLuminance * (sal_uInt16)aShadowColor.GetGreen()) >> 8L),
(sal_uInt8)((nLuminance * (sal_uInt16)aShadowColor.GetBlue()) >> 8L));
(sal_uInt8)((nLuminance * (sal_uInt16)aShadowColor.GetRed()) >> 8),
(sal_uInt8)((nLuminance * (sal_uInt16)aShadowColor.GetGreen()) >> 8),
(sal_uInt8)((nLuminance * (sal_uInt16)aShadowColor.GetBlue()) >> 8));
pWriteAccess->SetPixel(y, x, aDestColor);
}
}
......
......@@ -2440,7 +2440,7 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpl
{
SdrModel* pModel = pPageObj->GetModel();
SdrPage* pNewPage = nullptr;
const sal_uInt16 nDestinationPageNum((sal_uInt16)((nPageNum << 1L) - 1L));
const sal_uInt16 nDestinationPageNum((sal_uInt16)((nPageNum << 1) - 1L));
if(pModel)
{
......
......@@ -38,9 +38,9 @@ public:
}
ImpErrorQuad( const BitmapColor& rColor )
: nRed( (long) rColor.GetRed() << 5L )
, nGreen( (long) rColor.GetGreen() << 5L )
, nBlue( (long) rColor.GetBlue() << 5L )
: nRed( (long) rColor.GetRed() << 5 )
, nGreen( (long) rColor.GetGreen() << 5 )
, nBlue( (long) rColor.GetBlue() << 5 )
{
}
......@@ -57,53 +57,53 @@ public:
inline void ImpErrorQuad::operator=( const BitmapColor& rColor )
{
nRed = (long) rColor.GetRed() << 5L;
nGreen = (long) rColor.GetGreen() << 5L;
nBlue = (long) rColor.GetBlue() << 5L;
nRed = (long) rColor.GetRed() << 5;
nGreen = (long) rColor.GetGreen() << 5;
nBlue = (long) rColor.GetBlue() << 5;
}
inline ImpErrorQuad& ImpErrorQuad::operator-=( const BitmapColor& rColor )
{
nRed -= ( (long) rColor.GetRed() << 5L );
nGreen -= ( (long) rColor.GetGreen() << 5L );
nBlue -= ( (long) rColor.GetBlue() << 5L );
nRed -= ( (long) rColor.GetRed() << 5 );
nGreen -= ( (long) rColor.GetGreen() << 5 );
nBlue -= ( (long) rColor.GetBlue() << 5 );
return *this;
}
inline void ImpErrorQuad::ImplAddColorError1( const ImpErrorQuad& rErrQuad )
{
nRed += ( rErrQuad.nRed >> 4L );
nGreen += ( rErrQuad.nGreen >> 4L );
nBlue += ( rErrQuad.nBlue >> 4L );
nRed += ( rErrQuad.nRed >> 4 );
nGreen += ( rErrQuad.nGreen >> 4 );
nBlue += ( rErrQuad.nBlue >> 4 );
}
inline void ImpErrorQuad::ImplAddColorError3( const ImpErrorQuad& rErrQuad )
{
nRed += ( rErrQuad.nRed * 3L >> 4L );
nGreen += ( rErrQuad.nGreen * 3L >> 4L );
nBlue += ( rErrQuad.nBlue * 3L >> 4L );
nRed += ( rErrQuad.nRed * 3L >> 4 );
nGreen += ( rErrQuad.nGreen * 3L >> 4 );
nBlue += ( rErrQuad.nBlue * 3L >> 4 );
}
inline void ImpErrorQuad::ImplAddColorError5( const ImpErrorQuad& rErrQuad )
{
nRed += ( rErrQuad.nRed * 5L >> 4L );
nGreen += ( rErrQuad.nGreen * 5L >> 4L );
nBlue += ( rErrQuad.nBlue * 5L >> 4L );
nRed += ( rErrQuad.nRed * 5L >> 4 );
nGreen += ( rErrQuad.nGreen * 5L >> 4 );
nBlue += ( rErrQuad.nBlue * 5L >> 4 );
}
inline void ImpErrorQuad::ImplAddColorError7( const ImpErrorQuad& rErrQuad )
{
nRed += ( rErrQuad.nRed * 7L >> 4L );
nGreen += ( rErrQuad.nGreen * 7L >> 4L );
nBlue += ( rErrQuad.nBlue *7L >> 4L );
nRed += ( rErrQuad.nRed * 7L >> 4 );
nGreen += ( rErrQuad.nGreen * 7L >> 4 );
nBlue += ( rErrQuad.nBlue *7L >> 4 );
}
inline BitmapColor ImpErrorQuad::ImplGetColor()
{
return BitmapColor( (sal_uInt8) ( ( nRed < 0L ? 0L : nRed > 8160L ? 8160L : nRed ) >> 5L ),
(sal_uInt8) ( ( nGreen < 0L ? 0L : nGreen > 8160L ? 8160L : nGreen ) >> 5L ),
(sal_uInt8) ( ( nBlue < 0L ? 0L : nBlue > 8160L ? 8160L : nBlue ) >> 5L ) );
return BitmapColor( (sal_uInt8) ( ( nRed < 0L ? 0L : nRed > 8160L ? 8160L : nRed ) >> 5 ),
(sal_uInt8) ( ( nGreen < 0L ? 0L : nGreen > 8160L ? 8160L : nGreen ) >> 5 ),
(sal_uInt8) ( ( nBlue < 0L ? 0L : nBlue > 8160L ? 8160L : nBlue ) >> 5 ) );
}
class ImpNodeCache
......
......@@ -26,7 +26,7 @@
namespace {
#define MAP( cVal0, cVal1, nFrac ) ((sal_uInt8)((((long)(cVal0)<<7L)+nFrac*((long)(cVal1)-(cVal0)))>>7L))
#define MAP( cVal0, cVal1, nFrac ) ((sal_uInt8)((((long)(cVal0)<<7)+nFrac*((long)(cVal1)-(cVal0)))>>7))
void generateMap(long nW, long nDstW, bool bHMirr, long* pMapIX, long* pMapFX)
{
......@@ -286,7 +286,7 @@ void scaleNonPalleteGeneral(ScaleContext &rCtx, long nStartY, long nEndY)
void scalePallete8bit2(ScaleContext &rCtx, long nStartY, long nEndY)
{
const long nStartX = 0, nEndX = rCtx.mnDestW - 1L;
const long nMax = 1 << 7L;
const long nMax = 1 << 7;
for( long nY = nStartY; nY <= nEndY; nY++ )
{
......@@ -342,10 +342,10 @@ void scalePallete8bit2(ScaleContext &rCtx, long nStartY, long nEndY)
if(nX == nEndX )
{
nSumRowB += rCol.GetBlue() << 7L;
nSumRowG += rCol.GetGreen() << 7L;
nSumRowR += rCol.GetRed() << 7L;
nTotalWeightX += 1 << 7L;
nSumRowB += rCol.GetBlue() << 7;
nSumRowG += rCol.GetGreen() << 7;
nSumRowR += rCol.GetRed() << 7;
nTotalWeightX += 1 << 7;
}
else if( j == 0 )
{
......@@ -365,10 +365,10 @@ void scalePallete8bit2(ScaleContext &rCtx, long nStartY, long nEndY)
}
else
{
nSumRowB += rCol.GetBlue() << 7L;
nSumRowG += rCol.GetGreen() << 7L;
nSumRowR += rCol.GetRed() << 7L;
nTotalWeightX += 1 << 7L;
nSumRowB += rCol.GetBlue() << 7;
nSumRowG += rCol.GetGreen() << 7;
nSumRowR += rCol.GetRed() << 7;
nTotalWeightX += 1 << 7;
}
}
......@@ -411,7 +411,7 @@ void scalePallete8bit2(ScaleContext &rCtx, long nStartY, long nEndY)
void scalePalleteGeneral2(ScaleContext &rCtx, long nStartY, long nEndY)
{
const long nStartX = 0, nEndX = rCtx.mnDestW - 1L;
const long nMax = 1 << 7L;
const long nMax = 1 << 7;
for( long nY = nStartY; nY <= nEndY; nY++ )
{
......@@ -466,10 +466,10 @@ void scalePalleteGeneral2(ScaleContext &rCtx, long nStartY, long nEndY)
if(nX == nEndX )
{
nSumRowB += aCol0.GetBlue() << 7L;
nSumRowG += aCol0.GetGreen() << 7L;
nSumRowR += aCol0.GetRed() << 7L;
nTotalWeightX += 1 << 7L;
nSumRowB += aCol0.GetBlue() << 7;
nSumRowG += aCol0.GetGreen() << 7;
nSumRowR += aCol0.GetRed() << 7;
nTotalWeightX += 1 << 7;
}
else if( j == 0 )
{
......@@ -492,10 +492,10 @@ void scalePalleteGeneral2(ScaleContext &rCtx, long nStartY, long nEndY)
else
{
nSumRowB += aCol0.GetBlue() << 7L;
nSumRowG += aCol0.GetGreen() << 7L;
nSumRowR += aCol0.GetRed() << 7L;
nTotalWeightX += 1 << 7L;
nSumRowB += aCol0.GetBlue() << 7;
nSumRowG += aCol0.GetGreen() << 7;
nSumRowR += aCol0.GetRed() << 7;
nTotalWeightX += 1 << 7;
}
}
......@@ -538,7 +538,7 @@ void scalePalleteGeneral2(ScaleContext &rCtx, long nStartY, long nEndY)
void scale24bitBGR2(ScaleContext &rCtx, long nStartY, long nEndY)
{
const long nStartX = 0, nEndX = rCtx.mnDestW - 1L;
const long nMax = 1 << 7L;
const long nMax = 1 << 7;
for( long nY = nStartY; nY <= nEndY; nY++ )
{
......@@ -594,10 +594,10 @@ void scale24bitBGR2(ScaleContext &rCtx, long nStartY, long nEndY)
{
if(nX == nEndX )
{
nSumRowB += ( *pTmpX ) << 7L;pTmpX++;
nSumRowG += ( *pTmpX ) << 7L;pTmpX++;
nSumRowR += ( *pTmpX ) << 7L;pTmpX++;
nTotalWeightX += 1 << 7L;
nSumRowB += ( *pTmpX ) << 7;pTmpX++;
nSumRowG += ( *pTmpX ) << 7;pTmpX++;
nSumRowR += ( *pTmpX ) << 7;pTmpX++;
nTotalWeightX += 1 << 7;
}
else if( j == 0 )
{
......@@ -617,10 +617,10 @@ void scale24bitBGR2(ScaleContext &rCtx, long nStartY, long nEndY)
}
else
{
nSumRowB += ( *pTmpX ) << 7L;pTmpX++;
nSumRowG += ( *pTmpX ) << 7L;pTmpX++;
nSumRowR += ( *pTmpX ) << 7L;pTmpX++;
nTotalWeightX += 1 << 7L;
nSumRowB += ( *pTmpX ) << 7;pTmpX++;
nSumRowG += ( *pTmpX ) << 7;pTmpX++;
nSumRowR += ( *pTmpX ) << 7;pTmpX++;
nTotalWeightX += 1 << 7;
}
}
......@@ -661,7 +661,7 @@ void scale24bitBGR2(ScaleContext &rCtx, long nStartY, long nEndY)
void scale24bitRGB2(ScaleContext &rCtx, long nStartY, long nEndY)
{
const long nStartX = 0, nEndX = rCtx.mnDestW - 1L;
const long nMax = 1 << 7L;
const long nMax = 1 << 7;
for( long nY = nStartY; nY <= nEndY; nY++ )
{
......@@ -715,10 +715,10 @@ void scale24bitRGB2(ScaleContext &rCtx, long nStartY, long nEndY)
{
if(nX == nEndX )
{
nSumRowR += ( *pTmpX ) << 7L;pTmpX++;
nSumRowG += ( *pTmpX ) << 7L;pTmpX++;
nSumRowB += ( *pTmpX ) << 7L;pTmpX++;
nTotalWeightX += 1 << 7L;
nSumRowR += ( *pTmpX ) << 7;pTmpX++;
nSumRowG += ( *pTmpX ) << 7;pTmpX++;
nSumRowB += ( *pTmpX ) << 7;pTmpX++;
nTotalWeightX += 1 << 7;
}
else if( j == 0 )
{
......@@ -738,10 +738,10 @@ void scale24bitRGB2(ScaleContext &rCtx, long nStartY, long nEndY)
}
else
{
nSumRowR += ( *pTmpX ) << 7L;pTmpX++;
nSumRowG += ( *pTmpX ) << 7L;pTmpX++;
nSumRowB += ( *pTmpX ) << 7L;pTmpX++;
nTotalWeightX += 1 << 7L;
nSumRowR += ( *pTmpX ) << 7;pTmpX++;
nSumRowG += ( *pTmpX ) << 7;pTmpX++;
nSumRowB += ( *pTmpX ) << 7;pTmpX++;
nTotalWeightX += 1 << 7;
}
}
......@@ -782,7 +782,7 @@ void scale24bitRGB2(ScaleContext &rCtx, long nStartY, long nEndY)
void scaleNonPalleteGeneral2(ScaleContext &rCtx, long nStartY, long nEndY)
{
const long nStartX = 0, nEndX = rCtx.mnDestW - 1L;
const long nMax = 1 << 7L;
const long nMax = 1 << 7;
for( long nY = nStartY; nY <= nEndY; nY++ )
{
......@@ -837,10 +837,10 @@ void scaleNonPalleteGeneral2(ScaleContext &rCtx, long nStartY, long nEndY)
if(nX == nEndX )
{
nSumRowB += aCol0.GetBlue() << 7L;
nSumRowG += aCol0.GetGreen() << 7L;
nSumRowR += aCol0.GetRed() << 7L;
nTotalWeightX += 1 << 7L;
nSumRowB += aCol0.GetBlue() << 7;
nSumRowG += aCol0.GetGreen() << 7;
nSumRowR += aCol0.GetRed() << 7;
nTotalWeightX += 1 << 7;
}
else if( j == 0 )
{
......@@ -862,10 +862,10 @@ void scaleNonPalleteGeneral2(ScaleContext &rCtx, long nStartY, long nEndY)
}
else
{
nSumRowB += aCol0.GetBlue() << 7L;
nSumRowG += aCol0.GetGreen() << 7L;
nSumRowR += aCol0.GetRed() << 7L;
nTotalWeightX += 1 << 7L;
nSumRowB += aCol0.GetBlue() << 7;
nSumRowG += aCol0.GetGreen() << 7;
nSumRowR += aCol0.GetRed() << 7;
nTotalWeightX += 1 << 7;
}
}
......
......@@ -506,7 +506,7 @@ bool Bitmap::Mirror( BmpMirrorFlags nMirrorFlags )
const long nWidth = pAcc->Width();
const long nHeight = pAcc->Height();
const long nWidth1 = nWidth - 1L;
const long nWidth_2 = nWidth >> 1L;
const long nWidth_2 = nWidth >> 1;
for( long nY = 0L; nY < nHeight; nY++ )
{
......@@ -533,7 +533,7 @@ bool Bitmap::Mirror( BmpMirrorFlags nMirrorFlags )
std::unique_ptr<sal_uInt8[]> pBuffer(new sal_uInt8[ nScanSize ]);
const long nHeight = pAcc->Height();
const long nHeight1 = nHeight - 1L;
const long nHeight_2 = nHeight >> 1L;
const long nHeight_2 = nHeight >> 1;
for( long nY = 0L, nOther = nHeight1; nY < nHeight_2; nY++, nOther-- )
{
......
......@@ -1229,13 +1229,13 @@ bool Bitmap::ImplDitherMatrix()
{
for( sal_uLong nY = 0UL; nY < nHeight; nY++ )
{
for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4; nX < nWidth; nX++ )
{
const BitmapColor aCol( pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) ) );
const sal_uLong nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
const sal_uLong nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
const sal_uLong nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
const sal_uLong nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
const sal_uLong nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16;
const sal_uLong nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16;
const sal_uLong nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16;
aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
pWriteAcc->SetPixel( nY, nX, aIndex );
......@@ -1246,13 +1246,13 @@ bool Bitmap::ImplDitherMatrix()
{
for( sal_uLong nY = 0UL; nY < nHeight; nY++ )
{
for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4; nX < nWidth; nX++ )
{
const BitmapColor aCol( pReadAcc->GetPixel( nY, nX ) );
const sal_uLong nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
const sal_uLong nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
const sal_uLong nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
const sal_uLong nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
const sal_uLong nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16;
const sal_uLong nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16;
const sal_uLong nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16;
aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
pWriteAcc->SetPixel( nY, nX, aIndex );
......
......@@ -102,25 +102,25 @@ void BitmapReadAccess::SetPixelForN8BitTcMask(Scanline pScanline, long nX, const
BitmapColor BitmapReadAccess::GetPixelForN16BitTcMsbMask(ConstScanline pScanline, long nX, const ColorMask& rMask)
{
BitmapColor aColor;
rMask.GetColorFor16BitMSB( aColor, pScanline + ( nX << 1UL ) );
rMask.GetColorFor16BitMSB( aColor, pScanline + ( nX << 1 ) );
return aColor;
}
void BitmapReadAccess::SetPixelForN16BitTcMsbMask(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask)
{
rMask.SetColorFor16BitMSB( rBitmapColor, pScanline + ( nX << 1UL ) );
rMask.SetColorFor16BitMSB( rBitmapColor, pScanline + ( nX << 1 ) );
}
BitmapColor BitmapReadAccess::GetPixelForN16BitTcLsbMask(ConstScanline pScanline, long nX, const ColorMask& rMask)
{
BitmapColor aColor;
rMask.GetColorFor16BitLSB( aColor, pScanline + ( nX << 1UL ) );
rMask.GetColorFor16BitLSB( aColor, pScanline + ( nX << 1 ) );
return aColor;
}
void BitmapReadAccess::SetPixelForN16BitTcLsbMask(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask)
{
rMask.SetColorFor16BitLSB( rBitmapColor, pScanline + ( nX << 1UL ) );
rMask.SetColorFor16BitLSB( rBitmapColor, pScanline + ( nX << 1 ) );
}
BitmapColor BitmapReadAccess::GetPixelForN24BitTcBgr(ConstScanline pScanline, long nX, const ColorMask&)
......@@ -250,13 +250,13 @@ void BitmapReadAccess::SetPixelForN32BitTcRgba(Scanline pScanline, long nX, cons
BitmapColor BitmapReadAccess::GetPixelForN32BitTcMask(ConstScanline pScanline, long nX, const ColorMask& rMask)
{
BitmapColor aColor;
rMask.GetColorFor32Bit( aColor, pScanline + ( nX << 2UL ) );
rMask.GetColorFor32Bit( aColor, pScanline + ( nX << 2 ) );
return aColor;
}
void BitmapReadAccess::SetPixelForN32BitTcMask(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask)
{
rMask.SetColorFor32Bit( rBitmapColor, pScanline + ( nX << 2UL ) );
rMask.SetColorFor32Bit( rBitmapColor, pScanline + ( nX << 2 ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -615,7 +615,7 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
cTmp = *pTmp++;
}
auto nIndex = (cTmp >> ( --nShift << 2UL ) ) & 0x0f;
auto nIndex = (cTmp >> ( --nShift << 2 ) ) & 0x0f;
rAcc.SetPixelIndex(nY, nX, SanitizePaletteIndex(nIndex, rPalette, bForceToMonoWhileReading));
}
}
......
......@@ -301,7 +301,7 @@ void ImplChain::ImplGetSpace()
const sal_uLong nOldArraySize = mnArraySize;
sal_uInt8* pNewCodes;
mnArraySize = mnArraySize << 1UL;
mnArraySize = mnArraySize << 1;
pNewCodes = new sal_uInt8[ mnArraySize ];
memcpy( pNewCodes, mpCodes.get(), nOldArraySize );
mpCodes.reset( pNewCodes );
......