diff options
author | QbProg <tholag@gmail.com> | 2011-06-19 18:12:05 +0200 |
---|---|---|
committer | QbProg <tholag@gmail.com> | 2011-06-19 18:31:00 +0200 |
commit | 80288ae43cf2acbad4f50e3f0a2b44b298e2b5df (patch) | |
tree | a142442f47d618dc07eab59e5d08a310cd871843 | |
parent | d5b9cbb0ef1905aecff6d7eae4db063d4b0228bf (diff) | |
download | oce-80288ae43cf2acbad4f50e3f0a2b44b298e2b5df.tar.gz oce-80288ae43cf2acbad4f50e3f0a2b44b298e2b5df.zip |
[warning-fix][implicit-conversion-from-wider-type]
Fixes warnings like 'conversion' conversion from 'type1' to 'type2', possible loss of data
47 files changed, 143 insertions, 142 deletions
diff --git a/src/AlienImage/AlienImage_BMPAlienData.cxx b/src/AlienImage/AlienImage_BMPAlienData.cxx index 21534652..14275567 100644 --- a/src/AlienImage/AlienImage_BMPAlienData.cxx +++ b/src/AlienImage/AlienImage_BMPAlienData.cxx @@ -532,7 +532,7 @@ void AlienImage_BMPAlienData::FromPseudoColorImage ( for (y = 0; y < myHeight; y++) { for (x = 0; x < myWidth; x++) { iPixel = anImage -> Pixel (LowX + x, LowY + y); - index = aColorMap -> FindEntry (iPixel.Value ()).Index (); + index = (BYTE)aColorMap -> FindEntry (iPixel.Value ()).Index (); BPIXEL[y*myWidth + x] = index; } } @@ -562,9 +562,9 @@ void AlienImage_BMPAlienData::FromColorImage ( for (x = 0; x < myWidth; x++) { color = anImage -> PixelColor (LowX + x, LowY + y); color.Values (r, g, b, Quantity_TOC_RGB); - rgbColor.rgbRed = (int)(r*255.); - rgbColor.rgbGreen = (int)(g*255.); - rgbColor.rgbBlue = (int)(b*255.); + rgbColor.rgbRed = (BYTE)(int)(r*255.); + rgbColor.rgbGreen = (BYTE)(int)(g*255.); + rgbColor.rgbBlue = (BYTE)(int)(b*255.); rgbColor.rgbReserved = 0; DWPIXEL[y*myWidth + x] = _TestSwapDWORD (*pdwPixel); } diff --git a/src/AlienImage/AlienImage_GIFAlienData.cxx b/src/AlienImage/AlienImage_GIFAlienData.cxx index 70dec88d..a4ae5453 100644 --- a/src/AlienImage/AlienImage_GIFAlienData.cxx +++ b/src/AlienImage/AlienImage_GIFAlienData.cxx @@ -531,7 +531,7 @@ void AlienImage_GIFAlienData::FromPseudoColorImage ( // Build colors from colormap for (i = 1; i <= aColorMap -> Size (); i++) { entry = aColorMap -> Entry (i); - ei = entry.Index (); + ei = (BYTE)entry.Index (); color = entry.Color (); color.Values (r, g, b, Quantity_TOC_RGB); RED [ei] = (BYTE)(r*255.); diff --git a/src/AlienImage/AlienImage_GIFLZWDict.cxx b/src/AlienImage/AlienImage_GIFLZWDict.cxx index 54ecf713..60eab579 100644 --- a/src/AlienImage/AlienImage_GIFLZWDict.cxx +++ b/src/AlienImage/AlienImage_GIFLZWDict.cxx @@ -56,7 +56,7 @@ int _lzw_encode (OSD_File& file, const BYTE* pData, int width, int height, int i _init_dict (); - byte = startBits; + byte = (BYTE) startBits; file.Write (&byte, sizeof(byte)); if (file.Failed ()) @@ -79,7 +79,7 @@ int _lzw_encode (OSD_File& file, const BYTE* pData, int width, int height, int i else { dict[ i ].code = nextCode++; dict[ i ].prnt = strCode; - dict[ i ].byte = chr; + dict[ i ].byte = (BYTE) chr; if (!_put_bits (OutBuff, (ULONG) strCode, codeBits, file)) goto _ExitError; @@ -161,7 +161,7 @@ static BOOL _put_bits (BYTE *OutBuff, ULONG code, UINT nBits, OSD_File& file) mask <<= 1; if ((mask & 0xFF) == 0) { - OutBuff[ putIdx++ ] = rack; + OutBuff[ putIdx++ ] = (BYTE) rack; ++OutBuff[ 0 ]; if (putIdx == BUFF_SIZE) { @@ -188,7 +188,7 @@ static BOOL _flush_bits (BYTE* OutBuff, OSD_File& file) BYTE byte; if ( mask != 0x01 ) { - OutBuff[ putIdx++ ] = rack; + OutBuff[ putIdx++ ] = (BYTE) rack; ++OutBuff[ 0 ]; } @@ -474,7 +474,7 @@ freeMemory_1: } // end if - *picptr++ = index; + *picptr++ = (BYTE) index; ++col; ++pP; @@ -582,13 +582,13 @@ static chist_vec __fastcall mediancut ( pixel p; int rl, gl, bl; - PPM_ASSIGN( p, maxr - minr, 0, 0 ); + PPM_ASSIGN(p, (BYTE)(maxr - minr), 0, 0 ); rl = PPM_LUMIN( p ); - PPM_ASSIGN( p, 0, maxg - ming, 0 ); + PPM_ASSIGN( p, 0, (BYTE)(maxg - ming), 0 ); gl = PPM_LUMIN( p ); - PPM_ASSIGN( p, 0, 0, maxb - minb ); + PPM_ASSIGN( p, 0, 0, (BYTE)(maxb - minb) ); bl = PPM_LUMIN( p ); if ( rl >= gl && rl >= bl ) @@ -907,7 +907,7 @@ static int __fastcall quick_check ( } // end while - *pix++ = mid; + *pix++ = (BYTE)mid; } // end for ( j . . . ) diff --git a/src/AlienImage/AlienImage_SGIRGBAlienData.cxx b/src/AlienImage/AlienImage_SGIRGBAlienData.cxx index 1b52f197..d1170fbc 100644 --- a/src/AlienImage/AlienImage_SGIRGBAlienData.cxx +++ b/src/AlienImage/AlienImage_SGIRGBAlienData.cxx @@ -300,14 +300,14 @@ static Standard_Boolean iopen( OSD_File &File, int calsize = sizeof( AlienImage_SGIRGBFileHeader ) ; if (mode=='w') { //------------------WRITE------------------ image->imagic = IMAGIC; - image->type = type; - image->xsize = xsize; + image->type = (unsigned short)type; + image->xsize = (unsigned short)xsize; image->ysize = 1; image->zsize = 1; if (dim>1) - image->ysize = ysize; + image->ysize = (unsigned short)ysize; if (dim>2) - image->zsize = zsize; + image->zsize = (unsigned short)zsize; if(image->zsize == 1) { image->dim = 2; if(image->ysize == 1) @@ -475,8 +475,8 @@ static int img_seek( OSD_File &File, return EOF; } image->x = 0; - image->y = y; - image->z = z; + image->y = (unsigned short)y; + image->z = (unsigned short)z; if(ISVERBATIM(image->type)) { switch(image->dim) { case 1: @@ -878,7 +878,7 @@ static int getrow( OSD_File& File, register short i; register unsigned char *cptr; register unsigned short *sptr; - register short cnt; + register int cnt; if( !(image->flags & (_IORW|_IOREAD)) ) return -1; @@ -1270,8 +1270,8 @@ void AlienImage_SGIRGBAlienData::FromImage(const Handle(Image_Image)& anImage ) Standard_Integer LowX = anImage->LowerX() ; Standard_Integer LowY = anImage->LowerY() ; - myHeader.xsize = anImage->Width(); - myHeader.ysize = anImage->Height(); + myHeader.xsize = (unsigned short)anImage->Width(); + myHeader.ysize = (unsigned short)anImage->Height(); myHeader.zsize = 3; /* allocate buffers for image data */ diff --git a/src/AlienImage/AlienImage_SunRFAlienData.cxx b/src/AlienImage/AlienImage_SunRFAlienData.cxx index c70037f8..33fc34dc 100644 --- a/src/AlienImage/AlienImage_SunRFAlienData.cxx +++ b/src/AlienImage/AlienImage_SunRFAlienData.cxx @@ -500,7 +500,7 @@ Standard_Boolean AlienImage_SunRFAlienData::WritePixelRow( } b = RUN_FLAG ; file.Write( ( Standard_Address ) &b, 1 ) ; - b = n-1 ; file.Write( ( Standard_Address ) &b, 1 ) ; + b = Standard_Byte(n-1) ; file.Write( ( Standard_Address ) &b, 1 ) ; b = scanln[n1];file.Write( ( Standard_Address ) &b, 1 ) ; } diff --git a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx index 910e8c30..26f02bdf 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx +++ b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx @@ -195,7 +195,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read mySections.Clear(); myPAtt.Init(); Handle(TDF_Data) aData = new TDF_Data(); - Standard_Integer aDocumentPos = -1; + std::streamoff aDocumentPos = -1; // 2b. Read the TOC of Sections if (aFileVer >= 3) { diff --git a/src/BinMNaming/BinMNaming_NamedShapeDriver.cxx b/src/BinMNaming/BinMNaming_NamedShapeDriver.cxx index 1732558d..c70d1d1a 100644 --- a/src/BinMNaming/BinMNaming_NamedShapeDriver.cxx +++ b/src/BinMNaming/BinMNaming_NamedShapeDriver.cxx @@ -283,7 +283,7 @@ void BinMNaming_NamedShapeDriver::ReadShapeSection (Standard_IStream& theIS) { // check section title string; note that some versions of OCCT (up to 6.3.1) // might avoid writing shape section if it is empty - Standard_Size aPos = theIS.tellg(); + std::streamsize aPos = theIS.tellg(); TCollection_AsciiString aSectionTitle; theIS >> aSectionTitle; if(aSectionTitle.Length() > 0 && aSectionTitle == SHAPESET) { diff --git a/src/BinTools/BinTools_LocationSet.cxx b/src/BinTools/BinTools_LocationSet.cxx index 62c9c2c0..fec79a3f 100644 --- a/src/BinTools/BinTools_LocationSet.cxx +++ b/src/BinTools/BinTools_LocationSet.cxx @@ -223,7 +223,7 @@ void BinTools_LocationSet::Read(Standard_IStream& IS) OCC_CATCH_SIGNALS for (i = 1; i <= nbLoc; i++) { - const Standard_Byte aTypLoc = IS.get(); + const Standard_Byte aTypLoc = (Standard_Byte) IS.get(); if (aTypLoc == 1) { IS >> T; L = T; diff --git a/src/BinTools/BinTools_ShapeSet.cxx b/src/BinTools/BinTools_ShapeSet.cxx index 66ddf7cd..1b3b460c 100644 --- a/src/BinTools/BinTools_ShapeSet.cxx +++ b/src/BinTools/BinTools_ShapeSet.cxx @@ -790,7 +790,7 @@ void BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T, if (val > 0 && val <= 3) BinTools::GetReal(IS, p1); } else { - Standard_Integer aPos = IS.tellg(); + std::streamoff aPos = IS.tellg(); BinTools::GetReal(IS, p1); val = (Standard_Integer)IS.get();//case {0|1|2|3} #ifdef MDTV_DEB diff --git a/src/CGM/CGM_Driver.cxx b/src/CGM/CGM_Driver.cxx index e8047222..977b21e2 100644 --- a/src/CGM/CGM_Driver.cxx +++ b/src/CGM/CGM_Driver.cxx @@ -427,12 +427,12 @@ void CGM_Driver::PlotPolyAttrib (const Standard_Integer ColorIndex, { // Set the edge visibility to the corresponding value if (myEdgeVisibility != (DrawEdge ? ON : OFF)) { - curatt.edge_vis = myEdgeVisibility = (DrawEdge ? ON : OFF); + curatt.edge_vis = Enum(myEdgeVisibility = (DrawEdge ? ON : OFF)); WriteData (EDGEVIS, ptablong, ptabreal, ptabchar); } // Set the interior style to fill by solid if (myInteriorStyle != (TileIndex < 0 ? EMPTY : SOLID)) { - curatt.int_style = myInteriorStyle = (TileIndex < 0 ? EMPTY : SOLID); + curatt.int_style = Enum(myInteriorStyle = (TileIndex < 0 ? EMPTY : SOLID)); WriteData (INTSTYLE, ptablong, ptabreal, ptabchar); } // Set the fill color for drawing diff --git a/src/CGM/cgmobin.c b/src/CGM/cgmobin.c index 27a686b6..8069b318 100644 --- a/src/CGM/cgmobin.c +++ b/src/CGM/cgmobin.c @@ -235,8 +235,8 @@ CGMObin(FILE *stream, Code c, Long *pi, Float *pr, char *str) /* Calculate length of packed list in bytes per row */ - packed += ( (cur.color_mode == DIRECT ? 3*nx : nx) - * lprec + 7 )>>3; + packed += (unsigned short)(( (cur.color_mode == DIRECT ? 3*nx : nx) + * lprec + 7 )>>3); /* Calculate length of run length in bits */ @@ -271,7 +271,7 @@ CGMObin(FILE *stream, Code c, Long *pi, Float *pr, char *str) } /* Convert runlength to bytes */ - run += (k + 7) >>3; + run += (unsigned short)((k + 7) >>3); } if ( first ) @@ -1116,7 +1116,7 @@ CGMObin(FILE *stream, Code c, Long *pi, Float *pr, char *str) for ( j=0; j < num; j++ ) { type = *pt++; value = (*pt++) + 1; - if ( type < ASFS ) asflag[type] = value; + if ( type < ASFS ) asflag[type] = (Logical)value; else { switch ( type ) @@ -1136,7 +1136,7 @@ CGMObin(FILE *stream, Code c, Long *pi, Float *pr, char *str) default: /* ignore */ k = 1; l = 0; break; } - for ( n = k; n < l; n++ ) asflag[n] = value; + for ( n = k; n < l; n++ ) asflag[n] = (Logical)value; } } for ( j=0; j < ASFS; j++) diff --git a/src/CGM/cgmotext.c b/src/CGM/cgmotext.c index 12fccb13..16995922 100644 --- a/src/CGM/cgmotext.c +++ b/src/CGM/cgmotext.c @@ -1103,7 +1103,7 @@ MOTprcode ( Code code ) strcpy(c, cgmelement[index].string); if ( ! upcase ) - for ( i = 0; i < (int)strlen(c); i++) c[i] = tolower( c[i] ); + for ( i = 0; i < (int)strlen(c); i++) c[i] = (char)tolower( c[i] ); TEXTOUT "%s", c ); return; diff --git a/src/Graphic3d/Graphic3d_Group_8.cxx b/src/Graphic3d/Graphic3d_Group_8.cxx index 19244870..5bcaf682 100644 --- a/src/Graphic3d/Graphic3d_Group_8.cxx +++ b/src/Graphic3d/Graphic3d_Group_8.cxx @@ -264,8 +264,8 @@ void Graphic3d_Group::SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectFil Standard_Real aPolyFactor, aPolyUnits; CTX->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits); MyCGroup.ContextFillArea.PolygonOffsetMode = aPolyMode; - MyCGroup.ContextFillArea.PolygonOffsetFactor = aPolyFactor; - MyCGroup.ContextFillArea.PolygonOffsetUnits = aPolyUnits; + MyCGroup.ContextFillArea.PolygonOffsetFactor = (float)aPolyFactor; + MyCGroup.ContextFillArea.PolygonOffsetUnits = (float)aPolyUnits; // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets int noinsert = 1; @@ -345,7 +345,7 @@ void Graphic3d_Group::SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectTex MyCGroup.ContextText.ColorSubTitle.g = float (Gs); MyCGroup.ContextText.ColorSubTitle.b = float (Bs); MyCGroup.ContextText.TextZoomable = ATextZoomable; - MyCGroup.ContextText.TextAngle = ATextAngle; + MyCGroup.ContextText.TextAngle = (float)ATextAngle; MyCGroup.ContextText.TextFontAspect = (int)ATextFontAspect; MyCGroup.ContextText.IsDef = 1; @@ -584,8 +584,8 @@ void Graphic3d_Group::SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea Standard_Real aPolyFactor, aPolyUnits; CTX->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits); MyCGroup.ContextFillArea.PolygonOffsetMode = aPolyMode; - MyCGroup.ContextFillArea.PolygonOffsetFactor = aPolyFactor; - MyCGroup.ContextFillArea.PolygonOffsetUnits = aPolyUnits; + MyCGroup.ContextFillArea.PolygonOffsetFactor = (float)aPolyFactor; + MyCGroup.ContextFillArea.PolygonOffsetUnits = (float)aPolyUnits; // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets int noinsert = 0; @@ -665,7 +665,7 @@ void Graphic3d_Group::SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& MyCGroup.ContextText.ColorSubTitle.g = float (Gs); MyCGroup.ContextText.ColorSubTitle.b = float (Bs); MyCGroup.ContextText.TextZoomable = ATextZoomable; - MyCGroup.ContextText.TextAngle = ATextAngle; + MyCGroup.ContextText.TextAngle = (float)ATextAngle; MyCGroup.ContextText.TextFontAspect = (int)ATextFontAspect; MyCGroup.ContextText.IsDef = 1; diff --git a/src/Graphic3d/Graphic3d_Structure.cxx b/src/Graphic3d/Graphic3d_Structure.cxx index 8cfb72b6..160bfe1c 100644 --- a/src/Graphic3d/Graphic3d_Structure.cxx +++ b/src/Graphic3d/Graphic3d_Structure.cxx @@ -1251,8 +1251,8 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFill Standard_Real aPolyFactor, aPolyUnits; CTX->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits); MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode; - MyCStructure.ContextFillArea.PolygonOffsetFactor = aPolyFactor; - MyCStructure.ContextFillArea.PolygonOffsetUnits = aPolyUnits; + MyCStructure.ContextFillArea.PolygonOffsetFactor = (float)aPolyFactor; + MyCStructure.ContextFillArea.PolygonOffsetUnits = (float)aPolyUnits; // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets MyGraphicDriver->ContextStructure (MyCStructure); @@ -1305,7 +1305,7 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectText MyCStructure.ContextText.ColorSubTitle.g = float (Gs); MyCStructure.ContextText.ColorSubTitle.b = float (Bs); MyCStructure.ContextText.TextZoomable = ATextZoomable; - MyCStructure.ContextText.TextAngle = ATextAngle; + MyCStructure.ContextText.TextAngle = (float)ATextAngle; MyCStructure.ContextText.TextFontAspect = (int)ATextFontAspect; MyCStructure.ContextText.IsDef = 1; @@ -1772,9 +1772,9 @@ void Graphic3d_Structure::SetTransformPersistence( const Graphic3d_TransModeFlag if (IsDeleted ()) return; MyCStructure.TransformPersistence.Flag = AFlag; - MyCStructure.TransformPersistence.Point.x = APoint.X(); - MyCStructure.TransformPersistence.Point.y = APoint.Y(); - MyCStructure.TransformPersistence.Point.z = APoint.Z(); + MyCStructure.TransformPersistence.Point.x = (float)APoint.X(); + MyCStructure.TransformPersistence.Point.y = (float)APoint.Y(); + MyCStructure.TransformPersistence.Point.z = (float)APoint.Z(); //MyStructureManager->Update (); //Update(); MyGraphicDriver->ContextStructure( MyCStructure ); @@ -2181,7 +2181,7 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)& MyCStructure.ContextText.ColorSubTitle.g = float (Gs); MyCStructure.ContextText.ColorSubTitle.b = float (Bs); MyCStructure.ContextText.TextZoomable = ATextZoomable; - MyCStructure.ContextText.TextAngle = ATextAngle; + MyCStructure.ContextText.TextAngle = (float)ATextAngle; MyCStructure.ContextText.TextFontAspect = (int)ATextFontAspect; @@ -2366,8 +2366,8 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)& Standard_Real aPolyFactor, aPolyUnits; CTXF->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits); MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode; - MyCStructure.ContextFillArea.PolygonOffsetFactor = aPolyFactor; - MyCStructure.ContextFillArea.PolygonOffsetUnits = aPolyUnits; + MyCStructure.ContextFillArea.PolygonOffsetFactor = (float)aPolyFactor; + MyCStructure.ContextFillArea.PolygonOffsetUnits = (float)aPolyUnits; // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets } diff --git a/src/Image/Image_PixMap.cxx b/src/Image/Image_PixMap.cxx index 02c31bb1..e6ad8cf9 100644 --- a/src/Image/Image_PixMap.cxx +++ b/src/Image/Image_PixMap.cxx @@ -407,8 +407,8 @@ Quantity_Color Image_PixMap::PixelColor (const Standard_Integer theX, const Standard_Integer theY) const { Standard_Integer aScanlineId = myImage->getHeight() - theY - 1; - if (theX < 0 || theX >= myImage->getWidth() || - theY < 0 || theY >= myImage->getHeight()) + if (theX < 0 || (unsigned int)theX >= myImage->getWidth() || + theY < 0 || (unsigned int)theY >= myImage->getHeight()) { return Quantity_Color (0.0, 0.0, 0.0, Quantity_TOC_RGB); } diff --git a/src/LDOM/LDOM_OSStream.cxx b/src/LDOM/LDOM_OSStream.cxx index f870fa62..c01a798c 100644 --- a/src/LDOM/LDOM_OSStream.cxx +++ b/src/LDOM/LDOM_OSStream.cxx @@ -90,6 +90,7 @@ Standard_CString LDOM_SBuffer::str () const //======================================================================= int LDOM_SBuffer::overflow(int c) { + // @todo This buffer should not be "int" char cc = c; return xsputn(&cc,1); } diff --git a/src/LDOM/LDOM_XmlReader.cxx b/src/LDOM/LDOM_XmlReader.cxx index 03a5866b..d8ea7eaf 100644 --- a/src/LDOM/LDOM_XmlReader.cxx +++ b/src/LDOM/LDOM_XmlReader.cxx @@ -123,7 +123,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord // Read the full buffer and reset start and end buffer pointers myPtr = &myBuffer[0]; - Standard_Integer aNBytes; + std::streamsize aNBytes; if (myFileDes != FILE_NONVALUE) aNBytes = read (myFileDes, &myBuffer[aBytesRest], XML_BUFFER_SIZE - aBytesRest); @@ -515,7 +515,7 @@ static Standard_Boolean isName (const char * aString, const char *& aNameEnd) { Standard_Boolean aResult; - int aCh = aString[0]; + Standard_Character aCh = aString[0]; if (IsAlphabetic(aCh) || aCh == '_' || aCh == ':') { const char * aPtr = &aString[1]; while (aPtr < aStringEnd) { diff --git a/src/NIS/NIS_Surface.cxx b/src/NIS/NIS_Surface.cxx index abb15a86..bfa71724 100644 --- a/src/NIS/NIS_Surface.cxx +++ b/src/NIS/NIS_Surface.cxx @@ -299,7 +299,7 @@ void NIS_Surface::SetPolygonOffset (const Standard_Real theValue) { Handle(NIS_SurfaceDrawer) aDrawer = defaultDrawer(); aDrawer->Assign (GetDrawer()); - aDrawer->myPolygonOffset = theValue; + aDrawer->myPolygonOffset = (Standard_ShortReal)theValue; SetDrawer (aDrawer); } diff --git a/src/OpenGl/OpenGl_AVIWriter.cxx b/src/OpenGl/OpenGl_AVIWriter.cxx index 32bbb07a..6d76bff0 100644 --- a/src/OpenGl/OpenGl_AVIWriter.cxx +++ b/src/OpenGl/OpenGl_AVIWriter.cxx @@ -246,7 +246,7 @@ HRESULT OpenGl_AVIWriter::InitMovieCreation (int nFrameWidth, bmpInfo.bmiHeader.biWidth = nFrameWidth; bmpInfo.bmiHeader.biHeight = nFrameHeight; bmpInfo.bmiHeader.biCompression = BI_RGB; - bmpInfo.bmiHeader.biBitCount = nBitsPerPixel; + bmpInfo.bmiHeader.biBitCount = (WORD)nBitsPerPixel; bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmpInfo.bmiHeader.biSizeImage = (bmpInfo.bmiHeader.biWidth * bmpInfo.bmiHeader.biHeight* diff --git a/src/OpenGl/OpenGl_GraphicDriver_7.cxx b/src/OpenGl/OpenGl_GraphicDriver_7.cxx index 9bf0aa44..a77bd201 100644 --- a/src/OpenGl/OpenGl_GraphicDriver_7.cxx +++ b/src/OpenGl/OpenGl_GraphicDriver_7.cxx @@ -90,13 +90,13 @@ void OpenGl_GraphicDriver::GradientBackground(const Graphic3d_CView& ACView, AColor1.Values( R1, G1, B1, Quantity_TOC_RGB ); AColor2.Values( R2, G2, B2, Quantity_TOC_RGB ); TEL_COLOUR tcolor1, tcolor2; - tcolor1.rgb[0] = R1; - tcolor1.rgb[1] = G1; - tcolor1.rgb[2] = B1; + tcolor1.rgb[0] = (float)R1; + tcolor1.rgb[1] = (float)G1; + tcolor1.rgb[2] = (float)B1; tcolor1.rgb[3] = 0; - tcolor2.rgb[0] = R2; - tcolor2.rgb[1] = G2; - tcolor2.rgb[2] = B2; + tcolor2.rgb[0] = (float)R2; + tcolor2.rgb[1] = (float)G2; + tcolor2.rgb[2] = (float)B2; tcolor2.rgb[3] = 0; call_togl_gradient_background (MyCView.WsId, AType, &tcolor1, &tcolor2); @@ -227,8 +227,8 @@ Standard_Boolean OpenGl_GraphicDriver::ProjectRaster (const Graphic3d_CView& ACV if ( ACView.DefBitmap.bitmap ) { Result = call_togl_adopt_to_rect( ACView.ViewId, - ACView.DefWindow.dx, - ACView.DefWindow.dy ); + (int)ACView.DefWindow.dx, + (int)ACView.DefWindow.dy ); if (MyTraceLevel) { PrintIResult ("call_togl_adopt_to_rect", Result); } diff --git a/src/OpenGl/OpenGl_TextRender.cxx b/src/OpenGl/OpenGl_TextRender.cxx index 4392b667..72667806 100644 --- a/src/OpenGl/OpenGl_TextRender.cxx +++ b/src/OpenGl/OpenGl_TextRender.cxx @@ -289,7 +289,7 @@ void OpenGl_TextRender::RenderText ( char* str, GLuint base, int is2d, GLfloat x CMN_KEY keyAngle; keyAngle.id = TelTextAngle;//This flag responding about Angle text TsmGetAttri( 1, &keyAngle ); - angle = keyAngle.data.ldata; + angle = (Tfloat)keyAngle.data.ldata; Tint zoom = 0; CMN_KEY keyZoom; @@ -390,14 +390,14 @@ void OpenGl_TextRender::RenderText ( char* str, GLuint base, int is2d, GLfloat x } else { - export_h = h; + export_h = (float)h; } } glGetIntegerv(GL_RENDER_MODE, &renderMode); if ( renderMode == GL_FEEDBACK ) { #ifdef HAVE_GL2PS - export_h = (GLdouble)fnt->FaceSize() / export_h; + export_h = float((GLdouble)fnt->FaceSize() / export_h); int aligment = alignmentforgl2ps( vh, vv ); glPopMatrix(); ExportText( str, fontName, export_h, angle, aligment, x, y, z, is2d!=0 ); @@ -476,7 +476,7 @@ void OpenGl_TextRender::ExportText( char* str, char* fontname, GLfloat height, G glBitmap( 1, 1, 0, 0, 0, 0, &zero ); - gl2psTextOpt( str, ps_font, height, alignment, angle); + gl2psTextOpt( str, ps_font, (GLshort)height, alignment, angle); #endif diff --git a/src/OpenGl/OpenGl_attri.cxx b/src/OpenGl/OpenGl_attri.cxx index db359a70..5aa64740 100644 --- a/src/OpenGl/OpenGl_attri.cxx +++ b/src/OpenGl/OpenGl_attri.cxx @@ -985,7 +985,7 @@ TsmSetAttri( Tint n, ... ) attri_tail->TextZoomable = k[i]->data.ldata; break; case TelTextAngle: - attri_tail->TextAngle = k[i]->data.ldata; + attri_tail->TextAngle = (Tfloat)k[i]->data.ldata; break; case TelTextFontAspect: attri_tail->TextFontAspect = OSD_FontAspect(k[i]->data.ldata); @@ -1274,7 +1274,7 @@ TsmGetAttri( Tint n, ... ) k[i]->data.ldata = attri_tail->TextZoomable; break; case TelTextAngle: - k[i]->data.ldata = attri_tail->TextAngle; + k[i]->data.ldata = (Tint) attri_tail->TextAngle; break; case TelTextFontAspect: k[i]->data.ldata = attri_tail->TextFontAspect; diff --git a/src/OpenGl/OpenGl_funcs.cxx b/src/OpenGl/OpenGl_funcs.cxx index b0280730..fae36f7b 100644 --- a/src/OpenGl/OpenGl_funcs.cxx +++ b/src/OpenGl/OpenGl_funcs.cxx @@ -470,7 +470,7 @@ call_func_set_text_angle( Tfloat angl ) { CMN_KEY key; - key.data.ldata = angl; + key.data.ldata = (Tint)angl; TsmAddToStructure( TelTextAngle, 1, &key ); return; } diff --git a/src/OpenGl/OpenGl_togl_begin_layer_mode.cxx b/src/OpenGl/OpenGl_togl_begin_layer_mode.cxx index fd0e87d8..022680d9 100644 --- a/src/OpenGl/OpenGl_togl_begin_layer_mode.cxx +++ b/src/OpenGl/OpenGl_togl_begin_layer_mode.cxx @@ -616,7 +616,7 @@ call_togl_text2d ( char *s, FTGLLayerFontCurrent = textRender->FindFont( FTGLLayerFontName, FTGLLayerFontAspect, - FTGLLayerFontHeight, + (Tfloat)FTGLLayerFontHeight, FTGLLayerFontXScale, FTGLLayerFontYScale ); @@ -894,9 +894,9 @@ call_togl_textsize2d if ( FTGLLayerFontHeight != height || layerFontFlag == IsModified || FTGLLayerFontCurrent == 0 ) { layerFontFlag = IsNotModified; - FTGLLayerFontHeight = height; + FTGLLayerFontHeight = (Tint)height; OpenGl_TextRender* textRender = OpenGl_TextRender::instance(); - FTGLLayerFontCurrent = textRender -> FindFont(FTGLLayerFontName, FTGLLayerFontAspect, FTGLLayerFontHeight); + FTGLLayerFontCurrent = textRender -> FindFont(FTGLLayerFontName, FTGLLayerFontAspect, (Tfloat)FTGLLayerFontHeight); textRender -> StringSize(s, &FTGLLayerFontWidth, &FTGLLayerFontAscent, &FTGLLayerFontDescent); } @@ -1042,7 +1042,7 @@ call_togl_set_text_attributes FTGLLayerFontAspect = OSD_FA_Regular; OpenGl_TextRender* textRender = OpenGl_TextRender::instance(); - FTGLLayerFontCurrent = textRender -> FindFont(FTGLLayerFontName, FTGLLayerFontAspect, FTGLLayerFontHeight); + FTGLLayerFontCurrent = textRender -> FindFont(FTGLLayerFontName, FTGLLayerFontAspect, (Tfloat)FTGLLayerFontHeight); layerFontType = type; layerFontRed = r; @@ -1087,7 +1087,7 @@ void call_togl_set_text_attributes( Tchar* font, layerFontFlag = IsModified; FTGLLayerFontXScale = FTGLLayerFontYScale = 1.f; OpenGl_TextRender* textRender = OpenGl_TextRender::instance(); - FTGLLayerFontCurrent = textRender -> FindFont(FTGLLayerFontName, FTGLLayerFontAspect, FTGLLayerFontHeight); + FTGLLayerFontCurrent = textRender -> FindFont(FTGLLayerFontName, FTGLLayerFontAspect, (Tfloat)FTGLLayerFontHeight); layerFontRed = r; layerFontGreen = g; diff --git a/src/OpenGl/OpenGl_togl_print.cxx b/src/OpenGl/OpenGl_togl_print.cxx index 5021edb8..64ccb0a0 100644 --- a/src/OpenGl/OpenGl_togl_print.cxx +++ b/src/OpenGl/OpenGl_togl_print.cxx @@ -283,7 +283,7 @@ call_togl_print } wglMakeCurrent(hDC,hGLRC); #else - pfd.cColorBits = GetDeviceCaps(hMemDC, BITSPIXEL); + pfd.cColorBits = (BYTE)GetDeviceCaps(hMemDC, BITSPIXEL); nIndex = ChoosePixelFormat(hMemDC, &pfd); if (nIndex == 0) { diff --git a/src/OpenGl/OpenGl_txgl.cxx b/src/OpenGl/OpenGl_txgl.cxx index 56012372..38888941 100644 --- a/src/OpenGl/OpenGl_txgl.cxx +++ b/src/OpenGl/OpenGl_txgl.cxx @@ -1022,11 +1022,11 @@ __declspec( dllexport ) int __fastcall __OpenGl_INIT__ ( for (i = 0; i < sizeof(dBits) / sizeof(int); i++) { - pfd0.cDepthBits = dBits[i]; + pfd0.cDepthBits = (BYTE)dBits[i]; iGood = 0; for (j = 0; j < sizeof(cBits) / sizeof(int); j++) { - pfd0.cColorBits = cBits[j]; + pfd0.cColorBits = (BYTE)cBits[j]; iPixelFormat = ChoosePixelFormat ( hte -> hDC, &pfd0 ); if (iPixelFormat) { diff --git a/src/OpenGl/OpenGl_view.cxx b/src/OpenGl/OpenGl_view.cxx index 0bf6e4d2..38701e4c 100644 --- a/src/OpenGl/OpenGl_view.cxx +++ b/src/OpenGl/OpenGl_view.cxx @@ -1302,18 +1302,18 @@ TelClearBackground( Tint Wsid /* Workstation id */ ) case 3: corner2 = gradient->color2.rgb; corner4 = gradient->color1.rgb; - dcorner1 [0] = dcorner2[0] = (corner2[0] + corner4[0]) / 2.0; - dcorner1 [1] = dcorner2[1] = (corner2[1] + corner4[1]) / 2.0; - dcorner1 [2] = dcorner2[2] = (corner2[2] + corner4[2]) / 2.0; + dcorner1 [0] = dcorner2[0] = (corner2[0] + corner4[0]) / 2.0f; + dcorner1 [1] = dcorner2[1] = (corner2[1] + corner4[1]) / 2.0f; + dcorner1 [2] = dcorner2[2] = (corner2[2] + corner4[2]) / 2.0f; corner1 = dcorner1; corner3 = dcorner2; break; case 4: corner1 = gradient->color2.rgb; corner3 = gradient->color1.rgb; - dcorner1 [0] = dcorner2[0] = (corner1[0] + corner3[0]) / 2.0; - dcorner1 [1] = dcorner2[1] = (corner1[1] + corner3[1]) / 2.0; - dcorner1 [2] = dcorner2[2] = (corner1[2] + corner3[2]) / 2.0; + dcorner1 [0] = dcorner2[0] = (corner1[0] + corner3[0]) / 2.0f; + dcorner1 [1] = dcorner2[1] = (corner1[1] + corner3[1]) / 2.0f; + dcorner1 [2] = dcorner2[2] = (corner1[2] + corner3[2]) / 2.0f; corner2 = dcorner1; corner4 = dcorner2; break; diff --git a/src/Prs2d/Prs2d_Angle.cxx b/src/Prs2d/Prs2d_Angle.cxx index 1c05f32c..3ed1daf3 100644 --- a/src/Prs2d/Prs2d_Angle.cxx +++ b/src/Prs2d/Prs2d_Angle.cxx @@ -322,7 +322,7 @@ void Prs2d_Angle::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { aDrawer->SetTextAttrib( myColorIndex, mySymbFont, 0, Standard_ShortReal(myTextScale*aDrawer->Scale()), Standard_ShortReal(myTextScale*aDrawer->Scale()), Standard_False ); // TCollection_ExtendedString txtSymb( char( SymbolCode() ) ); - Standard_Character code = SymbolCode(); + Standard_Character code = (Standard_Character) SymbolCode(); TCollection_ExtendedString txtSymb( code ); Standard_ShortReal dx=0.,dy=0.; aDrawer->MapTextFromTo( txtSymb, ts1, ts2, txtAngle, dx, dy, Aspect_TOT_SOLID ); diff --git a/src/Prs2d/Prs2d_Diameter.cxx b/src/Prs2d/Prs2d_Diameter.cxx index 35ba8511..f29b3991 100644 --- a/src/Prs2d/Prs2d_Diameter.cxx +++ b/src/Prs2d/Prs2d_Diameter.cxx @@ -79,9 +79,9 @@ Prs2d_Diameter::Prs2d_Diameter( const Handle(Graphic2d_GraphicObject)& aGO, myAppX2 = Standard_ShortReal(X1); myAppY2 = Standard_ShortReal(Y1); if (myX1>=myX2) - myAppX2=myAppX2+(theDist+theRad)/APPENDIXLEN; + myAppX2=Standard_ShortReal(myAppX2+(theDist+theRad)/APPENDIXLEN); else - myAppX2=myAppX2-(theDist+theRad)/APPENDIXLEN; + myAppX2=Standard_ShortReal(myAppX2-(theDist+theRad)/APPENDIXLEN); if ( myAppX2 < myMinX ) myMinX = myAppX2; if ( myAppY2 < myMinY ) myMinY = myAppY2; @@ -106,14 +106,14 @@ Prs2d_Diameter::Prs2d_Diameter( const Handle(Graphic2d_GraphicObject)& aGO, Standard_Integer theTxtNum=aText.Length(); Standard_Real theTxtLen=theTxtNum*myTextScale; - theTxtX1 = myAbsX; - theTxtY1 = myAbsY; - theTxtX2 = theTxtX1+theTxtLen*cos(myAbsAngle); - theTxtY2 = theTxtY1+theTxtLen*sin(myAbsAngle); - theTxtX3 = theTxtX1-myTextScale*sin(myAbsAngle); - theTxtY3 = theTxtY1+myTextScale*cos(myAbsAngle); - theTxtX4 = theTxtX3+theTxtLen*cos(myAbsAngle); - theTxtY4 = theTxtY3+theTxtLen*sin(myAbsAngle); + theTxtX1 = Standard_ShortReal(myAbsX); + theTxtY1 = Standard_ShortReal(myAbsY); + theTxtX2 = Standard_ShortReal(theTxtX1+theTxtLen*cos(myAbsAngle)); + theTxtY2 = Standard_ShortReal(theTxtY1+theTxtLen*sin(myAbsAngle)); + theTxtX3 = Standard_ShortReal(theTxtX1-myTextScale*sin(myAbsAngle)); + theTxtY3 = Standard_ShortReal(theTxtY1+myTextScale*cos(myAbsAngle)); + theTxtX4 = Standard_ShortReal(theTxtX3+theTxtLen*cos(myAbsAngle)); + theTxtY4 = Standard_ShortReal(theTxtY3+theTxtLen*sin(myAbsAngle)); if (theTxtX1 < myMinX) myMinX = theTxtX1; if (theTxtY1 < myMinY) myMinY = theTxtY1; diff --git a/src/Prs2d/Prs2d_Length.cxx b/src/Prs2d/Prs2d_Length.cxx index be53f67c..b76e8dec 100644 --- a/src/Prs2d/Prs2d_Length.cxx +++ b/src/Prs2d/Prs2d_Length.cxx @@ -166,7 +166,7 @@ void Prs2d_Length::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) Standard_ShortReal(myTextScale*aDrawer->Scale()), Standard_ShortReal(myTextScale*aDrawer->Scale()), Standard_False ); - Standard_Character code = SymbolCode(); + Standard_Character code = (Standard_Character)SymbolCode(); TCollection_ExtendedString txtSymb( code ); pntText.Coord( theSmbX, theSmbY ); Standard_ShortReal ws, hs; @@ -326,7 +326,7 @@ void Prs2d_Length::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) if ( myIsSymbol ) { - Standard_Character code = SymbolCode(); + Standard_Character code = (Standard_Character)SymbolCode(); TCollection_ExtendedString txtSymb( code ); aDrawer->MapTextFromTo( txtSymb, ts1, ts2,Standard_ShortReal(theTxtAngle), 0., 0., Aspect_TOT_SOLID ); diff --git a/src/Prs2d/Prs2d_Radius.cxx b/src/Prs2d/Prs2d_Radius.cxx index 358d4501..65c94cac 100644 --- a/src/Prs2d/Prs2d_Radius.cxx +++ b/src/Prs2d/Prs2d_Radius.cxx @@ -180,7 +180,7 @@ void Prs2d_Radius::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { aDrawer->SetTextAttrib( myColorIndex, mySymbFont, 0, Standard_ShortReal(myTextScale*aDrawer->Scale()), Standard_ShortReal(myTextScale*aDrawer->Scale()), Standard_False ); // TCollection_ExtendedString txtSymb( char( SymbolCode() ) ); - Standard_Character code = SymbolCode(); + Standard_Character code = (Standard_Character) SymbolCode(); TCollection_ExtendedString txtSymb( code ); pntText.Coord( theSmbX, theSmbY ); Standard_ShortReal ws=0., hs=0.; @@ -269,7 +269,7 @@ void Prs2d_Radius::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { if ( myIsSymbol ) { // TCollection_ExtendedString txtSymb( char( SymbolCode() ) ); - Standard_Character code = SymbolCode(); + Standard_Character code = (Standard_Character) SymbolCode(); TCollection_ExtendedString txtSymb( code ); Standard_ShortReal dx=0.,dy=0.; aDrawer->MapTextFromTo( txtSymb, ts1, ts2, Standard_ShortReal(theTxtAngle), dx, dy, Aspect_TOT_SOLID ); diff --git a/src/Prs2d/Prs2d_Repere.cxx b/src/Prs2d/Prs2d_Repere.cxx index 17e8b173..67df4189 100644 --- a/src/Prs2d/Prs2d_Repere.cxx +++ b/src/Prs2d/Prs2d_Repere.cxx @@ -123,7 +123,7 @@ void Prs2d_Repere::Draw(const Handle(Graphic2d_Drawer)& aDrawer) { aDrawer->SetTextAttrib( myColorIndex, mySymbFont, 0, Standard_ShortReal(myTextScale*aDrawer->Scale()), Standard_ShortReal(myTextScale*aDrawer->Scale()), Standard_False ); // TCollection_ExtendedString txtSymb( char( SymbolCode() ) ); - Standard_Character code = SymbolCode(); + Standard_Character code = (Standard_Character) SymbolCode(); TCollection_ExtendedString txtSymb( code ); Standard_ShortReal ws=0., hs=0.; aDrawer->GetTextSize( txtSymb, ws, hs ); @@ -179,7 +179,7 @@ void Prs2d_Repere::Draw(const Handle(Graphic2d_Drawer)& aDrawer) { if ( myIsSymbol ) { // TCollection_ExtendedString txtSymb( char( SymbolCode() ) ); - Standard_Character code = SymbolCode(); + Standard_Character code = (Standard_Character) SymbolCode(); TCollection_ExtendedString txtSymb( code ); Standard_ShortReal angle=0.,dx=0.,dy=0.; aDrawer->MapTextFromTo( txtSymb, ts1, ts2, angle, dx, dy, Aspect_TOT_SOLID); diff --git a/src/PrsMgr/PrsMgr_PresentableObject.cxx b/src/PrsMgr/PrsMgr_PresentableObject.cxx index 65e4af8b..18b21667 100644 --- a/src/PrsMgr/PrsMgr_PresentableObject.cxx +++ b/src/PrsMgr/PrsMgr_PresentableObject.cxx @@ -290,9 +290,9 @@ void PrsMgr_PresentableObject::SetTransformPersistence( const Graphic3d_TransMo const gp_Pnt& ThePoint ) { myTransformPersistence.Flag = TheFlag; - myTransformPersistence.Point.x = ThePoint.X(); - myTransformPersistence.Point.y = ThePoint.Y(); - myTransformPersistence.Point.z = ThePoint.Z(); + myTransformPersistence.Point.x = (float)ThePoint.X(); + myTransformPersistence.Point.y = (float)ThePoint.Y(); + myTransformPersistence.Point.z = (float)ThePoint.Z(); Handle(Graphic3d_Structure) aStruct; for( Standard_Integer i = 1, n = myPresentations.Length(); i <= n; i++ ) diff --git a/src/Select3D/Select3D_SensitiveGroup.cxx b/src/Select3D/Select3D_SensitiveGroup.cxx index bd7d3ca0..c7e98104 100644 --- a/src/Select3D/Select3D_SensitiveGroup.cxx +++ b/src/Select3D/Select3D_SensitiveGroup.cxx @@ -177,11 +177,11 @@ Standard_Boolean Select3D_SensitiveGroup::Matches(const Standard_Real X, Standard_Real& DMin) { myLastRank = 0; - myLastTol = aTol; + myLastTol = (Standard_ShortReal)aTol; for(Select3D_ListIteratorOfListOfSensitive It(myList);It.More();It.Next()){ myLastRank++; if(It.Value()->Matches(X,Y,aTol,DMin)){ - myX = X;myY = Y;myLastTol = aTol; + myX = (Standard_ShortReal)X; myY = (Standard_ShortReal)Y; myLastTol = (Standard_ShortReal)aTol; SetLastDepth( Precision::Infinite() ); Select3D_SensitiveEntity::Matches(X,Y,aTol,DMin); diff --git a/src/ShapeProcess/ShapeProcess_Context.cxx b/src/ShapeProcess/ShapeProcess_Context.cxx index 37831136..7247357e 100644 --- a/src/ShapeProcess/ShapeProcess_Context.cxx +++ b/src/ShapeProcess/ShapeProcess_Context.cxx @@ -62,7 +62,7 @@ Handle(Resource_Manager) ShapeProcess_Context::LoadResourceManager (const Standa // Optimisation of loading resource file: file is load only once // and reloaded only if file date has changed static Handle(Resource_Manager) sRC; - static long mtime; + static time_t mtime; static TCollection_AsciiString name; if ( ! sRC.IsNull() && ! name.IsEqual ( file ) ) sRC.Nullify(); if ( ! sRC.IsNull() ) { diff --git a/src/StdPrs/StdPrs_ToolShadedShape.cxx b/src/StdPrs/StdPrs_ToolShadedShape.cxx index c2037bd0..e67f6d6c 100644 --- a/src/StdPrs/StdPrs_ToolShadedShape.cxx +++ b/src/StdPrs/StdPrs_ToolShadedShape.cxx @@ -121,9 +121,9 @@ void StdPrs_ToolShadedShape::Normal(const TopoDS_Face& aFace, } Standard_Integer j = (i - UVNodes.Lower()) * 3; - Normals->SetValue(j + 1, Nor(i).X()); - Normals->SetValue(j + 2, Nor(i).Y()); - Normals->SetValue(j + 3, Nor(i).Z()); + Normals->SetValue(j + 1, Standard_ShortReal(Nor(i).X())); + Normals->SetValue(j + 2, Standard_ShortReal(Nor(i).Y())); + Normals->SetValue(j + 3, Standard_ShortReal(Nor(i).Z())); if (aFace.Orientation() == TopAbs_REVERSED) (Nor(i)).Reverse(); @@ -163,9 +163,9 @@ void StdPrs_ToolShadedShape::Normal(const TopoDS_Face& aFace, Nor(i) = gp_Dir(eqPlan); Standard_Integer j = (i - Nodes.Lower()) * 3; - Normals->SetValue(j + 1, Nor(i).X()); - Normals->SetValue(j + 2, Nor(i).Y()); - Normals->SetValue(j + 3, Nor(i).Z()); + Normals->SetValue(j + 1, Standard_ShortReal(Nor(i).X())); + Normals->SetValue(j + 2, Standard_ShortReal(Nor(i).Y())); + Normals->SetValue(j + 3, Standard_ShortReal(Nor(i).Z())); if (aFace.Orientation() == TopAbs_REVERSED) (Nor(i)).Reverse(); diff --git a/src/TopTools/TopTools_LocationSet.cxx b/src/TopTools/TopTools_LocationSet.cxx index 62a03291..6c3d21ea 100644 --- a/src/TopTools/TopTools_LocationSet.cxx +++ b/src/TopTools/TopTools_LocationSet.cxx @@ -162,7 +162,7 @@ void TopTools_LocationSet::Dump(Standard_OStream& OS) const void TopTools_LocationSet::Write(Standard_OStream& OS) const { - int prec = OS.precision(15); + std::streamsize prec = OS.precision(15); Standard_Integer i, nbLoc = myMap.Extent(); OS << "Locations " << nbLoc << "\n"; diff --git a/src/TopTools/TopTools_ShapeSet.cxx b/src/TopTools/TopTools_ShapeSet.cxx index e35f332d..d9e0cd30 100644 --- a/src/TopTools/TopTools_ShapeSet.cxx +++ b/src/TopTools/TopTools_ShapeSet.cxx @@ -444,7 +444,7 @@ void TopTools_ShapeSet::Write(Standard_OStream& OS) // on positionne LC_NUMERIC a "C" (point decimal) setlocale(LC_NUMERIC, "C") ; - int prec = OS.precision(15); + std::streamsize prec = OS.precision(15); // write the copyright if (myFormatNb == 2) diff --git a/src/V2d/V2d_CircularGraphicGrid.cxx b/src/V2d/V2d_CircularGraphicGrid.cxx index c44ec492..3088e8aa 100644 --- a/src/V2d/V2d_CircularGraphicGrid.cxx +++ b/src/V2d/V2d_CircularGraphicGrid.cxx @@ -143,7 +143,7 @@ void V2d_CircularGraphicGrid::DrawCircle #ifdef OCC192 Standard_ShortReal x_alpha, y_alpha; - Standard_ShortReal cos_alpha = Cos(angle), sin_alpha = Sin(angle); + Standard_ShortReal cos_alpha = (Standard_ShortReal) Cos(angle), sin_alpha = (Standard_ShortReal) Sin(angle); #endif if(DrawPoints) { #ifdef OCC192 diff --git a/src/V2d/V2d_RectangularGraphicGrid.cxx b/src/V2d/V2d_RectangularGraphicGrid.cxx index e6e48184..6e204d4f 100644 --- a/src/V2d/V2d_RectangularGraphicGrid.cxx +++ b/src/V2d/V2d_RectangularGraphicGrid.cxx @@ -50,9 +50,9 @@ void V2d_RectangularGraphicGrid::Draw(const Handle(Graphic2d_Drawer)& aDrawer) { #ifdef OCC194 if (Abs(a1) > 0.0) { - Standard_ShortReal alpha = a1 - ((Standard_Integer)(a1/1.57))*1.57; - alpha = alpha - 1.57/2.0; - Coef = Abs(Coef * 1.41 * Cos(alpha)); + Standard_ShortReal alpha = Standard_ShortReal( a1 - ((Standard_Integer)(a1/1.57))*1.57 ); + alpha = Standard_ShortReal ( alpha - 1.57/2.0 ); // @todo These numbers should really be PI / 2 and PI / 4 + Coef = (Standard_ShortReal) Abs(Coef * 1.41 * Cos(alpha)); } #endif diff --git a/src/Visual3d/Visual3d_Layer.cxx b/src/Visual3d/Visual3d_Layer.cxx index 7e56e0e5..2db58831 100644 --- a/src/Visual3d/Visual3d_Layer.cxx +++ b/src/Visual3d/Visual3d_Layer.cxx @@ -307,7 +307,7 @@ void Visual3d_Layer::TextSize (const Standard_CString AText, const Standard_Rea Visual3d_LayerDefinitionError::Raise ("One primitive is already open !"); - MyGraphicDriver->TextSize (AText, AHeight, aWidth, anAscent, aDescent); + MyGraphicDriver->TextSize (AText, (Standard_ShortReal)AHeight, aWidth, anAscent, aDescent); AWidth = aWidth; AnAscent = anAscent; ADescent = aDescent; diff --git a/src/Visual3d/Visual3d_View.cxx b/src/Visual3d/Visual3d_View.cxx index f4099755..3b13b66a 100644 --- a/src/Visual3d/Visual3d_View.cxx +++ b/src/Visual3d/Visual3d_View.cxx @@ -360,7 +360,7 @@ Standard_Real Sx, Sy, Sz; MyCView.Orientation.IsCustomMatrix = 1; for ( i = 0; i < 4; i++) for ( j = 0; j < 4; j++) - MyCView.Orientation.ModelViewMatrix[i][j] = MyViewOrientation.MyModelViewMatrix->Value(i,j); + MyCView.Orientation.ModelViewMatrix[i][j] = (float) MyViewOrientation.MyModelViewMatrix->Value(i,j); } else { MyCView.Orientation.IsCustomMatrix = 0; @@ -396,7 +396,7 @@ Standard_Real um, vm, uM, vM; MyCView.Mapping.IsCustomMatrix = 1; for ( i = 0; i < 4; i++) for ( j = 0; j < 4; j++) - MyCView.Mapping.ProjectionMatrix[i][j] = MyViewMapping.MyProjectionMatrix->Value(i,j); + MyCView.Mapping.ProjectionMatrix[i][j] = (float) MyViewMapping.MyProjectionMatrix->Value(i,j); } else { MyCView.Mapping.IsCustomMatrix = 0; @@ -1173,7 +1173,7 @@ Standard_Real Sx, Sy, Sz; for (j = 0; j < 4; j++) { if (!CustomIsModified) CustomIsModified = MyCView.Orientation.ModelViewMatrix[i][j] != MyViewOrientation.MyModelViewMatrix->Value(i,j); - MyCView.Orientation.ModelViewMatrix[i][j] = MyViewOrientation.MyModelViewMatrix->Value(i,j); + MyCView.Orientation.ModelViewMatrix[i][j] = (float) MyViewOrientation.MyModelViewMatrix->Value(i,j); } } @@ -1288,7 +1288,7 @@ Standard_Real Sx, Sy, Sz; for (j = 0; j < 4; j++) { if (!CustomIsModified) CustomIsModified = MyCView.Orientation.ModelViewMatrix[i][j] != MyViewOrientation.MyModelViewMatrix->Value(i,j); - MyCView.Orientation.ModelViewMatrix[i][j] = MyViewOrientation.MyModelViewMatrix->Value(i,j); + MyCView.Orientation.ModelViewMatrix[i][j] = (float)MyViewOrientation.MyModelViewMatrix->Value(i,j); } } @@ -1357,7 +1357,7 @@ Standard_Real um, vm, uM, vM; Standard_Integer i, j; for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) - MyCView.Mapping.ProjectionMatrix[i][j] = + MyCView.Mapping.ProjectionMatrix[i][j] = (float) MyViewMapping.MyProjectionMatrix->Value(i,j); } @@ -1426,7 +1426,7 @@ Standard_Real um, vm, uM, vM; Standard_Integer i, j; for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) - MyCView.Mapping.ProjectionMatrix[i][j] = + MyCView.Mapping.ProjectionMatrix[i][j] = (float) MyViewMapping.MyProjectionMatrix->Value(i,j); } diff --git a/src/Voxel/Voxel_BooleanOperation.cxx b/src/Voxel/Voxel_BooleanOperation.cxx index 116e31b5..b3298047 100644 --- a/src/Voxel/Voxel_BooleanOperation.cxx +++ b/src/Voxel/Voxel_BooleanOperation.cxx @@ -148,7 +148,7 @@ Standard_Boolean Voxel_BooleanOperation::Cut( Voxel_ColorDS& theVoxels1, Standard_Integer value = value1 - value2; if (value < 0) value = 0; - theVoxels1.Set(ix, iy, iz, value); + theVoxels1.Set(ix, iy, iz, (Standard_Byte)value); } } } diff --git a/src/Voxel/Voxel_Reader.cxx b/src/Voxel/Voxel_Reader.cxx index 3a8fc50c..1701c99f 100644 --- a/src/Voxel/Voxel_Reader.cxx +++ b/src/Voxel/Voxel_Reader.cxx @@ -198,7 +198,7 @@ Standard_Boolean Voxel_Reader::ReadBoolAsciiVoxels(const TCollection_ExtendedStr ((Standard_Byte**)((Voxel_DS*)myBoolVoxels)->myData)[i1] = (Standard_Byte*) calloc(8/*number of bytes in slice*/, sizeof(Standard_Byte)); } - (((Standard_Byte**)((Voxel_DS*)myBoolVoxels)->myData)[i1])[i2] = value; + (((Standard_Byte**)((Voxel_DS*)myBoolVoxels)->myData)[i1])[i2] = (Standard_Byte)value; } } @@ -275,7 +275,7 @@ Standard_Boolean Voxel_Reader::ReadColorAsciiVoxels(const TCollection_ExtendedSt ((Standard_Byte**)((Voxel_DS*)myColorVoxels)->myData)[i1] = (Standard_Byte*) calloc(32/*number of bytes in slice*/, sizeof(Standard_Byte)); } - (((Standard_Byte**)((Voxel_DS*)myColorVoxels)->myData)[i1])[i2] = value; + (((Standard_Byte**)((Voxel_DS*)myColorVoxels)->myData)[i1])[i2] = (Standard_Byte)value; } } @@ -346,7 +346,7 @@ Standard_Boolean Voxel_Reader::ReadFloatAsciiVoxels(const TCollection_ExtendedSt return Standard_False; } } - value = atof(line); + value = (Standard_ShortReal)atof(line); // Set value if (!((Standard_ShortReal**)((Voxel_DS*)myFloatVoxels)->myData)[i1]) @@ -409,7 +409,7 @@ Standard_Boolean Voxel_Reader::ReadBoolBinaryVoxels(const TCollection_ExtendedSt ((Standard_Byte**)((Voxel_DS*)myBoolVoxels)->myData)[i1] = (Standard_Byte*) calloc(8/*number of bytes in slice*/, sizeof(Standard_Byte)); } - (((Standard_Byte**)((Voxel_DS*)myBoolVoxels)->myData)[i1])[i2] = value; + (((Standard_Byte**)((Voxel_DS*)myBoolVoxels)->myData)[i1])[i2] = (Standard_Byte)value; } } @@ -464,7 +464,7 @@ Standard_Boolean Voxel_Reader::ReadColorBinaryVoxels(const TCollection_ExtendedS ((Standard_Byte**)((Voxel_DS*)myColorVoxels)->myData)[i1] = (Standard_Byte*) calloc(32/*number of bytes in slice*/, sizeof(Standard_Byte)); } - (((Standard_Byte**)((Voxel_DS*)myColorVoxels)->myData)[i1])[i2] = value; + (((Standard_Byte**)((Voxel_DS*)myColorVoxels)->myData)[i1])[i2] = (Standard_Byte)value; } } diff --git a/src/WNT/WNT_FontMapEntry.cxx b/src/WNT/WNT_FontMapEntry.cxx index 0cc860eb..19ee4d83 100644 --- a/src/WNT/WNT_FontMapEntry.cxx +++ b/src/WNT/WNT_FontMapEntry.cxx @@ -116,15 +116,15 @@ Aspect_Handle WNT_FontMapEntry :: SetAttrib ( if ( aFlags & faUnderlined ) - lf.lfUnderline = fd -> fdUnderlined; + lf.lfUnderline = BYTE(fd -> fdUnderlined); if ( aFlags & faItalic ) - lf.lfItalic = fd -> fdItalic; + lf.lfItalic = BYTE(fd -> fdItalic); if ( aFlags & faStrikeOut ) - lf.lfStrikeOut = fd -> fdStrikeOut; + lf.lfStrikeOut = BYTE(fd -> fdStrikeOut); if ( aFlags & faBold ) diff --git a/src/WNT/WNT_ImageProcessor.cxx b/src/WNT/WNT_ImageProcessor.cxx index d9855f8b..a7103ae2 100644 --- a/src/WNT/WNT_ImageProcessor.cxx +++ b/src/WNT/WNT_ImageProcessor.cxx @@ -600,9 +600,9 @@ static HBITMAP loadXWD ( Handle( WNT_GraphicDevice )& gDev ) { if ( ptrDIB[ k ] == xColor[ j ].pixel ) - pbInit[ k ] = j; + pbInit[ k ] = (BYTE)j; - colors[ ptrDIB[ i ] ] = j; + colors[ ptrDIB[ i ] ] = (WORD)j; } // end for diff --git a/src/WNT/WNT_PixMap.cxx b/src/WNT/WNT_PixMap.cxx index fa279c26..f003cbd8 100644 --- a/src/WNT/WNT_PixMap.cxx +++ b/src/WNT/WNT_PixMap.cxx @@ -67,7 +67,7 @@ Aspect_PixMap(aWidth, anHeight, PreferedDepth(aWindow, aCDepth)) pBmi->bmiHeader.biWidth = aWidth; pBmi->bmiHeader.biHeight = anHeight; pBmi->bmiHeader.biPlanes = 1; - pBmi->bmiHeader.biBitCount = myDepth; //WIL001: was 24 + pBmi->bmiHeader.biBitCount = (WORD)myDepth; //WIL001: was 24 pBmi->bmiHeader.biCompression = BI_RGB; LPVOID ppvBits; @@ -86,8 +86,8 @@ Aspect_PixMap(aWidth, anHeight, PreferedDepth(aWindow, aCDepth)) pfd.nSize = sizeof (PIXELFORMATDESCRIPTOR); pfd.nVersion = 1; pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_BITMAP; - pfd.iPixelType = theFormat; //WIL001: was PFD_TYPE_RGBA - pfd.cColorBits = myDepth; //WIL001: was 24 + pfd.iPixelType = (BYTE)theFormat; //WIL001: was PFD_TYPE_RGBA + pfd.cColorBits = (BYTE)myDepth; //WIL001: was 24 pfd.cDepthBits = 24;// pfd.iLayerType = PFD_MAIN_PLANE; |