Windows compilation fixed. 92/17092/2
Cedric Delamarre [Mon, 24 Aug 2015 08:05:35 +0000 (10:05 +0200)]
Change-Id: I3bcd75c6825c83a1ef7093014a16dafa71f3fc99

scilab/modules/core/src/cpp/InitScilab.cpp
scilab/modules/core/src/cpp/runner.cpp

index 15e8fe1..ed8d35b 100644 (file)
@@ -144,7 +144,7 @@ int StartScilabEngine(ScilabEngineInfo* _pSEI)
 
     // ignore -quit if -e or -f are not given
     _pSEI->iForceQuit = _pSEI->iForceQuit && (_pSEI->pstExec || _pSEI->pstFile);
-    ConfigVariable::setForceQuit(_pSEI->iForceQuit);
+    ConfigVariable::setForceQuit(_pSEI->iForceQuit == 1);
 
     /* This bug only occurs under Linux 32 bits
      * See: http://wiki.scilab.org/Scilab_precision
@@ -834,54 +834,54 @@ static void stateShow(Parser::ControlStatus status)
 {
     switch (status)
     {
-            //case Parser::WithinFor:
-            //    SetTemporaryPrompt("-for       ->");
-            //    break;
-            //case Parser::WithinWhile:
-            //    SetTemporaryPrompt("-while     ->");
-            //    break;
-            //case Parser::WithinIf:
-            //    SetTemporaryPrompt("-if        ->");
-            //    break;
-            //case Parser::WithinElse:
-            //    SetTemporaryPrompt("-else      ->");
-            //    break;
-            //case Parser::WithinElseIf:
-            //    SetTemporaryPrompt("-elseif    ->");
-            //    break;
-            //case Parser::WithinTry:
-            //    SetTemporaryPrompt("-try       ->");
-            //    break;
-            //case Parser::WithinCatch:
-            //    SetTemporaryPrompt("-catch     ->");
-            //    break;
-            //case Parser::WithinFunction:
-            //    SetTemporaryPrompt("-function  ->");
-            //    break;
-            //case Parser::WithinSelect:
-            //    SetTemporaryPrompt("-select    ->");
-            //    break;
-            //case Parser::WithinCase:
-            //    SetTemporaryPrompt("-case      ->");
-            //    break;
-            //case Parser::WithinSwitch:
-            //    SetTemporaryPrompt("-switch    ->");
-            //    break;
-            //case Parser::WithinOtherwise:
-            //    SetTemporaryPrompt("-otherwise ->");
-            //    break;
-            //case Parser::WithinMatrix:
-            //    SetTemporaryPrompt("- [        ->");
-            //    break;
-            //case Parser::WithinCell:
-            //    SetTemporaryPrompt("- {        ->");
-            //    break;
-            //case Parser::WithinBlockComment:
-            //    SetTemporaryPrompt("- /*       ->");
-            //    break;
-            //case Parser::WithinDots:
-            //    SetTemporaryPrompt("- ...      ->");
-            //    break;
+        //case Parser::WithinFor:
+        //    SetTemporaryPrompt("-for       ->");
+        //    break;
+        //case Parser::WithinWhile:
+        //    SetTemporaryPrompt("-while     ->");
+        //    break;
+        //case Parser::WithinIf:
+        //    SetTemporaryPrompt("-if        ->");
+        //    break;
+        //case Parser::WithinElse:
+        //    SetTemporaryPrompt("-else      ->");
+        //    break;
+        //case Parser::WithinElseIf:
+        //    SetTemporaryPrompt("-elseif    ->");
+        //    break;
+        //case Parser::WithinTry:
+        //    SetTemporaryPrompt("-try       ->");
+        //    break;
+        //case Parser::WithinCatch:
+        //    SetTemporaryPrompt("-catch     ->");
+        //    break;
+        //case Parser::WithinFunction:
+        //    SetTemporaryPrompt("-function  ->");
+        //    break;
+        //case Parser::WithinSelect:
+        //    SetTemporaryPrompt("-select    ->");
+        //    break;
+        //case Parser::WithinCase:
+        //    SetTemporaryPrompt("-case      ->");
+        //    break;
+        //case Parser::WithinSwitch:
+        //    SetTemporaryPrompt("-switch    ->");
+        //    break;
+        //case Parser::WithinOtherwise:
+        //    SetTemporaryPrompt("-otherwise ->");
+        //    break;
+        //case Parser::WithinMatrix:
+        //    SetTemporaryPrompt("- [        ->");
+        //    break;
+        //case Parser::WithinCell:
+        //    SetTemporaryPrompt("- {        ->");
+        //    break;
+        //case Parser::WithinBlockComment:
+        //    SetTemporaryPrompt("- /*       ->");
+        //    break;
+        //case Parser::WithinDots:
+        //    SetTemporaryPrompt("- ...      ->");
+        //    break;
         default :
             SetTemporaryPrompt("  > ");
             break;
index eabfb2a..0124401 100644 (file)
@@ -105,15 +105,15 @@ void StaticRunner::setRunner(Runner* _RunMe)
 
 Runner* StaticRunner::getRunner(void)
 {
-    Runner* tmp = m_RunMe;
-    m_RunMe = NULL;
+    Runner* tmp = m_RunMe.exchange(nullptr);
     ThreadManagement::SendAvailableRunnerSignal();
     return tmp;
 }
 
+// return true if a Runner is already set in m_RunMe.
 bool StaticRunner::isRunnerAvailable(void)
 {
-    return m_RunMe != NULL;
+    return m_RunMe.load() != nullptr;
 }
 
 void StaticRunner::setInterruptibleCommand(bool _bInterruptibleCommand)