From: Pawel Date: Thu, 12 Jul 2012 08:17:38 +0000 (+0200) Subject: 0023264: cppcheck warning: Logical conjunction always evaluates to false X-Git-Tag: V6_5_4_beta1~117 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=76021966ce433317ffee7964d113cf033e88e2b6;p=occt-copy.git 0023264: cppcheck warning: Logical conjunction always evaluates to false Replaced the '&&' operator with '||'. Otherwise the logical conjunction always evaluates to false. --- diff --git a/src/Visual3d/Visual3d_Light.cxx b/src/Visual3d/Visual3d_Light.cxx index c2f4b0470e..549ceaa8d5 100755 --- a/src/Visual3d/Visual3d_Light.cxx +++ b/src/Visual3d/Visual3d_Light.cxx @@ -140,11 +140,11 @@ MyType (Visual3d_TOLS_POSITIONAL) { Visual3d_LightDefinitionError::Raise ("Bad value for LightAttenuation"); - if ( (Fact1 < 0.0) && (Fact1 > 1.0) ) + if ( (Fact1 < 0.0) || (Fact1 > 1.0) ) Visual3d_LightDefinitionError::Raise ("Bad value for LightAttenuation"); - if ( (Fact2 < 0.0) && (Fact2 > 1.0) ) + if ( (Fact2 < 0.0) || (Fact2 > 1.0) ) Visual3d_LightDefinitionError::Raise ("Bad value for LightAttenuation"); @@ -186,11 +186,11 @@ MyType (Visual3d_TOLS_SPOT) { Visual3d_LightDefinitionError::Raise ("Bad value for LightAttenuation"); - if ( (Fact1 < 0.0) && (Fact1 > 1.0) ) + if ( (Fact1 < 0.0) || (Fact1 > 1.0) ) Visual3d_LightDefinitionError::Raise ("Bad value for LightAttenuation"); - if ( (Fact2 < 0.0) && (Fact2 > 1.0) ) + if ( (Fact2 < 0.0) || (Fact2 > 1.0) ) Visual3d_LightDefinitionError::Raise ("Bad value for LightAttenuation"); @@ -378,7 +378,7 @@ void Visual3d_Light::SetAngle (const Standard_Real AngleCone) { void Visual3d_Light::SetAttenuation1 (const Standard_Real Fact1) { - if ( (Fact1 < 0.0) && (Fact1 > 1.0) ) + if ( (Fact1 < 0.0) || (Fact1 > 1.0) ) Visual3d_LightDefinitionError::Raise ("Bad value for LightAttenuation"); @@ -399,7 +399,7 @@ void Visual3d_Light::SetAttenuation1 (const Standard_Real Fact1) { void Visual3d_Light::SetAttenuation2 (const Standard_Real Fact2) { - if ( (Fact2 < 0.0) && (Fact2 > 1.0) ) + if ( (Fact2 < 0.0) || (Fact2 > 1.0) ) Visual3d_LightDefinitionError::Raise ("Bad value for LightAttenuation");