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

@@ -32,10 +32,6 @@ IFSelect_DispGlobal::IFSelect_DispGlobal () { }
(const Standard_Integer /* nbent */, Standard_Integer& pcount) const
{ pcount = 1; return Standard_True; }
Standard_Boolean IFSelect_DispGlobal::PacketsCount
(const Interface_Graph& /* G */, Standard_Integer& pcount) const
{ pcount = 1; return Standard_True; }
// 1 packet ( a partir de UniqueResult)
void IFSelect_DispGlobal::Packets
(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const

View File

@@ -47,10 +47,7 @@ public:
//! Returns True : maximum equates 1
Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
//! Returns True (count of packets is well known) and count is 1
Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
//! Computes the list of produced Packets. It is made of only ONE
//! Packet, which gets the RootResult from the Final Selection.
//! Remark : the inherited exception raising is never activated.

View File

@@ -59,10 +59,6 @@ IFSelect_DispPerCount::IFSelect_DispPerCount () { }
return Standard_True;
}
Standard_Boolean IFSelect_DispPerCount::PacketsCount
(const Interface_Graph& G, Standard_Integer& /*count*/) const
{ return 1 + G.Size() / CountValue(); }
void IFSelect_DispPerCount::Packets
(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
{

View File

@@ -61,11 +61,7 @@ public:
//! Returns True, maximum count is given as <nbent>
Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
//! Returns True (count is easy to know) and count is computed
//! from length of input list (RootResult from Final Selection)
Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
//! Computes the list of produced Packets. It defines Packets in
//! order to have at most <Count> Entities per Packet, Entities
//! are given by RootResult from the Final Selection.

View File

@@ -59,10 +59,6 @@ IFSelect_DispPerFiles::IFSelect_DispPerFiles () { }
return Standard_True;
}
Standard_Boolean IFSelect_DispPerFiles::PacketsCount
(const Interface_Graph& G, Standard_Integer& /*count*/) const
{ return (G.Size() < CountValue() ? G.Size() : CountValue()); }
void IFSelect_DispPerFiles::Packets
(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
{

View File

@@ -64,11 +64,7 @@ public:
//! Returns True, maximum count is given as CountValue
Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
//! Returns True (count is easy to know) and count is the minimum
//! value between length of input list and CountValue
Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
//! Computes the list of produced Packets. It defines Packets in
//! order to have <Count> Packets, except if the input count of
//! Entities is lower. Entities are given by RootResult from the

View File

@@ -35,10 +35,6 @@ IFSelect_DispPerOne::IFSelect_DispPerOne () { }
(const Standard_Integer nbent, Standard_Integer& pcount) const
{ pcount = nbent; return Standard_True; }
Standard_Boolean IFSelect_DispPerOne::PacketsCount
(const Interface_Graph& G, Standard_Integer& pcount) const
{ pcount = G.Size(); return Standard_True; }
void IFSelect_DispPerOne::Packets
(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
{

View File

@@ -48,11 +48,7 @@ public:
//! Returns True, maximum limit is given as <nbent>
Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
//! Returns True (count is easy to know) and count is the length
//! of the input list (RootResult from FinalSelection)
Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
//! Returns the list of produced Packets. It defines one Packet
//! per Entity given by RootResult from the Final Selection.
Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE;

View File

@@ -67,10 +67,6 @@ void IFSelect_Dispatch::SetRootName
(const Interface_Graph& G) const
{ return thefinal->UniqueResult(G); }
Standard_Boolean IFSelect_Dispatch::PacketsCount
(const Interface_Graph& , Standard_Integer& pcount) const
{ pcount = 0; return Standard_False; } // par defaut 0
Interface_EntityIterator IFSelect_Dispatch::Packeted
(const Interface_Graph& G) const
{

View File

@@ -105,17 +105,7 @@ public:
//! input Graph
//! This the starting step for an Evaluation (Packets - Remainder)
Standard_EXPORT Interface_EntityIterator GetEntities (const Interface_Graph& G) const;
//! Returns True if Count of Packets is actually known, and the
//! value of the count in argument "count". Returns False if
//! this count is unknown. Input is given as a Graph.
//! This method is intended to be quick (used for file names)
//! hence if this count is long to compute (that is, as a result
//! of complete evaluation made by method Packets), it is
//! preferable to answer "unknown" by returning False
//! Default answer if False. Can be redefined.
Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const;
//! Returns the list of produced Packets into argument <pack>.
//! Each Packet corresponds to a Part, the Entities listed are the
//! Roots given by the Selection. Input is given as a Graph.

View File

@@ -124,7 +124,7 @@ static IFSelect_ReturnStatus fun1
{
Handle(IFSelect_WorkSession) WS = pilot->Session();
// **** ToggleHandler ****
int hand = !WS->ErrorHandle();
Standard_Boolean hand = !WS->ErrorHandle();
Handle(Message_Messenger) sout = Message::DefaultMessenger();
if (hand) sout << " -- Mode Catch Error now Active" <<endl;
else sout << " -- Mode Catch Error now Inactive" <<endl;

View File

@@ -56,7 +56,7 @@ IFSelect_SelectRootComps::IFSelect_SelectRootComps () { }
// (N.B.: on prend inp1, qui donne UNE entite par composant, simple ou cycle)
for (inp1.Start(); inp1.More(); inp1.Next()) {
Handle(Standard_Transient) ent = inp1.Value();
if ((Standard_Boolean)(GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent);
if ((GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent);
}
return iter;
}

View File

@@ -44,7 +44,7 @@ IFSelect_SelectRoots::IFSelect_SelectRoots () { }
// A present, on retient, parmi les inputs, celles comptees une seule fois
for (input.Start(); input.More(); input.Next()) {
Handle(Standard_Transient) ent = input.Value();
if ((Standard_Boolean)(GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent);
if ((GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent);
}
return iter;
}

View File

@@ -288,8 +288,8 @@ static TCollection_AsciiString nulword;
// Ici, resultat non nomme; Resultat nomme par commande x (plus loin)
if (!theobjrec.IsNull()) {
thesession->RemoveItem(theobjrec); //// depannage ?
Standard_Boolean addws = thesession->AddItem(theobjrec);
if (!addws) { cout<<"Could not add item to session, sorry"<<endl; return IFSelect_RetFail; }
Standard_Integer addws = thesession->AddItem(theobjrec);
if (addws == 0) { cout<<"Could not add item to session, sorry"<<endl; return IFSelect_RetFail; }
}
if (stat == IFSelect_RetVoid || stat == IFSelect_RetDone) {
@@ -500,10 +500,10 @@ static TCollection_AsciiString nulword;
// Prise en compte des commandes a resultat
if (!theobjrec.IsNull()) {
thesession->RemoveItem(theobjrec); //// depannage ?
Standard_Boolean addws =
Standard_Integer addws =
thesession->AddNamedItem(name.ToCString(),theobjrec);
theobjrec.Nullify();
if (!addws) { cout<<"Could not add named item:"<<name<<", sorry"<<endl; return IFSelect_RetFail; }
if (addws == 0) { cout<<"Could not add named item:"<<name<<", sorry"<<endl; return IFSelect_RetFail; }
}
else cout<<"Remark : xsnew with name:"<<name<<" and no result"<<endl;