Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2018 07:07:52 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r467459 - head/math/clp/files
Message-ID:  <201804160707.w3G77qgH016617@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Mon Apr 16 07:07:51 2018
New Revision: 467459
URL: https://svnweb.freebsd.org/changeset/ports/467459

Log:
  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)

Added:
  head/math/clp/files/
  head/math/clp/files/patch-Clp_src_AbcSimplex.cpp   (contents, props changed)
  head/math/clp/files/patch-Clp_src_ClpModel.cpp   (contents, props changed)
  head/math/clp/files/patch-Clp_src_OsiClp_OsiClpSolverInterface.cpp   (contents, props changed)
  head/math/clp/files/patch-Osi_test_OsiTestSolverInterfaceIO.cpp   (contents, props changed)

Added: head/math/clp/files/patch-Clp_src_AbcSimplex.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/clp/files/patch-Clp_src_AbcSimplex.cpp	Mon Apr 16 07:07:51 2018	(r467459)
@@ -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_];

Added: head/math/clp/files/patch-Clp_src_ClpModel.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/clp/files/patch-Clp_src_ClpModel.cpp	Mon Apr 16 07:07:51 2018	(r467459)
@@ -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

Added: head/math/clp/files/patch-Clp_src_OsiClp_OsiClpSolverInterface.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/clp/files/patch-Clp_src_OsiClp_OsiClpSolverInterface.cpp	Mon Apr 16 07:07:51 2018	(r467459)
@@ -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
+ }

Added: head/math/clp/files/patch-Osi_test_OsiTestSolverInterfaceIO.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/clp/files/patch-Osi_test_OsiTestSolverInterfaceIO.cpp	Mon Apr 16 07:07:51 2018	(r467459)
@@ -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] != '.')



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804160707.w3G77qgH016617>