aboutsummaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2018-04-16 15:07:51 +0800
committerYuri Victorovich <yuri@FreeBSD.org>2018-04-16 15:07:51 +0800
commit5532e65810d8bafa5f1da832834bff6f68b94298 (patch)
treed822bd847ae4824e35e567e2b062d638e874a659 /math
parentdae8bcc7670e8a13e77b12ccd0d988e9a96e5fde (diff)
downloadfreebsd-ports-gnome-5532e65810d8bafa5f1da832834bff6f68b94298.tar.gz
freebsd-ports-gnome-5532e65810d8bafa5f1da832834bff6f68b94298.tar.zst
freebsd-ports-gnome-5532e65810d8bafa5f1da832834bff6f68b94298.zip
math/clp: Unbreak on 12
Added patches to prevent breakage due to reinterpret_cast<SomeType*>(NULL). See the upstream bug report: https://github.com/coin-or/Clp/issues/7 Approved by: portmgr (port compliance, infrastructure)
Diffstat (limited to 'math')
-rw-r--r--math/clp/files/patch-Clp_src_AbcSimplex.cpp66
-rw-r--r--math/clp/files/patch-Clp_src_ClpModel.cpp11
-rw-r--r--math/clp/files/patch-Clp_src_OsiClp_OsiClpSolverInterface.cpp11
-rw-r--r--math/clp/files/patch-Osi_test_OsiTestSolverInterfaceIO.cpp16
4 files changed, 104 insertions, 0 deletions
diff --git a/math/clp/files/patch-Clp_src_AbcSimplex.cpp b/math/clp/files/patch-Clp_src_AbcSimplex.cpp
new file mode 100644
index 000000000000..de53da5fb29f
--- /dev/null
+++ b/math/clp/files/patch-Clp_src_AbcSimplex.cpp
@@ -0,0 +1,66 @@
+--- Clp/src/AbcSimplex.cpp.orig 2018-04-16 06:55:57 UTC
++++ Clp/src/AbcSimplex.cpp
+@@ -368,19 +368,19 @@ AbcSimplex::gutsOfInitialize(int numberR
+ // say Steepest pricing
+ abcDualRowPivot_ = new AbcDualRowSteepest();
+ abcPrimalColumnPivot_ = new AbcPrimalColumnSteepest();
+- internalStatus_ = newArray(reinterpret_cast<unsigned char *>(NULL),
++ internalStatus_ = newArray(nullptr,
+ sizeArray+maximumNumberTotal_);
+- abcLower_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- abcUpper_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- abcCost_ = newArray(reinterpret_cast<double *>(NULL),sizeArray+maximumNumberTotal_);
+- abcDj_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- abcSolution_ = newArray(reinterpret_cast<double *>(NULL),sizeArray+maximumNumberTotal_);
+- //fromExternal_ = newArray(reinterpret_cast<int *>(NULL),sizeArray);
+- //toExternal_ = newArray(reinterpret_cast<int *>(NULL),sizeArray);
+- scaleFromExternal_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- offset_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- abcPerturbation_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- abcPivotVariable_ = newArray(reinterpret_cast<int *>(NULL),maximumAbcNumberRows_);
++ abcLower_ = newArray(nullptr,sizeArray);
++ abcUpper_ = newArray(nullptr,sizeArray);
++ abcCost_ = newArray(nullptr,sizeArray+maximumNumberTotal_);
++ abcDj_ = newArray(nullptr,sizeArray);
++ abcSolution_ = newArray(nullptr,sizeArray+maximumNumberTotal_);
++ //fromExternal_ = newArray(nullptr,sizeArray);
++ //toExternal_ = newArray(nullptr,sizeArray);
++ scaleFromExternal_ = newArray(nullptr,sizeArray);
++ offset_ = newArray(nullptr,sizeArray);
++ abcPerturbation_ = newArray(nullptr,sizeArray);
++ abcPivotVariable_ = newArray(nullptr,maximumAbcNumberRows_);
+ // Fill perturbation array
+ setupPointers(maximumAbcNumberRows_,maximumAbcNumberColumns_);
+ fillPerturbation(0,maximumNumberTotal_);
+@@ -554,19 +554,19 @@ AbcSimplex::createSubProblem(int numberC
+ subProblem->maximumNumberTotal_= maximumAbcNumberRows_+numberColumns;
+ subProblem->numberTotalWithoutFixed_= subProblem->numberTotal_;
+ int sizeArray=2*subProblem->maximumNumberTotal_+maximumAbcNumberRows_;
+- subProblem->internalStatus_ = newArray(reinterpret_cast<unsigned char *>(NULL),
++ subProblem->internalStatus_ = newArray(nullptr,
+ sizeArray+subProblem->maximumNumberTotal_);
+- subProblem->abcLower_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- subProblem->abcUpper_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- subProblem->abcCost_ = newArray(reinterpret_cast<double *>(NULL),sizeArray+subProblem->maximumNumberTotal_);
+- subProblem->abcDj_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- subProblem->abcSolution_ = newArray(reinterpret_cast<double *>(NULL),sizeArray+subProblem->maximumNumberTotal_);
+- //fromExternal_ = newArray(reinterpret_cast<int *>(NULL),sizeArray);
+- //toExternal_ = newArray(reinterpret_cast<int *>(NULL),sizeArray);
+- subProblem->scaleFromExternal_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- subProblem->offset_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- subProblem->abcPerturbation_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+- subProblem->abcPivotVariable_ = newArray(reinterpret_cast<int *>(NULL),maximumAbcNumberRows_);
++ subProblem->abcLower_ = newArray(nullptr,sizeArray);
++ subProblem->abcUpper_ = newArray(nullptr,sizeArray);
++ subProblem->abcCost_ = newArray(nullptr,sizeArray+subProblem->maximumNumberTotal_);
++ subProblem->abcDj_ = newArray(nullptr,sizeArray);
++ subProblem->abcSolution_ = newArray(nullptr,sizeArray+subProblem->maximumNumberTotal_);
++ //fromExternal_ = newArray(nullptr,sizeArray);
++ //toExternal_ = newArray(nullptr,sizeArray);
++ subProblem->scaleFromExternal_ = newArray(nullptr,sizeArray);
++ subProblem->offset_ = newArray(nullptr,sizeArray);
++ subProblem->abcPerturbation_ = newArray(nullptr,sizeArray);
++ subProblem->abcPivotVariable_ = newArray(nullptr,maximumAbcNumberRows_);
+ subProblem->setupPointers(maximumAbcNumberRows_,numberColumns);
+ // could use arrays - but for now be safe
+ int * backward = new int [numberFullColumns+numberRows_];
diff --git a/math/clp/files/patch-Clp_src_ClpModel.cpp b/math/clp/files/patch-Clp_src_ClpModel.cpp
new file mode 100644
index 000000000000..f7a63ab11f6a
--- /dev/null
+++ b/math/clp/files/patch-Clp_src_ClpModel.cpp
@@ -0,0 +1,11 @@
+--- Clp/src/ClpModel.cpp.orig 2018-04-16 06:43:28 UTC
++++ Clp/src/ClpModel.cpp
+@@ -3845,7 +3845,7 @@ ClpModel::writeMps(const char *filename,
+ writer.setMpsData(*(matrix_->getPackedMatrix()), COIN_DBL_MAX,
+ getColLower(), getColUpper(),
+ objective,
+- reinterpret_cast<const char*> (NULL) /*integrality*/,
++ nullptr /*integrality*/,
+ getRowLower(), getRowUpper(),
+ columnNames, rowNames);
+ // Pass in array saying if each variable integer
diff --git a/math/clp/files/patch-Clp_src_OsiClp_OsiClpSolverInterface.cpp b/math/clp/files/patch-Clp_src_OsiClp_OsiClpSolverInterface.cpp
new file mode 100644
index 000000000000..32f57ef9b046
--- /dev/null
+++ b/math/clp/files/patch-Clp_src_OsiClp_OsiClpSolverInterface.cpp
@@ -0,0 +1,11 @@
+--- Clp/src/OsiClp/OsiClpSolverInterface.cpp.orig 2018-04-16 06:57:00 UTC
++++ Clp/src/OsiClp/OsiClpSolverInterface.cpp
+@@ -1448,7 +1448,7 @@ OsiClpSolverInterface::setupForRepeatedU
+ if (stopPrinting) {
+ CoinMessages * messagesPointer = modelPtr_->messagesPointer();
+ // won't even build messages
+- messagesPointer->setDetailMessages(100,10000,reinterpret_cast<int *> (NULL));
++ messagesPointer->setDetailMessages(100,10000,nullptr);
+ }
+ #endif
+ }
diff --git a/math/clp/files/patch-Osi_test_OsiTestSolverInterfaceIO.cpp b/math/clp/files/patch-Osi_test_OsiTestSolverInterfaceIO.cpp
new file mode 100644
index 000000000000..2a921f8eb236
--- /dev/null
+++ b/math/clp/files/patch-Osi_test_OsiTestSolverInterfaceIO.cpp
@@ -0,0 +1,16 @@
+--- Osi/test/OsiTestSolverInterfaceIO.cpp.orig 2018-04-16 06:54:20 UTC
++++ Osi/test/OsiTestSolverInterfaceIO.cpp
+@@ -422,10 +422,10 @@ OsiTestSolverInterface::writeMps(const c
+ writer.setMpsData(*getMatrixByCol(), getInfinity(),
+ getColLower(), getColUpper(),
+ getObjCoefficients(),
+- reinterpret_cast<const char *> (NULL) /*integrality*/,
++ nullptr /*integrality*/,
+ getRowLower(), getRowUpper(),
+- reinterpret_cast<const char **> (NULL) /*colnam*/,
+- reinterpret_cast<const char **> (NULL) /*rownam*/);
++ nullptr /*colnam*/,
++ nullptr /*rownam*/);
+ std::string fname = filename;
+ if (extension)
+ { if (extension[0] != '\0' && extension[0] != '.')