Most of the compiler warnings C4244 have been eliminated.
/* 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;
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;
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;
}
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;
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);
}
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);
}
}
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);
for(j=0;j<SV1;j++) {
aIPD.xIP1(i, j)=-1;
const gp_Pnt& P=aIPD.xP1(i, j);
- aIPD.xP1DS2(i, j) = CodeReject(x20,y20,z20,x21,y21,z21,P.X(),P.Y(),P.Z());
+ aIPD.xP1DS2(i, j) = (char)CodeReject(x20,y20,z20,x21,y21,z21,P.X(),P.Y(),P.Z());
int ix = (int)((P.X()-x0 + dx2 )/dx);
if(DansGrille(ix)) {
int iy = (int)((P.Y()-y0 + dy2)/dy);
for(j=0;j<SV2;j++) {
aIPD.xIP2(i, j)=-1;
const gp_Pnt& P=aIPD.xP2(i, j);
- aIPD.xP2DS1(i, j) = CodeReject(x10,y10,z10,x11,y11,z11,P.X(),P.Y(),P.Z());
+ aIPD.xP2DS1(i, j) = (char)CodeReject(x10,y10,z10,x11,y11,z11,P.X(),P.Y(),P.Z());
int ix = (int)((P.X()-x0 + dx2)/dx);
if(DansGrille(ix)) {
int iy = (int)((P.Y()-y0 + dy2)/dy);
c->SetValue(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;
}
//=======================================================================
int LDOM_SBuffer::overflow(int c)
{
- char cc = c;
+ char cc = (char)c;
return xsputn(&cc,1);
}
{
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;
}
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
}};
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)
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;
{
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();
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)
{
return ;
}
- sjis = ((*ph) << 8) | (*pl) ;
+ sjis = (char16)(((*ph) << 8) | (*pl)) ;
uni = sjisuni [sjis] ;
*ph = uni >> 8 ;
*pl = uni & 0xFF ;
if ( *ph == 0 && *pl == 0 )
return ;
- uni = ((*ph) << 8) | (*pl) ;
+ uni = (char16)(((*ph) << 8) | (*pl)) ;
sjis = unisjis [uni] ;
*ph = sjis >> 8 ;
*pl = sjis & 0xFF ;
*ph = (*ph) & 0x7f ;
*pl = (*pl) & 0x7f ;
- gb = ((*ph) << 8) | (*pl) ;
+ gb = (char16)(((*ph) << 8) | (*pl)) ;
uni = gbuni [gb] ;
*ph = uni >> 8 ;
*pl = uni & 0xFF ;
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 ;
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) ;
}
}
//==============================================================================
-static int ViewerMainLoop(Standard_Integer argc, const char** argv)
+int ViewerMainLoop(Standard_Integer argc, const char** argv)
{
Ppick = (argc > 0)? 1 : 0;
Pargc = argc;
Standard_Integer value = value1 - value2;
if (value < 0)
value = 0;
- theVoxels1.Set(ix, iy, iz, value);
+ theVoxels1.Set(ix, iy, iz, (Standard_Byte)value);
}
}
}
((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;
}
}
((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;
}
}
((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;
}
}
((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;
}
}
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;