1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +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

@@ -308,7 +308,7 @@ Standard_Boolean ShapeProcess_Context::GetBoolean (const Standard_CString param,
if ( myRC.IsNull() ) return Standard_False;
try {
OCC_CATCH_SIGNALS
val = (Standard_Boolean)myRC->Integer ( MakeName ( myScope, param )->ToCString() );
val = myRC->Integer (MakeName (myScope, param)->ToCString()) != 0;
return Standard_True;
}
catch (Standard_Failure) {

View File

@@ -143,7 +143,7 @@ static Standard_Boolean sameparam (const Handle(ShapeProcess_Context)& context)
if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator;
ShapeFix::SameParameter ( ctx->Result(),
ctx->IntegerVal ( "Force", Standard_False ),
ctx->BooleanVal ( "Force", Standard_False ),
ctx->RealVal ( "Tolerance3d", Precision::Confusion() /* -1 */),
NULL, msg );
@@ -232,9 +232,9 @@ static Standard_Boolean bsplinerestriction (const Handle(ShapeProcess_Context)&
Handle(ShapeExtend_MsgRegistrator) msg;
if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator;
Standard_Boolean ModeSurf = ctx->IntegerVal ( "SurfaceMode", Standard_True );
Standard_Boolean ModeC3d = ctx->IntegerVal ( "Curve3dMode", Standard_True );
Standard_Boolean ModeC2d = ctx->IntegerVal ( "Curve2dMode", Standard_True );
Standard_Boolean ModeSurf = ctx->BooleanVal ( "SurfaceMode", Standard_True );
Standard_Boolean ModeC3d = ctx->BooleanVal ( "Curve3dMode", Standard_True );
Standard_Boolean ModeC2d = ctx->BooleanVal ( "Curve2dMode", Standard_True );
Standard_Real aTol3d = ctx->RealVal ( "Tolerance3d", 0.01 );
Standard_Real aTol2d = ctx->RealVal ( "Tolerance2d", 1e-06 );
@@ -245,8 +245,8 @@ static Standard_Boolean bsplinerestriction (const Handle(ShapeProcess_Context)&
Standard_Integer aMaxDeg = ctx->IntegerVal ( "RequiredDegree", 9 );
Standard_Integer aMaxSeg = ctx->IntegerVal ( "RequiredNbSegments", 10000 );
Standard_Boolean ModeDeg = ctx->IntegerVal ( "PreferDegree", Standard_True );
Standard_Boolean Rational = ctx->IntegerVal ( "RationalToPolynomial", Standard_False );
Standard_Boolean ModeDeg = ctx->BooleanVal ( "PreferDegree", Standard_True );
Standard_Boolean Rational = ctx->BooleanVal ( "RationalToPolynomial", Standard_False );
Handle(ShapeCustom_RestrictionParameters) aParameters = new ShapeCustom_RestrictionParameters;
ctx->GetInteger ( "MaxDegree", aParameters->GMaxDegree() );
@@ -711,7 +711,7 @@ static Standard_Boolean fixshape (const Handle(ShapeProcess_Context)& context)
sfs->FixVertexPositionMode() = ctx->IntegerVal ( "FixVertexPositionMode", 0 );
sfs->FixSolidTool()->FixShellMode() = ctx->IntegerVal ( "FixShellMode", -1 );
sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->IntegerVal ( "CreateOpenSolidMode", 1 );
sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->BooleanVal ( "CreateOpenSolidMode", Standard_True );
sfs->FixShellTool()->FixFaceMode() = ctx->IntegerVal ( "FixFaceMode", -1 );