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

0024167: Compiler warnings 'unreacheable code' and 'conditional expression is constant' in MOA

Resolved some C4702 (unreachable code) and C4127 (conditional expression is constant).

small corrections in NoSuchObject invoking.

Macros names changing, deadcode deleting, re-writing "for" loops into equivalent "if" structures.

changed condition in "if" block, deadcode deleted.

Small changes in else statement.
This commit is contained in:
aml
2013-10-03 14:07:10 +04:00
committed by bugmaster
parent d9ec7d1d09
commit 3ed30348aa
7 changed files with 46 additions and 28 deletions

View File

@@ -201,7 +201,9 @@ static void Solve(math_FunctionWithDerivative& F,
#define NEWSEQ 1
static const Standard_Integer methode = 1; //-- 1:(Nv Traitement) 3:(Nv + Ancien +check) 2:(Ancien)
#define MATH_FUNCTIONROOTS_NEWCODE // Nv Traitement
//#define MATH_FUNCTIONROOTS_OLDCODE // Ancien
//#define MATH_FUNCTIONROOTS_CHECK // Check
math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
const Standard_Real A,
@@ -224,7 +226,8 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
#endif
Sol.Clear();
NbStateSol.Clear();
if(methode & 1) {
#ifdef MATH_FUNCTIONROOTS_NEWCODE
{
Done = Standard_True;
Standard_Real X0=A;
Standard_Real XN=B;
@@ -492,7 +495,8 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
}
#if NEWSEQ
if(methode==3) {
#ifdef MATH_FUNCTIONROOTS_CHECK
{
StaticSol.Clear();
Standard_Integer n=Sol.Length();
for(Standard_Integer ii=1;ii<=n;ii++) {
@@ -501,9 +505,12 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
Sol.Clear();
NbStateSol.Clear();
}
#endif
#endif
#endif
}
if(methode & 2) {
#ifdef MATH_FUNCTIONROOTS_OLDCODE
{
//-- ********************************************************************************
//-- ANCIEN TRAITEMENT
//-- ********************************************************************************
@@ -977,7 +984,8 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
}
}
#if NEWSEQ
if(methode == 3) {
#ifdef MATH_FUNCTIONROOTS_CHECK
{
Standard_Integer n1=StaticSol.Length();
Standard_Integer n2=Sol.Length();
if(n1!=n2) {
@@ -1003,7 +1011,9 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
}
}
#endif
#endif
}
#endif
}