0028643: Coding rules - eliminate GCC compiler warnings -Wmisleading-indentation
[occt.git] / src / IFSelect / IFSelect_Functions.cxx
index 1f698cb..01a2a4b 100644 (file)
 
 //#58 rln 28.12.98 Versioning
 
-#include <IFSelect_Functions.ixx>
 #include <IFSelect_Act.hxx>
-#include <IFSelect_SessionPilot.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <TCollection_HAsciiString.hxx>
-#include <IFSelect_SignType.hxx>
-#include <IFSelect_SignatureList.hxx>
-#include <IFSelect_IntParam.hxx>
-#include <TColStd_HSequenceOfAsciiString.hxx>
-#include <TColStd_HSequenceOfHAsciiString.hxx>
-#include <TColStd_HSequenceOfTransient.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <Interface_Static.hxx>
-#include <Interface_EntityIterator.hxx>
-
-#include <IFSelect_WorkSession.hxx>
-#include <IFSelect_GeneralModifier.hxx>
-#include <IFSelect_Modifier.hxx>
-#include <IFSelect_WorkLibrary.hxx>
-#include <Interface_InterfaceModel.hxx>
-#include <IFSelect_SessionFile.hxx>
-#include <Message_Messenger.hxx>
-#include <Message.hxx>
-
-#include <Interface_Category.hxx>
-#include <Interface_CheckIterator.hxx>
 #include <IFSelect_CheckCounter.hxx>
-#include <IFSelect_SignCounter.hxx>
-#include <IFSelect_GraphCounter.hxx>
-
 #include <IFSelect_Dispatch.hxx>
 #include <IFSelect_DispGlobal.hxx>
-#include <IFSelect_DispPerOne.hxx>
 #include <IFSelect_DispPerCount.hxx>
 #include <IFSelect_DispPerFiles.hxx>
+#include <IFSelect_DispPerOne.hxx>
 #include <IFSelect_DispPerSignature.hxx>
-#include <IFSelect_Selection.hxx>
+#include <IFSelect_EditForm.hxx>
+#include <IFSelect_Editor.hxx>
+#include <IFSelect_Functions.hxx>
+#include <IFSelect_GeneralModifier.hxx>
+#include <IFSelect_GraphCounter.hxx>
+#include <IFSelect_IntParam.hxx>
+#include <IFSelect_ListEditor.hxx>
+#include <IFSelect_Modifier.hxx>
+#include <IFSelect_ModifReorder.hxx>
 #include <IFSelect_SelectDeduct.hxx>
+#include <IFSelect_SelectDiff.hxx>
+#include <IFSelect_SelectEntityNumber.hxx>
+#include <IFSelect_SelectErrorEntities.hxx>
+#include <IFSelect_SelectIncorrectEntities.hxx>
+#include <IFSelect_SelectIntersection.hxx>
+#include <IFSelect_Selection.hxx>
 #include <IFSelect_SelectModelEntities.hxx>
 #include <IFSelect_SelectModelRoots.hxx>
-#include <IFSelect_SelectEntityNumber.hxx>
+#include <IFSelect_SelectPointed.hxx>
+#include <IFSelect_SelectRange.hxx>
 #include <IFSelect_SelectRoots.hxx>
-#include <IFSelect_SelectDiff.hxx>
-#include <IFSelect_SelectUnion.hxx>
-#include <IFSelect_SelectIntersection.hxx>
 #include <IFSelect_SelectShared.hxx>
-#include <IFSelect_SelectRange.hxx>
-#include <IFSelect_Signature.hxx>
-#include <IFSelect_SelectSignature.hxx>
-#include <IFSelect_SelectErrorEntities.hxx>
-#include <IFSelect_SelectUnknownEntities.hxx>
-#include <IFSelect_SelectIncorrectEntities.hxx>
 #include <IFSelect_SelectSharing.hxx>
-#include <IFSelect_SelectPointed.hxx>
+#include <IFSelect_SelectSignature.hxx>
 #include <IFSelect_SelectSuite.hxx>
-#include <IFSelect_ModifReorder.hxx>
-#include <IFSelect_Editor.hxx>
-#include <IFSelect_EditForm.hxx>
-#include <IFSelect_ListEditor.hxx>
-
+#include <IFSelect_SelectUnion.hxx>
+#include <IFSelect_SelectUnknownEntities.hxx>
+#include <IFSelect_SessionFile.hxx>
+#include <IFSelect_SessionPilot.hxx>
+#include <IFSelect_ShareOut.hxx>
+#include <IFSelect_Signature.hxx>
+#include <IFSelect_SignatureList.hxx>
+#include <IFSelect_SignCounter.hxx>
+#include <IFSelect_SignType.hxx>
+#include <IFSelect_Transformer.hxx>
+#include <IFSelect_WorkLibrary.hxx>
+#include <IFSelect_WorkSession.hxx>
+#include <Interface_Category.hxx>
+#include <Interface_CheckIterator.hxx>
+#include <Interface_EntityIterator.hxx>
+#include <Interface_InterfaceModel.hxx>
 #include <Interface_Macros.hxx>
