]> OCCT Git - occt-copy.git/commitdiff
0023339: The 'strcmp' function returns 0 if corresponding strings are equal. (2)
authorPawel <pawel-kowalski@wp.pl>
Fri, 20 Jul 2012 14:28:44 +0000 (16:28 +0200)
committerPawel Kowalski <pawel-kowalski@wp.pl>
Fri, 27 Jul 2012 11:40:46 +0000 (15:40 +0400)
Checking if the return value from 'strcmp' is '0'.

src/RWStepElement/RWStepElement_RWElementDescriptor.cxx
src/RWStepFEA/RWStepFEA_RWFeaAxis2Placement3d.cxx

index 1ed047bda45cfeba63195e00f9d0ed5c1aea37a1..ce3fb7d272c9f28476962292051ce39a0eed81b0 100755 (executable)
@@ -48,9 +48,9 @@ void RWStepElement_RWElementDescriptor::ReadStep (const Handle(StepData_StepRead
   StepElement_ElementOrder aTopologyOrder;
   if (data->ParamType (num, 1) == Interface_ParamEnum) {
     Standard_CString text = data->ParamCValue(num, 1);
-    if      (strcmp(text, ".LINEAR.")) aTopologyOrder = StepElement_Linear;
-    else if (strcmp(text, ".QUADRATIC.")) aTopologyOrder = StepElement_Quadratic;
-    else if (strcmp(text, ".CUBIC.")) aTopologyOrder = StepElement_Cubic;
+    if      (strcmp(text, ".LINEAR.") == 0) aTopologyOrder = StepElement_Linear;
+    else if (strcmp(text, ".QUADRATIC.") == 0) aTopologyOrder = StepElement_Quadratic;
+    else if (strcmp(text, ".CUBIC.") == 0) aTopologyOrder = StepElement_Cubic;
     else ach->AddFail("Parameter #1 (topology_order) has not allowed value");
   }
   else ach->AddFail("Parameter #1 (topology_order) is not enumeration");
index 74cbda0230db7e7741907202e3cc255ae6a91c92..9a1c6a923de855c62dcbb6bfe3988a1d9ff7a5d4 100755 (executable)
@@ -78,9 +78,9 @@ void RWStepFEA_RWFeaAxis2Placement3d::ReadStep (const Handle(StepData_StepReader
   StepFEA_CoordinateSystemType aSystemType;
   if (data->ParamType (num, 5) == Interface_ParamEnum) {
     Standard_CString text = data->ParamCValue(num, 5);
-    if      (strcmp(text, ".CARTESIAN.")) aSystemType = StepFEA_Cartesian;
-    else if (strcmp(text, ".CYLINDRICAL.")) aSystemType = StepFEA_Cylindrical;
-    else if (strcmp(text, ".SPHERICAL.")) aSystemType = StepFEA_Spherical;
+    if      (strcmp(text, ".CARTESIAN.") == 0) aSystemType = StepFEA_Cartesian;
+    else if (strcmp(text, ".CYLINDRICAL.") == 0) aSystemType = StepFEA_Cylindrical;
+    else if (strcmp(text, ".SPHERICAL.") == 0) aSystemType = StepFEA_Spherical;
     else ach->AddFail("Parameter #5 (system_type) has not allowed value");
   }
   else ach->AddFail("Parameter #5 (system_type) is not enumeration");