diff --git a/src/Aspect/Aspect_ColorScale.cxx b/src/Aspect/Aspect_ColorScale.cxx index 853184298a..0a009c98a5 100644 --- a/src/Aspect/Aspect_ColorScale.cxx +++ b/src/Aspect/Aspect_ColorScale.cxx @@ -508,6 +508,9 @@ void Aspect_ColorScale::DrawScale( const Quantity_Color& aBgColor, Standard_Integer last1( i1 ), last2( i2 ); x = X + spacer; switch ( labPos ) { + case Aspect_TOCSP_NONE: + case Aspect_TOCSP_LEFT: + break; case Aspect_TOCSP_CENTER: x += ( colorWidth - textWidth ) / 2; break; diff --git a/src/NIS/NIS_Triangulated.cxx b/src/NIS/NIS_Triangulated.cxx index 03f26620e4..f5b300b3f9 100644 --- a/src/NIS/NIS_Triangulated.cxx +++ b/src/NIS/NIS_Triangulated.cxx @@ -772,13 +772,12 @@ Standard_Boolean NIS_Triangulated::Intersect Standard_Boolean aResult (isFullIn); if ((myType & Type_Triangulation) && myIsDrawPolygons == Standard_False) { - unsigned int iNode = 0; - for (; iNode < myNNodes * myNodeCoord; iNode += myNodeCoord) + unsigned int nbSteps = (unsigned)myNNodes * myNodeCoord; + for (unsigned int iNode = 0; iNode < nbSteps; iNode += myNodeCoord) { - gp_XYZ aPnt (static_cast(mypNodes[iNode+0]), - static_cast(mypNodes[iNode+1]), 0.); + gp_XYZ aPnt (mypNodes[iNode+0], mypNodes[iNode+1], 0.); if (myNodeCoord > 2) - aPnt.SetZ (static_cast(mypNodes[iNode+2])); + aPnt.SetZ (mypNodes[iNode+2]); theTrf.Transforms (aPnt); if (theBox.IsOut (aPnt)) { if (isFullIn) { @@ -1073,13 +1072,12 @@ Standard_Boolean NIS_Triangulated::Intersect Standard_Boolean aResult (isFullIn); if ((myType & Type_Triangulation) && myIsDrawPolygons == Standard_False) { - unsigned int iNode = 0; - for (; iNode < myNNodes * myNodeCoord; iNode += myNodeCoord) + unsigned int nbSteps = (unsigned)myNNodes * myNodeCoord; + for (unsigned int iNode = 0; iNode < nbSteps; iNode += myNodeCoord) { - gp_XYZ aPnt (static_cast(mypNodes[iNode+0]), - static_cast(mypNodes[iNode+1]), 0.); + gp_XYZ aPnt (mypNodes[iNode+0], mypNodes[iNode+1], 0.); if (myNodeCoord > 2) - aPnt.SetZ (static_cast(mypNodes[iNode+2])); + aPnt.SetZ (mypNodes[iNode+2]); theTrf.Transforms (aPnt); gp_XY aP2d(aPnt.X(), aPnt.Y()); diff --git a/src/OSD/OSD_MAllocHook.cxx b/src/OSD/OSD_MAllocHook.cxx index b8081bd6d8..5f281c6bb4 100644 --- a/src/OSD/OSD_MAllocHook.cxx +++ b/src/OSD/OSD_MAllocHook.cxx @@ -488,7 +488,7 @@ OSD_MAllocHook::CollectBySize::~CollectBySize() //purpose : //======================================================================= -#define MAX_ALLOC_SIZE 2000000u +#define MAX_ALLOC_SIZE 2000000 const size_t OSD_MAllocHook::CollectBySize::myMaxAllocSize = MAX_ALLOC_SIZE; void OSD_MAllocHook::CollectBySize::Reset() diff --git a/src/OpenGl/OpenGl_Workspace_2.cxx b/src/OpenGl/OpenGl_Workspace_2.cxx index 759b10967a..53d6edc28c 100644 --- a/src/OpenGl/OpenGl_Workspace_2.cxx +++ b/src/OpenGl/OpenGl_Workspace_2.cxx @@ -41,40 +41,14 @@ //10-05-96 : CAL ; Ajout d'un nouveau delta dans les copies de pixels (voir CALL_DEF_DELTA) #define CALL_DEF_DELTA 10 -// --------------------------------------------------------------- -// Function: getNearestPowOfTwo -// Purpose: get the nearest power of two for theNumber -// --------------------------------------------------------------- -static GLsizei getNearestPowOfTwo (const GLsizei theNumber) -{ - GLsizei aLast = 1; - for (GLsizei p2 = 1; p2 <= theNumber; aLast = p2, p2 <<= 1); - return aLast; -} +#ifdef _WIN32 -// --------------------------------------------------------------- -// Function: fitDimensionsRatio -// Purpose: calculate correct width/height ratio for theWidth and -// theHeight parameters -// --------------------------------------------------------------- -static void fitDimensionsRatio (Standard_Integer& theWidth, - Standard_Integer& theHeight, - const Standard_Real theViewRatio) -{ - // set dimensions in accordance with the viewratio - if (theHeight < theWidth/theViewRatio) - theWidth = (Standard_Integer)(theHeight*theViewRatio); - - if (theWidth < theHeight*theViewRatio) - theHeight = (Standard_Integer)(theWidth/theViewRatio); -} +#ifndef HAVE_FREEIMAGE // --------------------------------------------------------------- // Function: initBitmapBuffer // Purpose: init device independent bitmap to hold printing data // --------------------------------------------------------------- -#ifdef _WIN32 -#ifndef HAVE_FREEIMAGE static void initBitmapBuffer (const HDC theMemoryDC, HBITMAP &theMemoryBmp, const Standard_Integer theBmpWidth, @@ -100,7 +74,9 @@ static void initBitmapBuffer (const HDC theMemoryDC, theMemoryBmp = CreateDIBSection (theMemoryDC, &aBitmapData, DIB_RGB_COLORS, &theBufferPtr, NULL, 0); } -#else + +#else /* HAVE_FREEIMAGE */ + // --------------------------------------------------------------- // Function: imagePasteDC // Purpose: copy the data from image buffer to the device context @@ -193,7 +169,19 @@ static bool imageStretchDC(HDC theDstDC, FipHandle theImage, int theOffsetX, return true; } -#endif + +#endif /* HAVE_FREEIMAGE */ + +// --------------------------------------------------------------- +// Function: getNearestPowOfTwo +// Purpose: get the nearest power of two for theNumber +// --------------------------------------------------------------- +static GLsizei getNearestPowOfTwo (const GLsizei theNumber) +{ + GLsizei aLast = 1; + for (GLsizei p2 = 1; p2 <= theNumber; aLast = p2, p2 <<= 1); + return aLast; +} // --------------------------------------------------------------- // Function: getMaxFrameSize @@ -216,6 +204,23 @@ static void getMaxFrameSize(Standard_Integer& theWidth, theHeight = (Standard_Integer)aMaxY; } +// --------------------------------------------------------------- +// Function: fitDimensionsRatio +// Purpose: calculate correct width/height ratio for theWidth and +// theHeight parameters +// --------------------------------------------------------------- +static void fitDimensionsRatio (Standard_Integer& theWidth, + Standard_Integer& theHeight, + const Standard_Real theViewRatio) +{ + // set dimensions in accordance with the viewratio + if (theHeight < theWidth/theViewRatio) + theWidth = (Standard_Integer)(theHeight*theViewRatio); + + if (theWidth < theHeight*theViewRatio) + theHeight = (Standard_Integer)(theWidth/theViewRatio); +} + // --------------------------------------------------------------- // Function: initBufferStretch // Purpose: calculate initialization sizes for frame buffer @@ -265,7 +270,8 @@ static void initBufferTiling (Standard_Integer& theFrameWidth, if (theFrameHeight > theViewHeight) theFrameHeight = theViewHeight; } -#endif + +#endif /* _WIN32 */ // --------------------------------------------------------------- // --------------------------------------------------------------- diff --git a/src/ProjLib/ProjLib_ComputeApprox.cxx b/src/ProjLib/ProjLib_ComputeApprox.cxx index 41566c4b79..769741a86b 100644 --- a/src/ProjLib/ProjLib_ComputeApprox.cxx +++ b/src/ProjLib/ProjLib_ComputeApprox.cxx @@ -52,15 +52,6 @@ static Standard_Boolean AffichValue = Standard_False; #endif -static - void Parameters(const Handle(Adaptor3d_HCurve)& myCurve, - const Handle(Adaptor3d_HSurface)& mySurface, - const gp_Pnt& aP1, - const Standard_Integer iFirst, - const Standard_Real aTolU, - Standard_Real& aU, - Standard_Real& aV); - //======================================================================= //function : IsEqual //purpose : diff --git a/src/RWStl/RWStl.cxx b/src/RWStl/RWStl.cxx index df2abf5741..0dada75637 100644 --- a/src/RWStl/RWStl.cxx +++ b/src/RWStl/RWStl.cxx @@ -30,13 +30,13 @@ #include #include - // constants -static const int HEADER_SIZE = 84; -static const int SIZEOF_STL_FACET = 50; -static const int STL_MIN_FILE_SIZE = 284; -static const int ASCII_LINES_PER_FACET = 7; -static const int IND_THRESHOLD = 1000; // increment the indicator every 1k triangles +static const size_t HEADER_SIZE = 84; +static const size_t SIZEOF_STL_FACET = 50; +static const size_t STL_MIN_FILE_SIZE = 284; +static const size_t ASCII_LINES_PER_FACET = 7; + +static const int IND_THRESHOLD = 1000; // increment the indicator every 1k triangles //======================================================================= //function : WriteInteger diff --git a/src/TNaming/TNaming_DeltaOnModification.cxx b/src/TNaming/TNaming_DeltaOnModification.cxx index 0c7c4223a0..06c37efbbd 100644 --- a/src/TNaming/TNaming_DeltaOnModification.cxx +++ b/src/TNaming/TNaming_DeltaOnModification.cxx @@ -76,6 +76,7 @@ static void LoadNamedShape (TNaming_Builder& B, B.Generated(NS); break; } + case TNaming_REPLACE: // for compatibility case TNaming_GENERATED : { B.Generated(OS,NS);