1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0028643: Coding rules - eliminate GCC compiler warnings -Wmisleading-indentation

This commit is contained in:
kgv
2017-04-08 14:50:24 +03:00
committed by bugmaster
parent 14c4193d11
commit c48e2889cd
68 changed files with 1691 additions and 1060 deletions

View File

@@ -23,7 +23,7 @@
#include <TColStd_SequenceOfAsciiString.hxx>
#include <NCollection_Vector.hxx>
static int init = 0;
static int THE_Interface_Category_init = 0;
static Standard_CString unspec = "unspecified";
static Standard_Mutex gMapTypesMutex;
@@ -111,16 +111,21 @@ void Interface_Category::Init ()
gMapTypesMutex.Lock();
if ( !gMapTypesInit )
{
if (init) return; init = 1;
init = Interface_Category::AddCategory ("Shape");
init = Interface_Category::AddCategory ("Drawing");
init = Interface_Category::AddCategory ("Structure");
init = Interface_Category::AddCategory ("Description");
init = Interface_Category::AddCategory ("Auxiliary");
init = Interface_Category::AddCategory ("Professional");
init = Interface_Category::AddCategory ("FEA");
init = Interface_Category::AddCategory ("Kinematics");
init = Interface_Category::AddCategory ("Piping");
if (THE_Interface_Category_init)
{
return;
}
THE_Interface_Category_init = 1;
Interface_Category::AddCategory ("Shape");
Interface_Category::AddCategory ("Drawing");
Interface_Category::AddCategory ("Structure");
Interface_Category::AddCategory ("Description");
Interface_Category::AddCategory ("Auxiliary");
Interface_Category::AddCategory ("Professional");
Interface_Category::AddCategory ("FEA");
Interface_Category::AddCategory ("Kinematics");
Interface_Category::AddCategory ("Piping");
gMapTypesInit = Standard_True;
}

View File

@@ -272,27 +272,70 @@ Interface_CheckStatus Interface_CheckIterator::Status () const
//=======================================================================
//function : Complies
//purpose :
//purpose :
//=======================================================================
Standard_Boolean Interface_CheckIterator::Complies
(const Interface_CheckStatus stat) const
{
Standard_Boolean res = Standard_False;
if (stat == Interface_CheckNoFail) res = Standard_True;
Standard_Integer i, nb = thelist->Length();
for (i = 1; i <= nb; i ++) {
Standard_Boolean res = (stat == Interface_CheckNoFail);
Standard_Integer nb = thelist->Length();
for (Standard_Integer i = 1; i <= nb; ++i)
{
const Handle(Interface_Check) ach = thelist->Value(i);
Standard_Integer nbf = ach->NbFails(), nbw = ach->NbWarnings();
switch (stat) {
case Interface_CheckOK : if (nbf + nbw > 0) return Standard_False; break;
case Interface_CheckWarning : if (nbf > 0) return Standard_False;
if (nbw > 0) res = Standard_True; break;
case Interface_CheckFail : if (nbf > 0) return Standard_True; break;
case Interface_CheckAny : return Standard_True;
case Interface_CheckMessage : if (nbf + nbw > 0) return Standard_True; break;
case Interface_CheckNoFail : if (nbf > 0) return Standard_False; break;
default : break;
switch (stat)
{
case Interface_CheckOK:
{
if (nbf + nbw > 0)
{
return Standard_False;
}
break;
}
case Interface_CheckWarning:
{
if (nbf > 0)
{
return Standard_False;
}
if (nbw > 0)
{
res = Standard_True;
}
break;
}
case Interface_CheckFail:
{
if (nbf > 0)
{
return Standard_True;
}
break;
}
case Interface_CheckAny:
{
return Standard_True;
}
case Interface_CheckMessage:
{
if (nbf + nbw > 0)
{
return Standard_True;
}
break;
}
case Interface_CheckNoFail:
{
if (nbf > 0)
{
return Standard_False;
}
break;
}
default:
break;
}
}
return res;

View File

@@ -41,9 +41,9 @@ static Standard_Integer thenm0 = -1;
static Standard_Integer thenp0 = -1;
Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
const Standard_Integer npar)
: therrload (0), thenumpar (0,nbr), theents (0,nbr)
: therrload (0), thenumpar (0,nbr), theents (0,nbr)
{
theparams = new Interface_ParamSet (npar);
thenumpar.Init(0);
@@ -189,7 +189,7 @@ Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
const Handle(Standard_Transient)& Interface_FileReaderData::BoundEntity
(const Standard_Integer num) const
// { return theents(num); }
{
{
if (num >= theents.Lower() && num <= theents.Upper()) {
return theents(num);
}
@@ -205,14 +205,14 @@ const Handle(Standard_Transient)& Interface_FileReaderData::BoundEntity
OCC_CATCH_SIGNALS
Handle(Standard_Transient) temp = theents.Value(num);
}
////sln 21.01.2002 OCC133: Exception handling
////sln 21.01.2002 OCC133: Exception handling
// catch (Standard_OutOfRange) {
// cout<<" Catch of sln"<<endl;
// return dummy;
// }
catch (Standard_Failure) {
// some work-around, the best would be to modify CDL to
// return "Handle(Standard_Transient)" not "const Handle(Standard_Transient)&"
static Handle(Standard_Transient) dummy;
@@ -222,7 +222,7 @@ const Handle(Standard_Transient)& Interface_FileReaderData::BoundEntity
}
//cout<<" Normal"<<endl;
if (theents.Value(num).IsImmutable()) cout << "IMMUTABLE:"<<num<<endl;
return theents(num);
return theents(num);
}
*/
@@ -357,34 +357,64 @@ static const Standard_Real vtab[] =
prem = MAXCHIF + 1; point = -1; // ligne[MAXCHIF+1] = '\0'; fin forcee
/* Analyse de la ligne (reputee representer un Flottant) */
for (i = 0; ; i ++) { // critere d arret : cf '\0'
for (i = 0; ; i ++) // critere d arret : cf '\0'
{
const char& car = ligne[i];
/* critere d arret : ne pas l oublier, mais eviter de freiner le traitement
DONC, une fois en fin, plus une fois pour 1er passage
if (car == '\0')
{ if (point < 0) { point = i; jx = point - prem; }; break; } */
if (prem > MAXCHIF) {
if (prem > MAXCHIF)
{
if (car == '0') continue;
if (car == '.') { point = i; continue; }
if (car == '+') continue;
if (car == '-') { moins = 1; continue; }
if (car == '\0')
{ if (point < 0) { point = i; jx = point - prem; }; break; }
if (car < 33) continue;
{
if (point < 0)
{
point = i;
jx = point - prem;
}
break;
}
if (car < 33)
{
continue;
}
prem = i;
if (point >= 0) jx = point - prem + 1;
if (point >= 0)
{
jx = point - prem + 1;
}
}
if (car > 48 && car <= 57)
{ chiffre[j] = car - 48; jj = ++j; continue; } // j++ puis jj = j
{
chiffre[j] = car - 48;
jj = ++j; // j++ puis jj = j
continue;
}
if (car == '0') { chiffre[j] = 0; j ++; continue; }
if (car == '.') { point = i; jx = point - prem; continue; }
if ((car & 94) == 68) { // prend : e E d D
je = i; exp = atoi(&ligne[i+1]); jx += exp;
if (exp < -100 || exp > 100) grexp = 1; break;
if (exp < -100 || exp > 100)
{
grexp = 1;
}
break;
}
if (car == '\0')
{ if (point < 0) { point = i; jx = point - prem; }; break; }
{
if (point < 0)
{
point = i;
jx = point - prem;
}
break;
}
}
/* Interpretation : on decale le Point Decimal selon l Exposant

View File

@@ -21,11 +21,16 @@
#include "../XSMessage/XSMessage_XSTEP_us.pxx"
static int deja = 0;
static int THE_Interface_Static_deja = 0;
void Interface_Static::Standards ()
{
if (deja) return; deja = 1;
if (THE_Interface_Static_deja)
{
return;
}
THE_Interface_Static_deja = 1;
// read precision
//#74 rln 10.03.99 S4135: new values and default value