Commit 43b90c39 authored by Ivan.Shulga's avatar Ivan.Shulga Committed by Alexander Trofimov

std::max -> (std::max)

std::min -> (std::min)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59188 954022d7-b5bf-4e40-9824-e11837661b57
parent 3fb1ab66
......@@ -1836,7 +1836,7 @@ private:
unsigned short ushColorTableLen = 256;
if ( 0 != unColorUsed )
ushColorTableLen = std::min( (unsigned short) 256, (unsigned short) unColorUsed );
ushColorTableLen = (std::min)( (unsigned short) 256, (unsigned short) unColorUsed );
TWmfRGB oColorTable[256];
......
......@@ -255,7 +255,7 @@ public:
unsigned int unDistG = (unsigned int) abs(((int) (pRGB->g)) - ((int) (m_pRGB[ulIndex].g)));
unsigned int unDistB = (unsigned int) abs(((int) (pRGB->b)) - ((int) (m_pRGB[ulIndex].b)));
unsigned int unDist = std::max( std::max( unDistR, unDistG ),unDistB );
unsigned int unDist = (std::max)( (std::max)( unDistR, unDistG ),unDistB );
if ( unDist < unDistBest )
{
......@@ -306,17 +306,17 @@ public:
{
TWmfRGB oColor;
fRed = std::max( 0.0f, std::min( 1.0f, fRed ) );
fGreen = std::max( 0.0f, std::min( 1.0f, fGreen ) );
fBlue = std::max( 0.0f, std::min( 1.0f, fBlue ) );
fRed = (std::max)( 0.0f, (std::min)( 1.0f, fRed ) );
fGreen = (std::max)( 0.0f, (std::min)( 1.0f, fGreen ) );
fBlue = (std::max)( 0.0f, (std::min)( 1.0f, fBlue ) );
int nRed = (int) (fRed * (float) 256);
int nGreen = (int) (fGreen * (float) 256);
int nBlue = (int) (fBlue * (float) 256);
nRed = std::max( 0, std::min( 255, nRed ) );
nGreen = std::max( 0, std::min( 255, nGreen ) );
nBlue = std::max( 0, std::min( 255, nBlue ) );
nRed = (std::max)( 0, (std::min)( 255, nRed ) );
nGreen = (std::max)( 0, (std::min)( 255, nGreen ) );
nBlue = (std::max)( 0, (std::min)( 255, nBlue ) );
oColor.r = (unsigned char) nRed;
oColor.g = (unsigned char) nGreen;
......
......@@ -1518,7 +1518,7 @@ private:
if ( 0 == ( pPlayer->ulFlags & PLAYER_PLAY ) )
{
m_oColorData.Add( &(oDrawPixel.oColor) );
float fScope = (float)std::max( oDrawPixel.dPixelWidth, oDrawPixel.dPixelHeight );
float fScope = (float)(std::max)( oDrawPixel.dPixelWidth, oDrawPixel.dPixelHeight );
CoordFRegister( oDrawPixel.oPoint, fScope );
return 0;
}
......@@ -1570,7 +1570,7 @@ private:
{
TWmfPen *pPen = pPlayer->pDC->pPen;
float fScope = (float)( std::max( pPen->dWidth, pPen->dHeight ) ) / 2;
float fScope = (float)( (std::max)( pPen->dWidth, pPen->dHeight ) ) / 2;
CoordFRegister( oDrawArc.oEnd, fScope );
CoordFRegister( oDrawArc.oStart, fScope );
......@@ -1802,7 +1802,7 @@ private:
{
TWmfPen *pPen = pPlayer->pDC->pPen;
float fScope = (float) ( std::max( pPen->dWidth, pPen->dHeight ) ) / 2;
float fScope = (float) ( (std::max)( pPen->dWidth, pPen->dHeight ) ) / 2;
CoordFRegister( oDrawArc.oTL, fScope );
CoordFRegister( oDrawArc.oBR, fScope );
......@@ -1836,7 +1836,7 @@ private:
{
TWmfPen *pPen = pPlayer->pDC->pPen;
float fScope = (float) ( std::max( pPen->dWidth, pPen->dHeight ) ) / 2;
float fScope = (float) ( (std::max)( pPen->dWidth, pPen->dHeight ) ) / 2;
CoordFRegister( oDrawLine.oFrom, fScope );
CoordFRegister( oDrawLine.oTo, fScope );
return 0;
......@@ -1863,7 +1863,7 @@ private:
{
TWmfPen *pPen = pPlayer->pDC->pPen;
float fScope = (float) ( std::max( pPen->dHeight, pPen->dWidth ) ) / 2;
float fScope = (float) ( (std::max)( pPen->dHeight, pPen->dWidth ) ) / 2;
ulParamIndex = 1;
for ( unsigned short ushPointIndex = 0; ushPointIndex < oPolyLine.ushCount; ushPointIndex++ )
......@@ -1924,7 +1924,7 @@ private:
{
TWmfPen *pPen = pPlayer->pDC->pPen;
float fScope = (float) ( std::max( pPen->dWidth, pPen->dHeight ) ) / 2;
float fScope = (float) ( (std::max)( pPen->dWidth, pPen->dHeight ) ) / 2;
ulParamIndex = 1;
for ( unsigned short ushPointIndex = 0; ushPointIndex < oPolyLine.ushCount; ushPointIndex++ )
......@@ -2048,7 +2048,7 @@ private:
{
TWmfPen *pPen = pPlayer->pDC->pPen;
float fScope = (float) ( std::max( pPen->dWidth, pPen->dHeight ) ) / 2;
float fScope = (float) ( (std::max)( pPen->dWidth, pPen->dHeight ) ) / 2;
ulParamIndex = 1 + oPolyPoly.ushPolyCount;
for ( unsigned short ushPointCount = 0; ushPointCount < ushNumPars; ushPointCount++ )
......@@ -2174,7 +2174,7 @@ private:
{
TWmfPen *pPen = pPlayer->pDC->pPen;
float fScope = (float) ( std::max ( pPen->dWidth, pPen->dHeight ) ) / 2;
float fScope = (float) ( (std::max) ( pPen->dWidth, pPen->dHeight ) ) / 2;
CoordFRegister( oDrawRect.oTL, fScope );
CoordFRegister( oDrawRect.oBR, fScope );
return 0;
......@@ -2216,7 +2216,7 @@ private:
{
TWmfPen *pPen = pPlayer->pDC->pPen;
float fScope = (float) ( std::max( pPen->dHeight, pPen->dWidth ) ) / 2;
float fScope = (float) ( (std::max)( pPen->dHeight, pPen->dWidth ) ) / 2;
CoordFRegister( oDrawRect.oTL, fScope );
CoordFRegister( oDrawRect.oBR, fScope );
......@@ -2310,7 +2310,7 @@ private:
TWmfRegion *pClip = (TWmfRegion*)pPlayer->pDC->pClip;
oPolyRect.unCount = std::max( pClip->unNumRects, pRegion->unNumRects + 1 );
oPolyRect.unCount = (std::max)( pClip->unNumRects, pRegion->unNumRects + 1 );
oPolyRect.pTL = (TWmfCoordF *)m_oMemoryManager.Malloc( oPolyRect.unCount * sizeof(TWmfCoordF), _T("Meta_RegionBrush") );
if ( NULL == oPolyRect.pTL )
......@@ -2440,7 +2440,7 @@ private:
TWmfRegion *pClip = (TWmfRegion*)pPlayer->pDC->pClip;
oPolyRect.unCount = std::max( pClip->unNumRects, pRegion->unNumRects + 1 );
oPolyRect.unCount = (std::max)( pClip->unNumRects, pRegion->unNumRects + 1 );
oPolyRect.pTL = (TWmfCoordF *)m_oMemoryManager.Malloc( oPolyRect.unCount * sizeof(TWmfCoordF), _T("Meta_RegionPaint") );
if ( NULL == oPolyRect.pTL )
......@@ -3847,7 +3847,7 @@ private:
pPen->ushStyle = ( pPen->ushStyle & ~PS_TYPE_MASK ) | ( ushStyle & PS_TYPE_MASK );
unsigned short ushWidth = Record_GetUShortPar( pRecord, 1 );
ushWidth = std::max( (unsigned short) 1, ushWidth );
ushWidth = (std::max)( (unsigned short) 1, ushWidth );
pPen->dWidth = (double) ushWidth * abs( pPlayer->pDC->dPixelWidth );
pPen->dHeight = (double) ushWidth * abs( pPlayer->pDC->dPixelHeight );
......
......@@ -185,10 +185,10 @@ static bool REGION_UnionRegion(TWmfRegion *pNewRegion, TWmfRegion *pRegionA, TWm
REGION_RegionOp( pNewRegion, pRegionA, pRegionB, REGION_UnionO, REGION_UnionNonO, REGION_UnionNonO);
pNewRegion->oExtents.oTL.fX = std::min( pRegionA->oExtents.oTL.fX, pRegionB->oExtents.oTL.fX );
pNewRegion->oExtents.oTL.fY = std::min( pRegionA->oExtents.oTL.fY, pRegionB->oExtents.oTL.fY );
pNewRegion->oExtents.oBR.fX = std::max( pRegionA->oExtents.oBR.fX, pRegionB->oExtents.oBR.fX );
pNewRegion->oExtents.oBR.fY = std::max( pRegionA->oExtents.oBR.fY, pRegionB->oExtents.oBR.fY );
pNewRegion->oExtents.oTL.fX = (std::min)( pRegionA->oExtents.oTL.fX, pRegionB->oExtents.oTL.fX );
pNewRegion->oExtents.oTL.fY = (std::min)( pRegionA->oExtents.oTL.fY, pRegionB->oExtents.oTL.fY );
pNewRegion->oExtents.oBR.fX = (std::max)( pRegionA->oExtents.oBR.fX, pRegionB->oExtents.oBR.fX );
pNewRegion->oExtents.oBR.fY = (std::max)( pRegionA->oExtents.oBR.fY, pRegionB->oExtents.oBR.fY );
pNewRegion->ushType = ( pNewRegion->unNumRects ? COMPLEXREGION : NULLREGION );
......@@ -267,7 +267,7 @@ static void REGION_RegionOp (TWmfRegion *pNewRegion, TWmfRegion *pRegionA, TWm
* have to worry about using too much memory. I hope to be able to
* nuke the Xrealloc() at the end of this function eventually.
*/
pNewRegion->unSize = std::max( pRegionA->unNumRects, pRegionB->unNumRects ) * 2;
pNewRegion->unSize = (std::max)( pRegionA->unNumRects, pRegionB->unNumRects ) * 2;
if ( NULL == ( pNewRegion->pRects = (TWmfRectF *)malloc( sizeof(TWmfRectF) * pNewRegion->unSize ) ) )
{
......@@ -336,8 +336,8 @@ static void REGION_RegionOp (TWmfRegion *pNewRegion, TWmfRegion *pRegionA, TWm
*/
if ( r1->oTL.fY < r2->oTL.fY )
{
top = std::max( r1->oTL.fY, ybot );
bot = std::min( r1->oBR.fY, r2->oTL.fY );
top = (std::max)( r1->oTL.fY, ybot );
bot = (std::min)( r1->oBR.fY, r2->oTL.fY );
if ( ( top != bot ) && ( pNonOverlap1Func ) )
{
......@@ -348,8 +348,8 @@ static void REGION_RegionOp (TWmfRegion *pNewRegion, TWmfRegion *pRegionA, TWm
}
else if ( r2->oTL.fY < r1->oTL.fY )
{
top = std::max( r2->oTL.fY, ybot );
bot = std::min( r2->oBR.fY, r1->oTL.fY );
top = (std::max)( r2->oTL.fY, ybot );
bot = (std::min)( r2->oBR.fY, r1->oTL.fY );
if ( ( top != bot ) && ( pNonOverlap2Func ) )
{
......@@ -376,7 +376,7 @@ static void REGION_RegionOp (TWmfRegion *pNewRegion, TWmfRegion *pRegionA, TWm
/* Now see if we've hit an intersecting band. The two bands only
* intersect if ybot > ytop
*/
ybot = std::min( r1->oBR.fY, r2->oBR.fY );
ybot = (std::min)( r1->oBR.fY, r2->oBR.fY );
curBand = pNewRegion->unNumRects;
if ( ( ybot > ytop ) && ( pOverlapFunc ) )
{
......@@ -411,7 +411,7 @@ static void REGION_RegionOp (TWmfRegion *pNewRegion, TWmfRegion *pRegionA, TWm
while ( ( r1BandEnd < r1End ) && ( r1BandEnd->oTL.fY == r1->oTL.fY ) )
r1BandEnd++;
(*pNonOverlap1Func)( pNewRegion, r1, r1BandEnd, std::max( r1->oTL.fY, ybot ), r1->oBR.fY );
(*pNonOverlap1Func)( pNewRegion, r1, r1BandEnd, (std::max)( r1->oTL.fY, ybot ), r1->oBR.fY );
r1 = r1BandEnd;
} while ( r1 != r1End );
......@@ -425,7 +425,7 @@ static void REGION_RegionOp (TWmfRegion *pNewRegion, TWmfRegion *pRegionA, TWm
while ( ( r2BandEnd < r2End ) && ( r2BandEnd->oTL.fY == r2->oTL.fY ) )
r2BandEnd++;
(*pNonOverlap2Func)( pNewRegion, r2, r2BandEnd, std::max( r2->oTL.fY, ybot ), r2->oBR.fY );
(*pNonOverlap2Func)( pNewRegion, r2, r2BandEnd, (std::max)( r2->oTL.fY, ybot ), r2->oBR.fY );
r2 = r2BandEnd;
} while ( r2 != r2End );
......@@ -840,8 +840,8 @@ static bool REGION_IntersectO (TWmfRegion *pRegion, TWmfRectF *pRect1, TWmfRectF
while ( ( pRect1 != pRect1End ) && ( pRect2 != pRect2End ) )
{
float fLeft = std::max( pRect1->oTL.fX, pRect2->oTL.fX );
float fRight = std::min( pRect1->oBR.fX, pRect2->oBR.fX );
float fLeft = (std::max)( pRect1->oTL.fX, pRect2->oTL.fX );
float fRight = (std::min)( pRect1->oBR.fX, pRect2->oBR.fX );
/* If there's any overlap between the two rectangles, add that
* overlap to the new region.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment