1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead of "unsigned int"

Code has been updated to remove no-op casts and implicit casts to Standard_Boolean.

Places of inproper use of Standard_Boolean instead of Standard_Integer
have been corrected:
- Bnd_Box, Bnd_Box2d
  Bit flags are now defined as private enum
- HLRAlgo_BiPoint, HLRAlgo_EdgesBlock, HLRBRep_EdgeData, HLRBRep_FaceData
  Bit flags are now defined as enum
- HLRAlgo_EdgeStatus, HLRBRep_BiPnt2D, HLRBRep_BiPoint
  Bit flags are now defined as bool fields
- HLRAlgo_PolyData
  Bit flags are now defined as Standard_Integer
- OSD_DirectoryIterator, OSD_FileIterator
  Boolean flag is now defined as Standard_Boolean
- ShapeAnalysis_Surface::SurfaceNewton()
  now returns Standard_Integer (values 0, 1 or 3)
- ChFi2d_FilletAlgo
  now uses TColStd_SequenceOfBoolean instead of TColStd_SequenceOfInteger
  for storing boolean flags

Method IFSelect_Dispatch::PacketsCount() has been dropped from interface.

ShapeFix_Solid::Status() has been fixed to decode requested status
instead of returning integer value.

TopOpeBRepBuild_Builder1 now defines map storing Standard_Boolean values
instead of Standard_Integer.

Persistence for Standard_Boolean type has been corrected
to keep backward compatibility:
- BinMDataStd, BinTools, FSD_BinaryFile

Broken Draw Harness commands vdisplaymode and verasemode have been removed.

BRepMesh_FastDiscretFace::initDataStructure() - workaround old gcc limitations

BRepMesh_IncrementalMesh::clear() - avoid ambiguity
This commit is contained in:
kgv
2016-08-25 14:58:51 +03:00
committed by abv
parent 3fe9ce0edd
commit dde6883382
211 changed files with 1324 additions and 2667 deletions

View File

@@ -355,7 +355,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
di << syntaxe << "\n";
return 1;
}
closedSolid=Draw::Atoi(a[narg-1]);
closedSolid = Draw::Atoi(a[narg-1]) != 0;
resu = DBRep::Get(a[narg-2]);
lastArg=narg-3;
if (resu.IsNull()) {
@@ -365,7 +365,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
return 1;
}
geomCtrl=closedSolid;
closedSolid=Draw::Atoi(a[narg-2]);
closedSolid = Draw::Atoi(a[narg-2]) != 0;
resu = DBRep::Get(a[narg-3]);
lastArg=narg-4;
if (resu.IsNull()) {

View File

@@ -999,8 +999,8 @@ static Standard_Integer bsplineprof(Draw_Interpretor& di,
0.0e0) ;
gp_Pnt2d first_point(0.0e0,
0.0e0) ;
Standard_Integer i = 2,
wait = 1 ;
Standard_Integer i = 2;
Standard_Boolean wait = Standard_True;
// Standard_Real x0 = 0, y0 = 0, x = 0, y = 0, dx = 1, dy = 0;
Standard_Real x = 0, y = 0, dx = 1, dy = 0;
BRepBuilderAPI_MakeWire MW;

View File

@@ -127,11 +127,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
return 1;
}
//#ifdef OCCT_DEBUG
// Flag = Draw::Atof(a[9*ii+7]); // BUG?? Real -> Boolean ???
//#else
Flag = (Standard_Boolean ) Draw::Atof(a[9*ii+7]);
//#endif
Flag = Draw::Atoi(a[9*ii+7]) != 0;
Angle = Draw::Atof(a[9*ii+8])*M_PI/180.;
Pax.SetCoord(Draw::Atof(a[9*ii+9]),Draw::Atof(a[9*ii+10]),Draw::Atof(a[9*ii+11]));
Dax.SetCoord(Draw::Atof(a[9*ii+12]),Draw::Atof(a[9*ii+13]),Draw::Atof(a[9*ii+14]));

View File

@@ -330,7 +330,7 @@ static Standard_Integer CONTROL(Draw_Interpretor& theCommands,
Standard_Integer narg, const char** a)
{
if (narg >= 2) {
WithControl = strcmp("0",a[1]);
WithControl = strcmp("0", a[1]) != 0;
}
if (WithControl) {
theCommands << "Mode avec controle";
@@ -787,7 +787,7 @@ static Standard_Integer SPLS(Draw_Interpretor& ,
for (; aExpE.More(); aExpE.Next())
aSplitEdges.Append(aExpE.Current());
isSplittingEdges = (aSplitEdges.Length());
isSplittingEdges = !aSplitEdges.IsEmpty();
}
}
@@ -1050,7 +1050,7 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
if ( n < 4 ) return 1;
//
TheTolerance = Draw::Atof(a[1]);
TheInter = strcmp(a[2],"p");
TheInter = strcmp(a[2],"p") != 0;
//
if ( !strcmp(a[3],"a")) TheJoin = GeomAbs_Arc;
else if ( !strcmp(a[3],"i")) TheJoin = GeomAbs_Intersection;

View File

@@ -669,7 +669,7 @@ static Standard_Integer fillingparam( Draw_Interpretor & di, Standard_Integer n,
Degree = Draw::Atoi( a[2] );
NbPtsOnCur = Draw::Atoi( a[3] );
NbIter = Draw::Atoi( a[4] );
Anisotropie = Draw::Atoi( a[5] );
Anisotropie = Draw::Atoi( a[5] ) != 0;
}
else if (strcmp( flag, "-c" ) == 0 && n == 6)
{

View File

@@ -529,7 +529,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
else
{
TopoDS_Shape Guide = DBRep::Get(a[2],TopAbs_WIRE);
Standard_Integer CurvilinearEquivalence = Draw::Atoi(a[3]);
Standard_Boolean CurvilinearEquivalence = Draw::Atoi(a[3]) != 0;
Standard_Integer KeepContact = Draw::Atoi(a[4]);
Sweep->SetMode(TopoDS::Wire(Guide),
CurvilinearEquivalence,