-#include <Interface_Version.hxx>
 #include <Interface_MSG.hxx>
-#include <stdio.h>
-
+#include <Interface_Static.hxx>
+#include <Interface_Version.hxx>
+#include <Message.hxx>
+#include <Message_Messenger.hxx>
+#include <Standard_Transient.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TCollection_HAsciiString.hxx>
+#include <TColStd_HSequenceOfAsciiString.hxx>
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <TColStd_MapOfInteger.hxx>
 
+#include <stdio.h>
 //  Decomposition of a file name in its parts : prefix, root, suffix
-
 static void SplitFileName
   (const Standard_CString filename,
    TCollection_AsciiString& prefix,
@@ -128,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;
@@ -165,17 +161,6 @@ static IFSelect_ReturnStatus fun3
   return status;
 }
 
-static IFSelect_ReturnStatus fun_whatfile
-  (const Handle(IFSelect_SessionPilot)& pilot)
-{
-  TCollection_AsciiString whatcom = IFSelect_Activator::Alias ("whatfile");
-  if (whatcom.Length() > 0) return pilot->ExecuteAlias (whatcom);
-  Handle(Message_Messenger) sout = Message::DefaultMessenger();
-  sout<<"Load File : "<<pilot->Session()->LoadedFile()<<endl;
-  sout<<"No specific whatfile available"<<endl;
-  return IFSelect_RetVoid;
-}
-
 static IFSelect_ReturnStatus fun4
   (const Handle(IFSelect_SessionPilot)& pilot)
 {
@@ -260,7 +245,7 @@ static IFSelect_ReturnStatus fun8
   Handle(Message_Messenger) sout = Message::DefaultMessenger();
   if (argc < 2) { sout<<"Give label to search"<<endl; return IFSelect_RetError; }
   if (!WS->HasModel()) { sout<<"No loaded model, abandon"<<endl; return IFSelect_RetError; }
-  Handle(Interface_InterfaceModel) model = WS->Model();
+  const Handle(Interface_InterfaceModel) &model = WS->Model();
   Standard_Integer i, cnt = 0;
   Standard_Boolean exact = Standard_False;
   sout<<" **  Search Entity Number for Label : "<<arg1<<endl;
@@ -1988,7 +1973,7 @@ static IFSelect_ReturnStatus fun91
   }
   DeclareAndCast(IFSelect_SelectPointed,sp,WS->NamedItem(arg1));
   if (sp.IsNull()) { sout<<"Pas une SelectPointed:"<<arg1<<endl; return IFSelect_RetError; }
-  Handle(Interface_InterfaceModel) model = WS->Model();  // pour Print
+  const Handle(Interface_InterfaceModel) &model = WS->Model();  // pour Print
   if (argc == 2) {    // listage simple
     Standard_Integer nb = sp->NbItems();
     sout<<" SelectPointed : "<<arg1<<" : "<<nb<<" Items :"<<endl;
@@ -2453,19 +2438,21 @@ Handle(IFSelect_Dispatch)  IFSelect_Functions::GiveDispatch
 //  ####    INITIALISATIONS              ####
 //  #########################################
 
-static int initactor = 0;
+static int THE_IFSelect_Functions_initactor = 0;
 
-
-    void  IFSelect_Functions::Init ()
+void IFSelect_Functions::Init()
 {
-  if (initactor) return;  initactor = 1;
+  if (THE_IFSelect_Functions_initactor)
+  {
+    return;
+  }
+
+  THE_IFSelect_Functions_initactor = 1;
   IFSelect_Act::SetGroup("DE: General");
   IFSelect_Act::AddFunc("xstatus","Lists XSTEP Status : Version, System Name ...",funstatus);
   IFSelect_Act::AddFunc("handler","Toggle status catch Handler Error of the session",fun1);
   IFSelect_Act::AddFunc("xload","file:string  : Read File -> Load Model",fun3);
-// IFSelect_Act::AddFunc("load","file:string  : Read File -> Load Model",fun3);
   IFSelect_Act::AddFunc("xread","file:string  : Read File -> Load Model",fun3);
-  IFSelect_Act::AddFunc("whatfile"," -> analyses a file (specific per norm)",fun_whatfile);
   IFSelect_Act::AddFunc("writeall","file:string  : Write all model (no split)",fun4);
   IFSelect_Act::AddFunc("writesel","file:string sel:Selection : Write Selected (no split)",fun5);
   IFSelect_Act::AddFunc("writeent","file:string  n1ent n2ent...:integer : Write Entite(s) (no split)",fun6);