Kaydet (Commit) 67b4b34c authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1202902 Uncaught CoinError exception

Change-Id: I93488fa942f1975b9c32be6d37fc76ea955a2067
üst 735cd340
...@@ -2217,6 +2217,7 @@ $(call gb_LinkTarget_add_libs,$(1),\ ...@@ -2217,6 +2217,7 @@ $(call gb_LinkTarget_add_libs,$(1),\
endif endif
$(call gb_LinkTarget_set_include,$(1),\ $(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,coinmp)/CoinMP/src \ -I$(call gb_UnpackedTarball_get_dir,coinmp)/CoinMP/src \
-I$(call gb_UnpackedTarball_get_dir,coinmp)/CoinUtils/src \
$$(INCLUDE) \ $$(INCLUDE) \
) )
......
...@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\ ...@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
external/coinmp/android.build.patch.1 \ external/coinmp/android.build.patch.1 \
external/coinmp/no-binaries.patch.1 \ external/coinmp/no-binaries.patch.1 \
external/coinmp/werror-format-security.patch.0 \ external/coinmp/werror-format-security.patch.0 \
external/coinmp/werror-undef.patch.0 \
external/coinmp/windows.build.patch.1 \ external/coinmp/windows.build.patch.1 \
)) ))
......
--- CoinUtils/src/config_coinutils_default.h 2014-06-06 14:28:06.872113540 +0100
+++ CoinUtils/src/config_coinutils_default.h 2014-06-06 14:28:29.400294129 +0100
@@ -26,7 +26,7 @@
all of this inside the guard for MSC_VER >= 1200. If you're reading this
and have been developing in MSVS long enough to know, fix it. -- lh, 100915 --
*/
-#if _MSC_VER >= 1200
+#if defined _MSC_VER && _MSC_VER >= 1200
# include <BaseTsd.h>
# define COIN_INT64_T INT64
# define COIN_UINT64_T UINT64
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <CoinMP.h> #include <CoinMP.h>
#include <CoinError.hpp>
#include "SolverComponent.hxx" #include "SolverComponent.hxx"
#include "solver.hrc" #include "solver.hrc"
...@@ -313,7 +314,15 @@ void SAL_CALL CoinMPSolver::solve() throw(uno::RuntimeException, std::exception) ...@@ -313,7 +314,15 @@ void SAL_CALL CoinMPSolver::solve() throw(uno::RuntimeException, std::exception)
// solve model // solve model
nResult = CoinCheckProblem( hProb ); nResult = CoinCheckProblem( hProb );
nResult = CoinOptimizeProblem( hProb, 0 );
try
{
nResult = CoinOptimizeProblem( hProb, 0 );
}
catch (const CoinError& e)
{
throw std::runtime_error(e.message());
}
mbSuccess = ( nResult == SOLV_CALL_SUCCESS ); mbSuccess = ( nResult == SOLV_CALL_SUCCESS );
if ( mbSuccess ) if ( mbSuccess )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment