From: isk Date: Tue, 15 Sep 2015 13:36:50 +0000 (+0300) Subject: 0026690: Problem of compilation on imac monoblock X-Git-Tag: V7_0_0_beta~271 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=a5565a3cb580c6828c30c5cdd2dac4d340793ef6 0026690: Problem of compilation on imac monoblock --- diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index be00157302..a00bac1496 100644 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -155,6 +155,30 @@ Standard_Integer ViewerTest::ParseColor (Standard_Integer theArgNb, return 0; } +//======================================================================= +//function : ParseOnOff +//purpose : +//======================================================================= +Standard_Boolean ViewerTest::ParseOnOff (Standard_CString theArg, + Standard_Boolean& theIsOn) +{ + TCollection_AsciiString aFlag(theArg); + aFlag.LowerCase(); + if (aFlag == "on" + || aFlag == "1") + { + theIsOn = Standard_True; + return Standard_True; + } + else if (aFlag == "off" + || aFlag == "0") + { + theIsOn = Standard_False; + return Standard_True; + } + return Standard_False; +} + //======================================================================= //function : GetTypeNames //purpose : diff --git a/src/ViewerTest/ViewerTest.hxx b/src/ViewerTest/ViewerTest.hxx index 09c0cec4a8..266e68a252 100644 --- a/src/ViewerTest/ViewerTest.hxx +++ b/src/ViewerTest/ViewerTest.hxx @@ -187,6 +187,10 @@ public: TCollection_AsciiString& theName, TCollection_AsciiString& theValue); + //! Parses boolean argument. + //! Handles either flag specified by 0|1 or on|off. + Standard_EXPORT static Standard_Boolean ParseOnOff (Standard_CString theArg, + Standard_Boolean& theIsOn); private: //! Returns a window class that implements standard behavior of diff --git a/src/ViewerTest/ViewerTest_ObjectCommands.cxx b/src/ViewerTest/ViewerTest_ObjectCommands.cxx index 023dad3f37..3365ef2ed1 100644 --- a/src/ViewerTest/ViewerTest_ObjectCommands.cxx +++ b/src/ViewerTest/ViewerTest_ObjectCommands.cxx @@ -149,8 +149,6 @@ extern Standard_Boolean VDisplayAISObject (const TCollection_AsciiString& theNam Standard_Boolean theReplaceIfExists = Standard_True); extern int ViewerMainLoop(Standard_Integer argc, const char** argv); extern Handle(AIS_InteractiveContext)& TheAISContext(); -extern Standard_Boolean parseOnOff (Standard_CString theArg, - Standard_Boolean& theIsOn); //============================================================================== @@ -5469,7 +5467,7 @@ static int TextToBRep (Draw_Interpretor& /*theDI*/, return 1; } - parseOnOff (theArgVec[anArgIt], anIsCompositeCurve); + ViewerTest::ParseOnOff (theArgVec[anArgIt], anIsCompositeCurve); } else if (aParam == "-plane") { diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index e513e785ab..f0fa0ecc7e 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -95,26 +95,6 @@ #include #endif -inline Standard_Boolean parseOnOff (Standard_CString theArg, - Standard_Boolean& theIsOn) -{ - TCollection_AsciiString aFlag (theArg); - aFlag.LowerCase(); - if (aFlag == "on" - || aFlag == "1") - { - theIsOn = Standard_True; - return Standard_True; - } - else if (aFlag == "off" - || aFlag == "0") - { - theIsOn = Standard_False; - return Standard_True; - } - return Standard_False; -} - // Auxiliary definitions static const char THE_KEY_DELETE = 127; @@ -5193,7 +5173,7 @@ static int VGlDebug (Draw_Interpretor& theDI, { Standard_Boolean toShowWarns = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toShowWarns)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toShowWarns)) { --anArgIter; } @@ -5209,7 +5189,7 @@ static int VGlDebug (Draw_Interpretor& theDI, { Standard_Boolean toShow = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toShow)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toShow)) { --anArgIter; } @@ -5225,7 +5205,7 @@ static int VGlDebug (Draw_Interpretor& theDI, { Standard_Boolean toSuppress = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toSuppress)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toSuppress)) { --anArgIter; } @@ -5239,7 +5219,7 @@ static int VGlDebug (Draw_Interpretor& theDI, { Standard_Boolean toSync = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toSync)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toSync)) { --anArgIter; } @@ -5252,13 +5232,13 @@ static int VGlDebug (Draw_Interpretor& theDI, else if (anArgCase == "-debug") { if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnableDebug)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnableDebug)) { --anArgIter; } aDefCaps->contextDebug = toEnableDebug; } - else if (parseOnOff (anArg, toEnableDebug) + else if (ViewerTest::ParseOnOff (anArg, toEnableDebug) && (anArgIter + 1 == theArgNb)) { // simple alias to turn on almost everything @@ -5363,7 +5343,7 @@ static int VCaps (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -5373,7 +5353,7 @@ static int VCaps (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -5383,7 +5363,7 @@ static int VCaps (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -5394,7 +5374,7 @@ static int VCaps (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -5404,7 +5384,7 @@ static int VCaps (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -5415,7 +5395,7 @@ static int VCaps (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -5428,7 +5408,7 @@ static int VCaps (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -5443,7 +5423,7 @@ static int VCaps (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -5458,7 +5438,7 @@ static int VCaps (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -7418,7 +7398,7 @@ static int VStereo (Draw_Interpretor& theDI, { Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -7429,7 +7409,7 @@ static int VStereo (Draw_Interpretor& theDI, { Standard_Boolean toDisable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toDisable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toDisable)) { --anArgIter; } @@ -8305,7 +8285,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI, Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -8322,7 +8302,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI, Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -8338,7 +8318,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI, Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -8354,7 +8334,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI, Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -8370,7 +8350,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI, Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -8391,7 +8371,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI, Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; } @@ -8407,7 +8387,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI, Standard_Boolean toEnable = Standard_True; if (++anArgIter < theArgNb - && !parseOnOff (theArgVec[anArgIter], toEnable)) + && !ViewerTest::ParseOnOff (theArgVec[anArgIter], toEnable)) { --anArgIter; }