diff --git a/src/AdvApp2Var/AdvApp2Var_SysBase.cxx b/src/AdvApp2Var/AdvApp2Var_SysBase.cxx index 4fbec48f89..576214e434 100755 --- a/src/AdvApp2Var/AdvApp2Var_SysBase.cxx +++ b/src/AdvApp2Var/AdvApp2Var_SysBase.cxx @@ -2999,11 +2999,11 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit, /* RANGING OF PARAMETERS IN MCRGENE */ mcrgene_.icore[mcrgene_.ncore].prot = mcrgene_.lprot; - mcrgene_.icore[mcrgene_.ncore].unit = *iunit; + mcrgene_.icore[mcrgene_.ncore].unit = (unsigned char)(*iunit); mcrgene_.icore[mcrgene_.ncore].reqsize = *isize; mcrgene_.icore[mcrgene_.ncore].loc = loc; mcrgene_.icore[mcrgene_.ncore].offset = *iofset; - mcrgene_.icore[mcrgene_.ncore].alloctype = ksys; + mcrgene_.icore[mcrgene_.ncore].alloctype = (unsigned char)ksys; mcrgene_.icore[mcrgene_.ncore].size = ibyte; mcrgene_.icore[mcrgene_.ncore].addr = iaddr; mcrgene_.icore[mcrgene_.ncore].userzone = mcrgene_.ncore; diff --git a/src/BinTools/BinTools_LocationSet.cxx b/src/BinTools/BinTools_LocationSet.cxx index dbeada2636..4eb0476c9d 100755 --- a/src/BinTools/BinTools_LocationSet.cxx +++ b/src/BinTools/BinTools_LocationSet.cxx @@ -238,7 +238,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/DDataStd/DDataStd_BasicCommands.cxx b/src/DDataStd/DDataStd_BasicCommands.cxx index 8a18ac3b28..a3b44cc2de 100755 --- a/src/DDataStd/DDataStd_BasicCommands.cxx +++ b/src/DDataStd/DDataStd_BasicCommands.cxx @@ -1157,13 +1157,13 @@ static Standard_Integer DDataStd_SetByteArray (Draw_Interpretor& di, Handle(TDataStd_ByteArray) A = TDataStd_ByteArray::Set(label, From, To, isDelta); j = 6; - for(Standard_Integer i = From; i<=To; i++) { + for(Standard_Integer i = From; i<=To; ++i) { Standard_Integer ival = Draw::Atoi(arg[j]); - if(ival > 255) { - cout << "Bad value = " << ival<< endl; - return 1; + if(ival < 0 && 255 < ival) { + cout << "Bad value = " << ival<< endl; + return 1; } - A->SetValue(i, (unsigned)ival); + A->SetValue(i, (Standard_Byte)ival); j++; } return 0; @@ -1393,7 +1393,7 @@ static Standard_Integer DDataStd_ChangeByteArray (Draw_Interpretor& di, } Standard_Integer low = A->Lower(), up = A->Upper(); if(low <= indx && indx <= up) - A->SetValue(indx, (unsigned)ival); + A->SetValue(indx, (Standard_Byte)ival); else { Handle(TColStd_HArray1OfByte) Arr = A->InternalArray(); Handle(TColStd_HArray1OfByte) arr; @@ -1405,7 +1405,7 @@ static Standard_Integer DDataStd_ChangeByteArray (Draw_Interpretor& di, arr->SetValue(i, Arr->Value(i)); for(i=Arr->Upper()+1; i<= up; i++) { if(i == up) - arr->SetValue(i, (unsigned)ival); + arr->SetValue(i, (Standard_Byte)ival); else arr->SetValue(i, 0); } @@ -1414,7 +1414,7 @@ static Standard_Integer DDataStd_ChangeByteArray (Draw_Interpretor& di, arr = new TColStd_HArray1OfByte(low, up); for(i=low; i< up; i++) arr->SetValue(i, Arr->Value(i)); - arr->SetValue(up, (unsigned)ival); + arr->SetValue(up, (Standard_Byte)ival); } A->ChangeArray(arr); } diff --git a/src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx b/src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx index fc0f179482..e9457e2035 100644 --- a/src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx +++ b/src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx @@ -153,15 +153,11 @@ inline void Graphic3d_ArrayOfPrimitives::SetVertexColor(const Standard_Integer a } if( myPrimitiveArray->vcolours ) { - unsigned char red = (unsigned int)(R * 255.); - unsigned char green = (unsigned int)(G * 255.); - unsigned char blue = (unsigned int)(B * 255.); - unsigned char alpha = 0; - Standard_Integer outColor ; - outColor = red; - outColor += green << 8; - outColor += blue << 16; - outColor += alpha << 24; + unsigned int red = (unsigned int)(R * 255.); + unsigned int green = (unsigned int)(G * 255.); + unsigned int blue = (unsigned int)(B * 255.); + unsigned int alpha = 0; + Standard_Integer outColor = alpha << 24 | blue << 16 | green << 8 | red; SetVertexColor( anIndex, outColor ); } myPrimitiveArray->num_vertexs = Max(anIndex,myPrimitiveArray->num_vertexs); diff --git a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx index 68a7c36234..4b87723c5c 100755 --- a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx @@ -2914,7 +2914,7 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S for(j=0;jSetValue(i,thecategory->Value(i)); thecategory = c; } - Standard_Character cval = (val + 32); + Standard_Character cval = (Standard_Character)(val + 32); thecategory->SetValue(num,cval); return Standard_True; } diff --git a/src/LDOM/LDOM_OSStream.cxx b/src/LDOM/LDOM_OSStream.cxx index b3e4732a58..edb6f7d505 100755 --- a/src/LDOM/LDOM_OSStream.cxx +++ b/src/LDOM/LDOM_OSStream.cxx @@ -104,7 +104,7 @@ Standard_CString LDOM_SBuffer::str () const //======================================================================= int LDOM_SBuffer::overflow(int c) { - char cc = c; + char cc = (char)c; return xsputn(&cc,1); } diff --git a/src/MeshVS/MeshVS_NodalColorPrsBuilder.cxx b/src/MeshVS/MeshVS_NodalColorPrsBuilder.cxx index 8651e71942..0a3f178f0b 100755 --- a/src/MeshVS/MeshVS_NodalColorPrsBuilder.cxx +++ b/src/MeshVS/MeshVS_NodalColorPrsBuilder.cxx @@ -728,9 +728,9 @@ Handle(Graphic3d_Texture2D) MeshVS_NodalColorPrsBuilder::CreateTexture() const { const Quantity_Color& aSrcColor = myTextureColorMap.Value (Standard_Integer(aCol) + 1); Image_ColorRGBA& aColor = aData.ChangeValue (0, aCol); - aColor.r() = int(255.0 * aSrcColor.Red()); - aColor.g() = int(255.0 * aSrcColor.Green()); - aColor.b() = int(255.0 * aSrcColor.Blue()); + aColor.r() = Standard_Byte(255.0 * aSrcColor.Red()); + aColor.g() = Standard_Byte(255.0 * aSrcColor.Green()); + aColor.b() = Standard_Byte(255.0 * aSrcColor.Blue()); aColor.a() = 0xFF; } @@ -738,9 +738,9 @@ Handle(Graphic3d_Texture2D) MeshVS_NodalColorPrsBuilder::CreateTexture() const const Quantity_Color& aLastColorSrc = myTextureColorMap.Last(); const Image_ColorRGBA aLastColor = {{ - int(255.0 * aLastColorSrc.Red()), - int(255.0 * aLastColorSrc.Green()), - int(255.0 * aLastColorSrc.Blue()), + Standard_Byte(255.0 * aLastColorSrc.Red()), + Standard_Byte(255.0 * aLastColorSrc.Green()), + Standard_Byte(255.0 * aLastColorSrc.Blue()), 0xFF }}; @@ -752,9 +752,9 @@ Handle(Graphic3d_Texture2D) MeshVS_NodalColorPrsBuilder::CreateTexture() const const Image_ColorRGBA anInvalidColor = {{ - int(255.0 * myInvalidColor.Red()), - int(255.0 * myInvalidColor.Green()), - int(255.0 * myInvalidColor.Blue()), + Standard_Byte(255.0 * myInvalidColor.Red()), + Standard_Byte(255.0 * myInvalidColor.Green()), + Standard_Byte(255.0 * myInvalidColor.Blue()), 0xFF }}; for (Standard_Size aCol = 0; aCol < anImage->SizeX(); ++aCol) diff --git a/src/OpenGl/OpenGl_GraduatedTrihedron.hxx b/src/OpenGl/OpenGl_GraduatedTrihedron.hxx index 3b128bf7ad..d69ede116e 100644 --- a/src/OpenGl/OpenGl_GraduatedTrihedron.hxx +++ b/src/OpenGl/OpenGl_GraduatedTrihedron.hxx @@ -69,7 +69,9 @@ protected: unsigned int myNbX, myNbY, myNbZ; int myXOffset, myYOffset, myZOffset; int myXAxisOffset, myYAxisOffset, myZAxisOffset; - unsigned char myDrawXTickmarks, myDrawYTickmarks, myDrawZTickmarks; + Standard_Boolean myDrawXTickmarks; + Standard_Boolean myDrawYTickmarks; + Standard_Boolean myDrawZTickmarks; unsigned int myXTickmarkLength, myYTickmarkLength, myZTickmarkLength; float myGridColor[3]; TEL_COLOUR myXColor; diff --git a/src/OpenGl/OpenGl_View_2.cxx b/src/OpenGl/OpenGl_View_2.cxx index 8e7334806c..2e2b5f66e5 100644 --- a/src/OpenGl/OpenGl_View_2.cxx +++ b/src/OpenGl/OpenGl_View_2.cxx @@ -1389,9 +1389,9 @@ void OpenGl_View::CreateBackgroundTexture (const Standard_CString theFilePath, { aSrcColor = anImageLoaded.PixelColor ((Standard_Integer )aCol, (Standard_Integer )aRow); Image_ColorRGB& aColor = aDataNew.ChangeValue (aRow, aCol); - aColor.r() = int(255.0 * aSrcColor.Red()); - aColor.g() = int(255.0 * aSrcColor.Green()); - aColor.b() = int(255.0 * aSrcColor.Blue()); + aColor.r() = Standard_Byte(255.0 * aSrcColor.Red()); + aColor.g() = Standard_Byte(255.0 * aSrcColor.Green()); + aColor.b() = Standard_Byte(255.0 * aSrcColor.Blue()); } } anImageLoaded.Clear(); diff --git a/src/OpenGl/OpenGl_Window.cxx b/src/OpenGl/OpenGl_Window.cxx index 588ed32cf7..a05ec8295a 100644 --- a/src/OpenGl/OpenGl_Window.cxx +++ b/src/OpenGl/OpenGl_Window.cxx @@ -61,14 +61,14 @@ namespace Standard_Size aStencilIter = 0, aColorIter = 0, aDepthIter = 0; for (aStencilIter = 0; aStencilIter < sizeof(BUFF_BITS_STENCIL) / sizeof(int); ++aStencilIter) { - aPixelFrmtTmp.cStencilBits = BUFF_BITS_STENCIL[aStencilIter]; + aPixelFrmtTmp.cStencilBits = (BYTE)(BUFF_BITS_STENCIL[aStencilIter]); for (aDepthIter = 0; aDepthIter < sizeof(BUFF_BITS_DEPTH) / sizeof(int); ++aDepthIter) { - aPixelFrmtTmp.cDepthBits = BUFF_BITS_DEPTH[aDepthIter]; + aPixelFrmtTmp.cDepthBits = (BYTE)(BUFF_BITS_DEPTH[aDepthIter]); aPixelFrmtIdGood = 0; for (aColorIter = 0; aColorIter < sizeof(BUFF_BITS_COLOR) / sizeof(int); ++aColorIter) { - aPixelFrmtTmp.cColorBits = BUFF_BITS_COLOR[aColorIter]; + aPixelFrmtTmp.cColorBits = (BYTE)(BUFF_BITS_COLOR[aColorIter]); aPixelFrmtIdLast = ChoosePixelFormat (theDevCtx, &aPixelFrmtTmp); if (aPixelFrmtIdLast == 0) { diff --git a/src/Resource/Resource_ConvertUnicode.c b/src/Resource/Resource_ConvertUnicode.c index 21bfab64bb..9d51d9b7bd 100755 --- a/src/Resource/Resource_ConvertUnicode.c +++ b/src/Resource/Resource_ConvertUnicode.c @@ -139,7 +139,7 @@ void Resource_sjis_to_unicode (unsigned int *ph, unsigned int *pl) return ; } - sjis = ((*ph) << 8) | (*pl) ; + sjis = (char16)(((*ph) << 8) | (*pl)) ; uni = sjisuni [sjis] ; *ph = uni >> 8 ; *pl = uni & 0xFF ; @@ -158,7 +158,7 @@ void Resource_unicode_to_sjis (unsigned int *ph, unsigned int *pl) if ( *ph == 0 && *pl == 0 ) return ; - uni = ((*ph) << 8) | (*pl) ; + uni = (char16)(((*ph) << 8) | (*pl)) ; sjis = unisjis [uni] ; *ph = sjis >> 8 ; *pl = sjis & 0xFF ; @@ -213,7 +213,7 @@ void Resource_gb_to_unicode (unsigned int *ph, unsigned int *pl) *ph = (*ph) & 0x7f ; *pl = (*pl) & 0x7f ; - gb = ((*ph) << 8) | (*pl) ; + gb = (char16)(((*ph) << 8) | (*pl)) ; uni = gbuni [gb] ; *ph = uni >> 8 ; *pl = uni & 0xFF ; @@ -232,7 +232,7 @@ void Resource_unicode_to_gb (unsigned int *ph, unsigned int *pl) if ( *ph == 0 && *pl == 0 ) return ; - uni = ((*ph) << 8) | (*pl) ; + uni = (char16)(((*ph) << 8) | (*pl)); gb = unigb [uni] ; if (gb != 0) { *ph = ( gb >> 8 ) | 0x80 ; diff --git a/src/StepFile/recfile.pc b/src/StepFile/recfile.pc index ff6db0bfc6..f4066e4f7a 100755 --- a/src/StepFile/recfile.pc +++ b/src/StepFile/recfile.pc @@ -373,7 +373,7 @@ void rec_deblist() default: { char bufsub[10]; if (numsub > 9) sprintf (bufsub,"$%d",numsub) ; - else { bufsub[0] = '$'; bufsub[1] = numsub + 48; bufsub[2] = '\0'; } + else { bufsub[0] = '$'; bufsub[1] = (char)(numsub + 48); bufsub[2] = '\0'; } subrec->ident = rec_newtext(bufsub) ; } } diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index f7e3c18cf0..6b9030e17a 100755 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -2010,7 +2010,7 @@ static LRESULT WINAPI ViewerWindowProc( HWND hwnd, //============================================================================== -static int ViewerMainLoop(Standard_Integer argc, const char** argv) +int ViewerMainLoop(Standard_Integer argc, const char** argv) { Ppick = (argc > 0)? 1 : 0; Pargc = argc; diff --git a/src/Voxel/Voxel_BooleanOperation.cxx b/src/Voxel/Voxel_BooleanOperation.cxx index b72ac6545d..7ec5b7636f 100755 --- a/src/Voxel/Voxel_BooleanOperation.cxx +++ b/src/Voxel/Voxel_BooleanOperation.cxx @@ -163,7 +163,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 8824f4b3fe..ac235a499f 100755 --- a/src/Voxel/Voxel_Reader.cxx +++ b/src/Voxel/Voxel_Reader.cxx @@ -211,7 +211,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; } } @@ -288,7 +288,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; } } @@ -422,7 +422,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; } } @@ -477,7 +477,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/VrmlData/VrmlData_ShapeConvert.cxx b/src/VrmlData/VrmlData_ShapeConvert.cxx index 22ffec8cf4..b70ff5a80b 100755 --- a/src/VrmlData/VrmlData_ShapeConvert.cxx +++ b/src/VrmlData/VrmlData_ShapeConvert.cxx @@ -82,7 +82,7 @@ void VrmlData_ShapeConvert::AddShape (const TopoDS_Shape& theShape, char buf[2048], * optr = &buf[0]; char * eptr = &buf[sizeof(buf)-1]; for (const char * ptr = theName;; ptr++) { - int sym = *ptr; + char sym = *ptr; if (sym == '\0' || sym == '\n' || sym == '\r') { * optr = '\0'; break;