Hello community, here is the log from the commit of package ocaml-mccs for openSUSE:Factory checked in at 2019-11-11 21:26:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocaml-mccs (Old) and /work/SRC/openSUSE:Factory/.ocaml-mccs.new.2990 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-mccs" Mon Nov 11 21:26:16 2019 rev:5 rq:746704 version:1.1+10 Changes: -------- --- /work/SRC/openSUSE:Factory/ocaml-mccs/ocaml-mccs.changes 2019-10-24 23:01:54.736015293 +0200 +++ /work/SRC/openSUSE:Factory/.ocaml-mccs.new.2990/ocaml-mccs.changes 2019-11-11 21:26:18.215933707 +0100 @@ -1,0 +2,7 @@ +Fri Nov 1 12:34:56 UTC 2019 - [email protected] + +- Require current dune macros +- Update to version 1.1+10: + * No changelog provided. + +------------------------------------------------------------------- Old: ---- ocaml-mccs-1.1+9.tar.xz New: ---- ocaml-mccs-1.1+10.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-mccs.spec ++++++ --- /var/tmp/diff_new_pack.OJiLfK/_old 2019-11-11 21:26:19.627934993 +0100 +++ /var/tmp/diff_new_pack.OJiLfK/_new 2019-11-11 21:26:19.651935015 +0100 @@ -13,12 +13,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: ocaml-mccs -Version: 1.1+9 +Version: 1.1+10 Release: 0 %{?ocaml_preserve_bytecode} Summary: Stripped-down version of mccs with OCaml bindings @@ -28,9 +28,9 @@ Source: %{name}-%{version}.tar.xz BuildRequires: gcc-c++ BuildRequires: ocaml -BuildRequires: ocaml-cudf-devel BuildRequires: ocaml-dune -BuildRequires: ocaml-rpm-macros >= 20190930 +BuildRequires: ocaml-rpm-macros >= 20191101 +BuildRequires: ocamlfind(cudf) %description mccs (which stands for Multi Criteria CUDF Solver) is a CUDF problem solver @@ -48,6 +48,7 @@ %autosetup -p1 %build +dune_release_pkgs='mccs' %ocaml_dune_setup %ocaml_dune_build @@ -58,13 +59,8 @@ %check %ocaml_dune_test -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - %files -f %{name}.files %doc README.md -%license LICENCE %files devel -f %{name}.files.devel ++++++ _service ++++++ --- /var/tmp/diff_new_pack.OJiLfK/_old 2019-11-11 21:26:19.763935117 +0100 +++ /var/tmp/diff_new_pack.OJiLfK/_new 2019-11-11 21:26:19.763935117 +0100 @@ -1,6 +1,7 @@ <services> <service mode="disabled" name="tar_scm"> - <param name="revision">1.1+9</param> + <!-- 1.1+10 --> + <param name="revision">d8d36a6903aedc29e7c7d2dbbc93081e46ce782f</param> <param name="scm">git</param> <param name="url">https://github.com/AltGr/ocaml-mccs.git</param> <param name="versionformat">@PARENT_TAG@</param> ++++++ ocaml-mccs-1.1+9.tar.xz -> ocaml-mccs-1.1+10.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/.travis.yml new/ocaml-mccs-1.1+10/.travis.yml --- old/ocaml-mccs-1.1+9/.travis.yml 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/.travis.yml 2019-09-10 12:16:25.000000000 +0200 @@ -1,9 +1,14 @@ sudo: required language: c +dist: bionic install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh before_install: - $TRAVIS_BUILD_DIR/.travis-ci.sh script: bash -ex .travis-opam.sh +env: + global: + - FORK_USER=dra27 + - FORK_BRANCH=fix-bubblewrap matrix: include: - os: osx @@ -16,6 +21,10 @@ env: OCAML_VERSION=4.05 - os: osx env: OCAML_VERSION=4.06 + - os: osx + env: OCAML_VERSION=4.07 + - os: osx + env: OCAML_VERSION=4.08 - os: linux env: OCAML_VERSION=4.02 MCCS_BACKENDS="GLPK CBC CLP SYMPHONY" MCCS_LPSOLVER=/usr/share/mccs/cbclp - os: linux @@ -26,6 +35,12 @@ env: OCAML_VERSION=4.05 MCCS_BACKENDS="GLPK CBC CLP SYMPHONY" MCCS_LPSOLVER=/usr/share/mccs/cbclp - os: linux env: OCAML_VERSION=4.06 MCCS_BACKENDS="GLPK CBC CLP SYMPHONY" MCCS_LPSOLVER=/usr/share/mccs/cbclp + - os: linux + env: OCAML_VERSION=4.07 MCCS_BACKENDS="GLPK CBC CLP SYMPHONY" MCCS_LPSOLVER=/usr/share/mccs/cbclp + - os: linux + env: OCAML_VERSION=4.08 MCCS_BACKENDS="GLPK CBC CLP SYMPHONY" MCCS_LPSOLVER=/usr/share/mccs/cbclp + - os: linux + env: OCAML_VERSION=4.08 OPAM_SWITCH=ocaml-variants.4.08.0+force-safe-string MCCS_BACKENDS="GLPK CBC CLP SYMPHONY" MCCS_LPSOLVER=/usr/share/mccs/cbclp addons: apt: update: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/README.md new/ocaml-mccs-1.1+10/README.md --- old/ocaml-mccs-1.1+9/README.md 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/README.md 2019-09-10 12:16:25.000000000 +0200 @@ -5,7 +5,7 @@ This repository contains a stripped-down version of the [mccs solver](http://www.i3s.unice.fr/~cpjm/misc/mccs.html), taken from snapshot -1.1, with a binding as an OCaml library, and building with `jbuilder`. The +1.1, with a binding as an OCaml library, and building with `dune`. The [GLPK](https://www.gnu.org/software/glpk/glpk.html) source it links against is also included within src/glpk, at version 4.63 (unmodified, apart from many removed modules, corresponding to the parts that we don't use). @@ -20,9 +20,9 @@ `CBC`, `SYMPHONY`. Note that, apart from `GLPK`, you will need the corresponding libraries installed, the backends will be dynamically linked, and these are experimental may not work as expected. Additionally, the compilation of the -included GLPK version can be disabled by removing `src/glpk/jbuild`, and -replaced by dynamic/static linking by renaming one of the `jbuild-shared` and -`jbuild-static` files. +included GLPK version can be disabled by removing `src/glpk/dune`, and +replaced by dynamic/static linking by renaming one of the `dune-shared` and +`dune-static` files. NOTE: the lib takes criteria as a string, in the format accepted by mccs (see `mccs -h`), assuming `-lexagregate[CRITERIA]`. There are two important diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/appveyor/extlib-1.7.4.patch new/ocaml-mccs-1.1+10/appveyor/extlib-1.7.4.patch --- old/ocaml-mccs-1.1+9/appveyor/extlib-1.7.4.patch 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/appveyor/extlib-1.7.4.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,66 +0,0 @@ -From be8754d742eb0f0b23511d21c5f0fb6fd452356b Mon Sep 17 00:00:00 2001 -From: David Allsopp <[email protected]> -Date: Thu, 15 Mar 2018 16:28:12 +0000 -Subject: [PATCH 1/2] Restore compilation on 32-bit - ---- - CHANGES | 3 +++ - src/IO.ml | 24 ++++++++++++++++++------ - 2 files changed, 21 insertions(+), 6 deletions(-) - -diff --git a/CHANGES b/CHANGES -index 98c143a..cd3c1d2 100644 ---- a/CHANGES -+++ b/CHANGES -@@ -1,3 +1,6 @@ -+Next (????-??-??) -+ * IO: restore compilation on 32-bit (broken in 1.7.3) -+ - 1.7.4 (2018-03-12) - * fix tests with OCaml 4.06 - -diff --git a/src/IO.ml b/src/IO.ml -index 5dc6262..caf7412 100644 ---- a/src/IO.ml -+++ b/src/IO.ml -@@ -573,9 +573,15 @@ let write_i31 ch n = - if n < -0x4000_0000 || n > 0x3FFF_FFFF then raise (Overflow "write_i31"); - write_32 ch n - --let write_i32 ch n = -- if n < -0x8000_0000 || n > 0x7FFF_FFFF then raise (Overflow "write_i32"); -- write_32 ch n -+let write_i32 = -+ let f l ch n = -+ if n < l || n > 0x7FFF_FFFF then raise (Overflow "write_i32"); -+ write_32 ch n -+ in -+ if Sys.word_size = 32 then -+ fun ch -> f min_int ch -+ else -+ fun ch -> f (Nativeint.to_int (-0x8000_0000n)) ch - - let write_real_i32 ch n = - let base = Int32.to_int n in -@@ -677,9 +683,15 @@ let write_i31 ch n = - if n < -0x4000_0000 || n > 0x3FFF_FFFF then raise (Overflow "write_i31"); - write_32 ch n - --let write_i32 ch n = -- if n < -0x8000_0000 || n > 0x7FFF_FFFF then raise (Overflow "write_i32"); -- write_32 ch n -+let write_i32 = -+ let f l ch n = -+ if n < l || n > 0x7FFF_FFFF then raise (Overflow "write_i32"); -+ write_32 ch n -+ in -+ if Sys.word_size = 32 then -+ fun ch -> f min_int ch -+ else -+ fun ch -> f (Nativeint.to_int (-0x8000_0000n)) ch - - let write_real_i32 ch n = - let base = Int32.to_int n in --- -2.14.1 - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/appveyor.sh new/ocaml-mccs-1.1+10/appveyor.sh --- old/ocaml-mccs-1.1+9/appveyor.sh 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/appveyor.sh 2019-09-10 12:16:25.000000000 +0200 @@ -54,19 +54,19 @@ cp tools/msvs-promote-path $ROOT_CYG/ cd .. FLEXDLL_VER=0.37 - CPPO_VER=1.6.4 + CPPO_VER=1.6.6 FINDLIB_VER=1.8.0 - DUNE_VER=1.0-beta20 - OCAMLBUILD_VER=0.12.0 + DUNE_VER=1.10.0 + OCAMLBUILD_VER=0.14.0 # NB CUDF URL will also need updating CUDF_VER=0.9 - EXTLIB_VER=1.7.4 + EXTLIB_VER=1.7.6 CBC_VER=2.9.9 appveyor DownloadFile "https://bintray.com/coin-or/download/download_file?file_path=Cbc-$CBC_VER-win32-msvc14.zip" -FileName Cbc-$CBC_VER-win32-msvc14.zip appveyor DownloadFile "https://github.com/alainfrisch/flexdll/releases/download/$FLEXDLL_VER/flexdll-bin-$FLEXDLL_VER.zip" -FileName flexdll-bin-$FLEXDLL_VER.zip appveyor DownloadFile "https://github.com/mjambon/cppo/archive/v$CPPO_VER.tar.gz" -FileName cppo-$CPPO_VER.tar.gz appveyor DownloadFile "http://download.camlcity.org/download/findlib-$FINDLIB_VER.tar.gz" -FileName findlib-$FINDLIB_VER.tar.gz - appveyor DownloadFile "https://github.com/ocaml/dune/archive/${DUNE_VER/-/+}.tar.gz" -FileName dune-$DUNE_VER.tar.gz + appveyor DownloadFile "https://github.com/ocaml/dune/archive/$DUNE_VER.tar.gz" -FileName dune-$DUNE_VER.tar.gz appveyor DownloadFile "https://github.com/ocaml/ocamlbuild/archive/$OCAMLBUILD_VER.tar.gz" -FileName ocamlbuild-$OCAMLBUILD_VER.tar.gz appveyor DownloadFile "https://gforge.inria.fr/frs/download.php/file/36602/cudf-0.9.tar.gz" -FileName cudf-$CUDF_VER.tar.gz appveyor DownloadFile "https://github.com/ygrek/ocaml-extlib/releases/download/$EXTLIB_VER/extlib-$EXTLIB_VER.tar.gz" -FileName extlib-$EXTLIB_VER.tar.gz @@ -138,10 +138,6 @@ patch -p1 -i ../../../cudf-0.9.patch cd .. tar -xzf $APPVEYOR_BUILD_FOLDER/../src/extlib-$EXTLIB_VER.tar.gz - cd extlib-$EXTLIB_VER - # Fixed upstream but not yet released - patch -p1 -i ../../../extlib-1.7.4.patch - cd .. cd ocaml LOG_FILE=OCaml-$OCAML_VERSION-$PORT.log @@ -163,14 +159,14 @@ cd ../findlib-$FINDLIB_VER quietly_log "./configure && make all opt && make install" cd ../dune-$DUNE_VER - quietly_log "ocaml bootstrap.ml && ./boot.exe && cp _build/default/bin/main.exe $PREFIX/bin/jbuilder.exe" + quietly_log "ocaml bootstrap.ml && ./boot.exe --release && cp _boot/install/default/bin/dune.exe $PREFIX/bin/dune.exe" if [[ $OCAML_BRANCH -ge 403 ]] ; then cd ../ocamlbuild-$OCAMLBUILD_VER quietly_log "make -f configure.make all OCAMLBUILD_PREFIX=$ROOT OCAMLBUILD_BINDIR=$ROOT/bin OCAMLBUILD_LIBDIR=$(ocamlfind printconf path | cygpath -f - -m) OCAML_NATIVE=true OCAML_NATIVE_TOOLS=false && make all findlib-install" rm $PREFIX/bin/ocamlbuild.{byte,native}.exe fi cd ../cppo-$CPPO_VER - quietly_log "jbuilder build @install -p cppo && cp _build/install/default/bin/cppo.exe $PREFIX/bin/" + quietly_log "dune build @install -p cppo && cp _build/install/default/bin/cppo.exe $PREFIX/bin/" cd ../extlib-$EXTLIB_VER quietly_log "make minimal=1 build install" cd ../cudf-$CUDF_VER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/appveyor.yml new/ocaml-mccs-1.1+10/appveyor.yml --- old/ocaml-mccs-1.1+9/appveyor.yml 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/appveyor.yml 2019-09-10 12:16:25.000000000 +0200 @@ -11,13 +11,13 @@ CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ CYG_CACHE: C:/cygwin/var/cache/setup matrix: - - OCAML_VERSION: 4.06.1 + - OCAML_VERSION: 4.07.1 PORT: mingw - - OCAML_VERSION: 4.06.1 + - OCAML_VERSION: 4.07.1 PORT: mingw64 - - OCAML_VERSION: 4.06.1 + - OCAML_VERSION: 4.07.1 PORT: msvc - - OCAML_VERSION: 4.06.1 + - OCAML_VERSION: 4.07.1 PORT: msvc64 cache: @@ -27,12 +27,12 @@ - call "%APPVEYOR_BUILD_FOLDER%\appveyor.cmd" build_script: - - jbuilder build - - jbuilder build test/cbclp.exe + - dune build + - dune build test/cbclp.exe test_script: - - jbuilder build @settests --auto-promote || ver>nul - - jbuilder runtest + - dune build @settests --auto-promote || ver>nul + - dune runtest # Uncomment this to enable Remote Desktop on the build worker at the end of the # build. The worker is available for the remainder of the allocated hour. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/dune-project new/ocaml-mccs-1.1+10/dune-project --- old/ocaml-mccs-1.1+9/dune-project 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-mccs-1.1+10/dune-project 2019-09-10 12:16:25.000000000 +0200 @@ -0,0 +1,2 @@ +(lang dune 1.0) +(name mccs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/mccs.opam new/ocaml-mccs-1.1+10/mccs.opam --- old/ocaml-mccs-1.1+9/mccs.opam 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/mccs.opam 2019-09-10 12:16:25.000000000 +0200 @@ -1,5 +1,5 @@ -opam-version: "1.2" -version: "1.1+9" +opam-version: "2.0" +version: "1.1+11" maintainer: "Louis Gesbert <[email protected]>" authors: [ "Claude Michel <[email protected]>" @@ -8,13 +8,16 @@ homepage: "http://www.i3s.unice.fr/~cpjm/misc/" bug-reports: "https://github.com/AltGr/ocaml-mccs/issues" license: "LGPL-2.1 with OCaml linking exception, BSD-3-clause, GPL-3.0" -dev-repo: "https://github.com/AltGr/ocaml-mccs.git" -build: ["jbuilder" "build" "-p" name] -build-test: [ - ["sh" "-c" "jbuilder build @settests --auto-promote || true"] - ["jbuilder" "runtest"] +dev-repo: "git+https://github.com/AltGr/ocaml-mccs.git" +build: [ + ["dune" "build" "-p" name] + ["sh" "-c" "dune build @settests --auto-promote || true"] {with-test} + ["dune" "runtest"] {with-test} ] depends: [ - "jbuilder" {build} + "ocaml" + "dune" {>= "1.0"} "cudf" {>= "0.7"} ] +synopsis: "MCCS (which stands for Multi Criteria CUDF Solver) is a CUDF problem solver +developed at UNS during the European MANCOOSI project" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/abstract_solver.h new/ocaml-mccs-1.1+10/src/abstract_solver.h --- old/ocaml-mccs-1.1+9/src/abstract_solver.h 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/abstract_solver.h 2019-09-10 12:16:25.000000000 +0200 @@ -84,7 +84,7 @@ // ****************************************************************** // write the internal representation of the problem to a file - // virtual int writelp(char *filename) { return 0; }; + // virtual int writelp(const char *filename) { return 0; }; // ****************************************************************** // solve the problem (must return a value > 0 if a solution has been found, 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/context_flags.ml new/ocaml-mccs-1.1+10/src/context_flags.ml --- old/ocaml-mccs-1.1+9/src/context_flags.ml 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/context_flags.ml 2019-09-10 12:16:25.000000000 +0200 @@ -25,7 +25,7 @@ let cxxflags = let flags = (ifc (Config.system = "macosx") ["-x"; "c++"]) @ - (ifc (Sys.win32 && Config.ccomp_type = "msvc") ["/EHsc"]) @ + (ifc (Sys.win32 && Config.ccomp_type = "msvc") ["\"/EHsc\""]) @ (ifc useGLPK ["-DUSEGLPK"]) @ (ifc useCOIN ["-DUSECOIN"]) @ (ifc useCLP ["-DUSECLP"]) @ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/count_criteria.h new/ocaml-mccs-1.1+10/src/count_criteria.h --- old/ocaml-mccs-1.1+9/src/count_criteria.h 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/count_criteria.h 2019-09-10 12:16:25.000000000 +0200 @@ -22,7 +22,7 @@ CUDFproblem *problem; // a pointer to the problem abstract_solver *solver; // a pointer to the solver - char *property_name; // name of the property + const char *property_name; // name of the property bool has_property; // is the property available ? // list of all versioned packages which have the property CUDFVersionedPackageList *versioned_pkg_with_property; @@ -61,13 +61,13 @@ Count_scope scope; // Criteria initialization - count_criteria(char *property_name) { + count_criteria(const char *property_name) { this->property_name = property_name; this->lambda_crit = +1; }; // Criteria initialization - count_criteria(char *property_name, Count_scope scope, CUDFcoefficient lambda_crit) { + count_criteria(const char *property_name, Count_scope scope, CUDFcoefficient lambda_crit) { this->property_name = property_name; this->lambda_crit = lambda_crit; this->scope = scope; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/cudf.h new/ocaml-mccs-1.1+10/src/cudf.h --- old/ocaml-mccs-1.1+9/src/cudf.h 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/cudf.h 2019-09-10 12:16:25.000000000 +0200 @@ -74,9 +74,9 @@ // A package i.e. either a versioned package or a virtual package class CUDFPackage { public: - char *name; // package name as provided by the CUDF problem file - int rank; // rank of the package, i.e., column number in a simplex matrix or variable id - char *versioned_name; // internal name of the package + const char *name; // package name as provided by the CUDF problem file + int rank; // rank of the package, i.e., column number in a simplex matrix or variable id + const char *versioned_name; // internal name of the package bool in_reduced; @@ -163,11 +163,11 @@ typedef CUDFVirtualPackageList::iterator CUDFVirtualPackageListIterator; // type of an enums and its iterator type -typedef vector<char *> CUDFEnums; -typedef vector<char *>::iterator CUDFEnumsIterator; +typedef vector<const char *> CUDFEnums; +typedef vector<const char *>::iterator CUDFEnumsIterator; // get enum "estr" from "e" enum list -extern char *get_enum(CUDFEnums *e, char *estr); +extern const char *get_enum(CUDFEnums *e, const char *estr); // a property mapping type and its iterator type @@ -188,13 +188,13 @@ public: CUDFProperty *property; // type of the property value int intval; // use to store property value when its basic type is an int - char *strval; // use to store property value when its basic type is a string + const char *strval; // use to store property value when its basic type is a string CUDFVpkg *vpkg; // use to store property value when its basic type is a vpkg CUDFVpkgList *vpkglist; // use to store property value when its basic type is a vpkglist CUDFVpkgFormula *vpkgformula; // use to store property value when its basic type is a vpkgformula CUDFPropertyValue(CUDFProperty *the_property, int the_value); // constructor for int valued properties - CUDFPropertyValue(CUDFProperty *the_property, char *the_value); // constructor for string valued properties + CUDFPropertyValue(CUDFProperty *the_property, const char *the_value); // constructor for string valued properties CUDFPropertyValue(CUDFProperty *the_property, CUDFVpkg *the_value); // constructor for vpkg valued properties CUDFPropertyValue(CUDFProperty *the_property, CUDFVpkgList *the_value); // constructor for vpkglist valued properties CUDFPropertyValue(CUDFProperty *the_property, CUDFVpkgFormula *the_value); // constructor for vpkgformula valued properties @@ -205,7 +205,7 @@ // Class to describe user defined properties class CUDFProperty { public: - char *name; // property name + const char *name; // property name CUDFPropertyType type_id; // property type CUDFEnums *enuml; // allowed enum values for enum type properties @@ -214,14 +214,14 @@ CUDFPropertyValue *default_value; // default property value - CUDFProperty(char *tname, CUDFPropertyType ttype); // CUDF property constructors (without and with default value) - CUDFProperty(char *tname, CUDFPropertyType ttype, int tdefault); - CUDFProperty(char *tname, CUDFPropertyType ttype, char *tdefault); - CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFEnums *tenum); - CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFEnums *tenum, char *tident); - CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFVpkg *tdefault); - CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFVpkgList *tdefault); - CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFVpkgFormula *tdefault); + CUDFProperty(const char *tname, CUDFPropertyType ttype); // CUDF property constructors (without and with default value) + CUDFProperty(const char *tname, CUDFPropertyType ttype, int tdefault); + CUDFProperty(const char *tname, CUDFPropertyType ttype, const char *tdefault); + CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFEnums *tenum); + CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFEnums *tenum, const char *tident); + CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFVpkg *tdefault); + CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFVpkgList *tdefault); + CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFVpkgFormula *tdefault); ~CUDFProperty(); @@ -275,7 +275,7 @@ extern int parse_cudf(FILE *input_file); /* // parse the CUDF problem from a string */ -extern int parse_cudf_string(char *str); +extern int parse_cudf_string(const char *str); // operations to compare a package version to another one extern bool op_none_comp(CUDFVersion v1, CUDFVersion v2); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/cudf_tools.cpp new/ocaml-mccs-1.1+10/src/cudf_tools.cpp --- old/ocaml-mccs-1.1+9/src/cudf_tools.cpp 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/cudf_tools.cpp 2019-09-10 12:16:25.000000000 +0200 @@ -20,9 +20,9 @@ CUDFVpkg *vpkg_false = new CUDFVpkg((CUDFVirtualPackage *)NULL, op_none, 0); CUDFPackage::~CUDFPackage() { - free(name); + free((char *)name); if (versioned_name != NULL && versioned_name != name) - free(versioned_name); + free((char *)versioned_name); } // Versioned package constructor @@ -30,11 +30,10 @@ CUDFVersionedPackage::CUDFVersionedPackage(const char *pkg_name, int my_rank) { // Get some piece of memory to store package name - if ((name = (char *)malloc(strlen(pkg_name)+1)) == NULL) { + if (!(name = strdup(pkg_name))) { PRINT_ERR("error: cannot alloc name for CUDFVersionedPackage.\n"); exit(-1); } - strcpy(name, pkg_name); // Default initialization of variables versioned_name = (char *)NULL; @@ -83,11 +82,11 @@ static char temp[50]; sprintf(temp, "%" CUDFint64"u", pkg_version); - if ((versioned_name = (char *)malloc(strlen(name)+strlen(temp)+2)) == NULL) { + if ((versioned_name = (const char *)malloc(strlen(name)+strlen(temp)+2)) == NULL) { PRINT_ERR("error: cannot alloc versioned_name for CUDFVersionedPackage.\n"); exit(-1); } - sprintf(versioned_name, "%s_%s", name, temp); + sprintf((char *)versioned_name, "%s_%s", name, temp); version = pkg_version; } @@ -95,11 +94,10 @@ // Virtual package constructor // requires virtual package name and virtual package rank CUDFVirtualPackage::CUDFVirtualPackage(const char *pkg_name, int my_rank) { - if ((name = (char *)malloc(strlen(pkg_name)+1)) == NULL) { + if (!(name = strdup(pkg_name))) { PRINT_ERR("error: cannot alloc name for CUDFVirtualPackage.\n"); exit(-1); } - strcpy(name, pkg_name); versioned_name = name; highest_installed = (CUDFVersionedPackage *)NULL; @@ -117,14 +115,11 @@ // User property constructor // requires property name and type of the property -CUDFProperty::CUDFProperty(char *tname, CUDFPropertyType ttype) { - int lgth = strlen(tname); - - if ((name = (char *)malloc(lgth+1)) == NULL) { +CUDFProperty::CUDFProperty(const char *tname, CUDFPropertyType ttype) { + if (!(name = strdup(tname))) { PRINT_ERR("error: cannot alloc name for property %s.\n", tname); exit(-1); } - strcpy(name, tname); type_id = ttype; required = true; @@ -135,14 +130,11 @@ // User property constructor // requires property name, type of the property (must be an int subtype) and int default value -CUDFProperty::CUDFProperty(char *tname, CUDFPropertyType ttype, int tdefault) { - int lgth = strlen(tname); - - if ((name = (char *)malloc(lgth+1)) == NULL) { +CUDFProperty::CUDFProperty(const char *tname, CUDFPropertyType ttype, int tdefault) { + if (!(name = strdup(tname))) { PRINT_ERR("error: cannot alloc name for property %s.\n", tname); exit(-1); } - strcpy(name, tname); type_id = ttype; required = false; @@ -167,10 +159,10 @@ } CUDFProperty::~CUDFProperty() { - free(name); + free((char *)name); if (type_id == pt_enum) { - for (vector<char*>::iterator it = enuml->begin(); it != enuml->end(); it++) - free(*it); + for (vector<const char*>::iterator it = enuml->begin(); it != enuml->end(); it++) + free((char*)*it); delete enuml; } delete default_value; @@ -178,14 +170,11 @@ // User property constructor // requires property name, type of the property (must be a string subtype) and string default value -CUDFProperty::CUDFProperty(char *tname, CUDFPropertyType ttype, char *tdefault) { - int lgth = strlen(tname); - - if ((name = (char *)malloc(lgth+1)) == NULL) { +CUDFProperty::CUDFProperty(const char *tname, CUDFPropertyType ttype, const char *tdefault) { + if (!(name = strdup(tname))) { PRINT_ERR("error: cannot alloc name for property %s.\n", tname); exit(-1); } - strcpy(name, tname); type_id = ttype; required = false; @@ -194,14 +183,11 @@ // User property constructor // requires property name, type of the property (must be a enum type) and enum default value -CUDFProperty::CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFEnums *tenum) { - int lgth = strlen(tname); - - if ((name = (char *)malloc(lgth+1)) == NULL) { +CUDFProperty::CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFEnums *tenum) { + if (!(name = strdup(tname))) { PRINT_ERR("error: cannot alloc name for property %s.\n", tname); exit(-1); } - strcpy(name, tname); type_id = ttype; required = true; @@ -213,22 +199,19 @@ // User property constructor // requires property name, type of the property (must be a enum type), the list of allowed enum values and enum default value -CUDFProperty::CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFEnums *tenum, char *tident) { - int lgth = strlen(tname); - - if ((name = (char *)malloc(lgth+1)) == NULL) { +CUDFProperty::CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFEnums *tenum, const char *tident) { + if (!(name = strdup(tname))) { PRINT_ERR("error: cannot alloc name for property %s.\n", tname); exit(-1); } - strcpy(name, tname); type_id = ttype; required = true; enuml = tenum; - char *defval = get_enum(tenum, tident); - if (defval == (char *)NULL) { + const char *defval = get_enum(tenum, tident); + if (defval == NULL) { PRINT_ERR("CUDF error: property %s default value can not be %s.\n", tname, tident); exit(-1); } else @@ -238,14 +221,11 @@ // User property constructor // requires property name, type of the property (must be a vpkg type) and vpkg default value -CUDFProperty::CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFVpkg *tdefault) { - int lgth = strlen(tname); - - if ((name = (char *)malloc(lgth+1)) == NULL) { +CUDFProperty::CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFVpkg *tdefault) { + if (!(name = strdup(tname))) { PRINT_ERR("error: cannot alloc name for property %s.\n", tname); exit(-1); } - strcpy(name, tname); type_id = ttype; required = false; @@ -255,14 +235,11 @@ // User property constructor // requires property name, type of the property (must be a vpkglist type) and vpkglist default value -CUDFProperty::CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFVpkgList *tdefault) { - int lgth = strlen(tname); - - if ((name = (char *)malloc(lgth+1)) == NULL) { +CUDFProperty::CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFVpkgList *tdefault) { + if (!(name = strdup(tname))) { PRINT_ERR("error: cannot alloc name for property %s.\n", tname); exit(-1); } - strcpy(name, tname); type_id = ttype; required = false; @@ -272,14 +249,11 @@ // User property constructor // requires property name, type of the property (must be a vpkgformula type) and vpkgformula default value -CUDFProperty::CUDFProperty(char *tname, CUDFPropertyType ttype, CUDFVpkgFormula *tdefault) { - int lgth = strlen(tname); - - if ((name = (char *)malloc(lgth+1)) == NULL) { +CUDFProperty::CUDFProperty(const char *tname, CUDFPropertyType ttype, CUDFVpkgFormula *tdefault) { + if (!(name = strdup(tname))) { PRINT_ERR("error: cannot alloc name for property %s.\n", tname); exit(-1); } - strcpy(name, tname); type_id = ttype; required = false; @@ -296,7 +270,7 @@ // User property value constructor // requires a pointer to the user property (must be a string subtype) and its string value -CUDFPropertyValue::CUDFPropertyValue(CUDFProperty *the_property, char *the_value) { +CUDFPropertyValue::CUDFPropertyValue(CUDFProperty *the_property, const char *the_value) { char *the_nvalue = (char *)malloc(strlen(the_value)+1); property = the_property; @@ -327,7 +301,7 @@ CUDFPropertyValue::~CUDFPropertyValue() { switch (property->type_id) { - case pt_string: free(strval); break; + case pt_string: free((char *)strval); break; case pt_vpkg: case pt_veqpkg: delete vpkg; break; case pt_vpkglist: case pt_veqpkglist: delete vpkglist; break; case pt_vpkgformula: delete vpkgformula; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/dune new/ocaml-mccs-1.1+10/src/dune --- old/ocaml-mccs-1.1+9/src/dune 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-mccs-1.1+10/src/dune 2019-09-10 12:16:25.000000000 +0200 @@ -0,0 +1,40 @@ +(library + (name mccs) + (cxx_names changed_criteria constraint_generation count_criteria + cudf_reductions cudf_tools glpk_solver lp_solver lexagregate_combiner + new_criteria notuptodate_criteria removed_criteria mccscudf mccs_stubs) + (public_name mccs) + (modules :standard \ context_flags) + (cxx_flags + :standard + -I + . + (:include cxxflags.sexp)) + (c_library_flags + :standard + (:include clibs.sexp)) + (library_flags + :standard + (:include flags.sexp)) + (wrapped false) + (libraries + cudf + (select + config.h + from + (mccs.glpk.internal -> config_internal.h) + (mccs.glpk.shared -> config_external.h) + (mccs.glpk.static -> config_external.h) + (-> _)))) + +(rule + (with-stdout-to config_internal.h (echo "#include \"glpk/glpk.h\""))) + +(rule + (with-stdout-to config_external.h (echo "#include <glpk.h>"))) + +(rule + (targets cxxflags.sexp clibs.sexp flags.sexp) + (deps context_flags.ml (universe)) + (action + (run ocaml %{deps}))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/glpk/dune new/ocaml-mccs-1.1+10/src/glpk/dune --- old/ocaml-mccs-1.1+9/src/glpk/dune 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-mccs-1.1+10/src/glpk/dune 2019-09-10 12:16:25.000000000 +0200 @@ -0,0 +1,116 @@ +(library + (name mccs_glpk) + (public_name mccs.glpk.internal) + (modules ocaml_mccs_glpk) + (c_names ; Core GLPK + bfd + glpapi06 + glpapi09 + glpapi10 + glpapi12 + glpapi13 + glpios01 + glpios02 + glpios03 + glpios07 + glpios09 + glpios10 + glpios11 + glpios12 + glpnpp01 + glpnpp02 + glpnpp03 + glpnpp04 + glpnpp05 + glpscl + ; api + advbas + cpxbas + prob1 + prob2 + prob4 + prob5 + ; bflib + btf + btfint + fhv + fhvint + fvs + ifu + luf + lufint + scf + scfint + sgf + sva + ; cglib + cfg + cfg1 + cfg2 + clqcut + gmicut + gmigen + mirgen + spv + ; env + alloc + dlsup + env + error + stdc + stdout + time + tls + ; misc + avl + dmp + gcd + jd + mc13d + mc21a + rng + rng1 + round2n + triang + wclique + wclique1 + ; proxy + proxy + proxy1 + ; simplex + spxat + spxchuzc + spxchuzr + spxlp + spxnt + spxprim + spxprob + spychuzc + spychuzr + spydual) + (c_flags + :standard + (:include cflags.sexp)) + (wrapped false)) + +(copy_files# api/*.{c,h}) + +(copy_files# bflib/*.{c,h}) + +(copy_files# cglib/*.{c,h}) + +(copy_files# env/*.{c,h}) + +(copy_files# misc/*.{c,h}) + +(copy_files# proxy/*.{c,h}) + +(copy_files# simplex/*.{c,h}) + +(rule + (targets cflags.sexp) + (deps context_flags.ml) + (action + (with-stdout-to + %{targets} + (run ocaml %{deps} cflags)))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/glpk/dune-shared new/ocaml-mccs-1.1+10/src/glpk/dune-shared --- old/ocaml-mccs-1.1+9/src/glpk/dune-shared 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-mccs-1.1+10/src/glpk/dune-shared 2019-09-10 12:16:25.000000000 +0200 @@ -0,0 +1,16 @@ +(library + (name mccs_hostglpk_shared) + (public_name mccs.glpk.shared) + (modules ocaml_mccs_glpk) + (c_library_flags + :standard + (:include clibs.sexp)) + (wrapped false)) + +(rule + (targets clibs.sexp) + (deps context_flags.ml) + (action + (with-stdout-to + %{targets} + (run ocaml %{deps} clibs)))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/glpk/dune-static new/ocaml-mccs-1.1+10/src/glpk/dune-static --- old/ocaml-mccs-1.1+9/src/glpk/dune-static 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-mccs-1.1+10/src/glpk/dune-static 2019-09-10 12:16:25.000000000 +0200 @@ -0,0 +1,16 @@ +(library + (name mccs_hostglpk_static) + (public_name mccs.glpk.static) + (modules ocaml_mccs_glpk) + (c_library_flags + :standard + (:include clibs.sexp)) + (wrapped false)) + +(rule + (targets clibs.sexp) + (deps context_flags.ml) + (action + (with-stdout-to + %{targets} + (run ocaml %{deps} clibs static)))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/glpk/jbuild new/ocaml-mccs-1.1+10/src/glpk/jbuild --- old/ocaml-mccs-1.1+9/src/glpk/jbuild 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/glpk/jbuild 1970-01-01 01:00:00.000000000 +0100 @@ -1,41 +0,0 @@ -(jbuild_version 1) - -(library - ((name mccs_glpk) - (public_name mccs.glpk.internal) - (modules (ocaml_mccs_glpk)) - (c_names (; Core GLPK - bfd - glpapi06 glpapi09 glpapi10 glpapi12 glpapi13 - glpios01 glpios02 glpios03 glpios07 glpios09 glpios10 glpios11 glpios12 - glpnpp01 glpnpp02 glpnpp03 glpnpp04 glpnpp05 - glpscl - ; api - advbas cpxbas prob1 prob2 prob4 prob5 - ; bflib - btf btfint fhv fhvint fvs ifu luf lufint scf scfint sgf sva - ; cglib - cfg cfg1 cfg2 clqcut gmicut gmigen mirgen spv - ; env - alloc dlsup env error stdc stdout time tls - ; misc - avl dmp gcd jd mc13d mc21a rng rng1 round2n triang wclique wclique1 - ; proxy - proxy proxy1 - ; simplex - spxat spxchuzc spxchuzr spxlp spxnt spxprim spxprob spychuzc spychuzr spydual)) - (c_flags (:standard (:include cflags.sexp))) - (wrapped false))) - -(copy_files# api/*.{c,h}) -(copy_files# bflib/*.{c,h}) -(copy_files# cglib/*.{c,h}) -(copy_files# env/*.{c,h}) -(copy_files# misc/*.{c,h}) -(copy_files# proxy/*.{c,h}) -(copy_files# simplex/*.{c,h}) - -(rule - ((targets (cflags.sexp)) - (deps (context_flags.ml)) - (action (with-stdout-to ${@} (run ocaml ${^} cflags))))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/glpk/jbuild-shared new/ocaml-mccs-1.1+10/src/glpk/jbuild-shared --- old/ocaml-mccs-1.1+9/src/glpk/jbuild-shared 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/glpk/jbuild-shared 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -(jbuild_version 1) - -(library - ((name mccs_hostglpk_shared) - (public_name mccs.glpk.shared) - (modules (ocaml_mccs_glpk)) - (c_library_flags (:standard (:include clibs.sexp))) - (wrapped false))) - -(rule - ((targets (clibs.sexp)) - (deps (context_flags.ml)) - (action (with-stdout-to ${@} (run ocaml ${^} clibs))))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/glpk/jbuild-static new/ocaml-mccs-1.1+10/src/glpk/jbuild-static --- old/ocaml-mccs-1.1+9/src/glpk/jbuild-static 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/glpk/jbuild-static 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -(jbuild_version 1) - -(library - ((name mccs_hostglpk_static) - (public_name mccs.glpk.static) - (modules (ocaml_mccs_glpk)) - (c_library_flags (:standard (:include clibs.sexp))) - (wrapped false))) - -(rule - ((targets (clibs.sexp)) - (deps (context_flags.ml)) - (action (with-stdout-to ${@} (run ocaml ${^} clibs static))))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/glpk_solver.cpp new/ocaml-mccs-1.1+10/src/glpk_solver.cpp --- old/ocaml-mccs-1.1+9/src/glpk_solver.cpp 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/glpk_solver.cpp 2019-09-10 12:16:25.000000000 +0200 @@ -59,7 +59,7 @@ } // write the problem into a file -// int glpk_solver::writelp(char *filename) { glp_write_lp(lp, NULL, filename); return 0; } +// int glpk_solver::writelp(const char *filename) { glp_write_lp(lp, NULL, filename); return 0; } void glpk_solver::abort(void) { this->aborted = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/glpk_solver.h new/ocaml-mccs-1.1+10/src/glpk_solver.h --- old/ocaml-mccs-1.1+9/src/glpk_solver.h 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/glpk_solver.h 2019-09-10 12:16:25.000000000 +0200 @@ -12,7 +12,7 @@ #include <abstract_solver.h> #include <scoeff_solver.h> -#include <glpk.h> +#include "config.h" class glpk_solver: public abstract_solver, public scoeff_solver<double, 1, 1> { public: @@ -25,7 +25,7 @@ int set_intvar_range(int rank, CUDFcoefficient lower, CUDFcoefficient upper); // Write the lp on a file - // int writelp(char *filename); + // int writelp(const char *filename); // Solve the problem int solve(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/jbuild new/ocaml-mccs-1.1+10/src/jbuild --- old/ocaml-mccs-1.1+9/src/jbuild 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/jbuild 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -(jbuild_version 1) - -(library - ((name mccs) - (cxx_names (changed_criteria - constraint_generation - count_criteria - cudf_reductions - cudf_tools - glpk_solver - lp_solver - lexagregate_combiner - new_criteria - notuptodate_criteria - removed_criteria - mccscudf - mccs_stubs)) - (public_name mccs) - (modules (:standard \ context_flags)) - (cxx_flags (:standard -I . (:include cxxflags.sexp))) - (c_library_flags (:standard (:include clibs.sexp))) - (library_flags (:standard (:include flags.sexp))) - (wrapped false) - (libraries (cudf (select _ from (mccs.glpk.internal -> _) (mccs.glpk.shared -> _) (mccs.glpk.static -> _) (-> _)) -)))) - -(copy_files# glpk/glpk.h) - -(rule - ((targets (cxxflags.sexp clibs.sexp flags.sexp)) - (deps (context_flags.ml (universe))) - (action (run ocaml ${^})))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/lp_solver.cpp new/ocaml-mccs-1.1+10/src/lp_solver.cpp --- old/ocaml-mccs-1.1+9/src/lp_solver.cpp 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/lp_solver.cpp 2019-09-10 12:16:25.000000000 +0200 @@ -27,7 +27,7 @@ static unsigned long uid = 0; // external function for solver creation -abstract_solver *new_lp_solver(char *lpsolver) { return new lp_solver(lpsolver); } +abstract_solver *new_lp_solver(const char *lpsolver) { return new lp_solver(lpsolver); } // solver initialisation int lp_solver::init_solver(CUDFVersionedPackageList *all_versioned_packages, int other_vars) { @@ -85,7 +85,7 @@ } // write the problem into a file -int lp_solver::writelp(char *filename) { return 0; } +int lp_solver::writelp(const char *filename) { return 0; } // solve the current problem int lp_solver::solve() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/lp_solver.h new/ocaml-mccs-1.1+10/src/lp_solver.h --- old/ocaml-mccs-1.1+9/src/lp_solver.h 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/lp_solver.h 2019-09-10 12:16:25.000000000 +0200 @@ -18,7 +18,7 @@ // Solver initialization int init_solver(CUDFVersionedPackageList *all_versioned_packages, int other_vars); // Write the lp on a file - int writelp(char *filename); + int writelp(const char *filename); // Solve the problem int solve(); @@ -92,12 +92,12 @@ char lpoutfilename[256]; FILE *lpfile, *ctlpfile; - char *lpsolver; // name of the solver to call + const char *lpsolver; // name of the solver to call char mult; // solver creation - lp_solver(char *lpsolver) { + lp_solver(const char *lpsolver) { this->lpsolver = lpsolver; nb_packages = 0; all_versioned_packages = (CUDFVersionedPackageList *)NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/mccs_stubs.cpp new/ocaml-mccs-1.1+10/src/mccs_stubs.cpp --- old/ocaml-mccs-1.1+9/src/mccs_stubs.cpp 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/mccs_stubs.cpp 2019-09-10 12:16:25.000000000 +0200 @@ -148,7 +148,7 @@ CUDFVpkg * ml2c_vpkg(Virtual_packages * tbl, value ml_vpkg) { - char * name = String_val(Field(ml_vpkg, 0)); + const char * name = String_val(Field(ml_vpkg, 0)); CUDFVirtualPackage * virt = tbl->get(name); value constr_opt = Field(ml_vpkg, 1); if (constr_opt == Val_none) return new CUDFVpkg(virt, op_none, 0); @@ -161,14 +161,16 @@ value c2ml_vpkg(CUDFVpkg * vpkg) { CAMLparam0 (); - CAMLlocal2(ml_name, ml_cstr); + CAMLlocal4(ml_name, ml_cstr, ml_p, ml_s); ml_name = caml_copy_string(vpkg->virtual_package->name); if (vpkg->op == op_none) - CAMLreturn(Val_pair(ml_name, Val_none)); + ml_p = Val_pair(ml_name, Val_none); else { ml_cstr = Val_pair(c2ml_relop(vpkg->op), Val_int(vpkg->version)); - CAMLreturn(Val_pair(ml_name, Val_some(ml_cstr))); + ml_s = Val_some(ml_cstr); + ml_p = Val_pair(ml_name, ml_s); } + CAMLreturn(ml_p); } CUDFVpkgList * ml2c_vpkglist(Virtual_packages * tbl, value ml_vpkglist) @@ -217,7 +219,7 @@ CUDFPropertyValue * ml2c_property(Virtual_packages * tbl, CUDFProperties * properties, value ml_prop) { - char * prop_name = String_val(Field(ml_prop,0)); + const char * prop_name = String_val(Field(ml_prop,0)); CUDFPropertiesIterator prop_it; CUDFProperty * prop; value ml_v = Field(ml_prop,1); @@ -302,7 +304,7 @@ CUDFVersionedPackage * ml2c_package(Virtual_packages * tbl, CUDFProperties * properties, int &max_rank, value ml_package) { - char * package = String_val(Field(ml_package, 0)); + const char * package = String_val(Field(ml_package, 0)); unsigned int version = Int_val(Field(ml_package, 1)); bool installed = Bool_val(Field(ml_package, 5)); @@ -371,7 +373,7 @@ CUDFProperty * ml2c_propertydef(Virtual_packages * tbl, value ml_pdef) { - char * property_name = String_val(Field(ml_pdef,0)); + const char * property_name = String_val(Field(ml_pdef,0)); value def = Field(ml_pdef,1); CUDFPropertyType ty = ml2c_propertytype(Field(def,0)); value arg = Field(def,1); @@ -388,7 +390,7 @@ p = new CUDFProperty(property_name, ty, String_val(Some_val(arg))); break; case pt_enum: { CUDFEnums * enuml = new CUDFEnums; - char * dft; + const char * dft; for (value l = Field(arg, 0); l != Val_emptylist; l = Field(l, 1)) enuml->push_back(String_val(Field(l,0))); if (Field(arg, 1) == Val_none) @@ -452,10 +454,10 @@ } // get an enum from its name in an enum list -char *get_enum(CUDFEnums *e, char *estr) { +const char *get_enum(CUDFEnums *e, const char *estr) { for (CUDFEnumsIterator ei = e->begin(); ei != e->end(); ei++) if (strcmp((*ei), estr) == 0) return (*ei); - return (char *)NULL; + return (const char *)NULL; } typedef struct { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/mccscudf.cpp new/ocaml-mccs-1.1+10/src/mccscudf.cpp --- old/ocaml-mccs-1.1+9/src/mccscudf.cpp 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/mccscudf.cpp 2019-09-10 12:16:25.000000000 +0200 @@ -18,7 +18,7 @@ // underlying solver declaration // allows using solvers withour having to include the whole solver classes -extern abstract_solver *new_lp_solver(char *lpsolver); +extern abstract_solver *new_lp_solver(const char *lpsolver); /* extern abstract_solver *new_pblib_solver(char *pbsolver); */ //extern abstract_solver *new_ampl_solver(char *amplsolver); #ifdef USECPLEX diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/mccscudf.h new/ocaml-mccs-1.1+10/src/mccscudf.h --- old/ocaml-mccs-1.1+9/src/mccscudf.h 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/mccscudf.h 2019-09-10 12:16:25.000000000 +0200 @@ -6,7 +6,7 @@ typedef struct { Solver_backend backend; - char * lp_solver; + const char * lp_solver; } Solver; typedef struct { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/src/osi_solver.h new/ocaml-mccs-1.1+10/src/osi_solver.h --- old/ocaml-mccs-1.1+9/src/osi_solver.h 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/src/osi_solver.h 2019-09-10 12:16:25.000000000 +0200 @@ -36,7 +36,7 @@ int set_intvar_range(int rank, CUDFcoefficient lower, CUDFcoefficient upper); // Write the lp on a file - // int writelp(char *filename); + // int writelp(const char *filename); // Solve the problem int solve(); @@ -223,7 +223,7 @@ } // write the problem into a file -// int osi_solver<OsiSolver>::writelp(char *filename) { glp_write_lp(lp, NULL, filename); return 0; } +// int osi_solver<OsiSolver>::writelp(const char *filename) { glp_write_lp(lp, NULL, filename); return 0; } template<class OsiSolver> void osi_solver<OsiSolver>::abort(void) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/test/dune new/ocaml-mccs-1.1+10/test/dune --- old/ocaml-mccs-1.1+9/test/dune 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-mccs-1.1+10/test/dune 2019-09-10 12:16:25.000000000 +0200 @@ -0,0 +1,24 @@ +(executable + (name mccs_test) + (modules mccs_test) + (libraries mccs)) + +(executable + (name cbclp) + (modules cbclp) + (libraries unix)) + +(include dune.inc) + +(rule + (targets dune.inc.gen) + (deps gen_tests.ml (universe)) + (action + (with-stdout-to + %{targets} + (run ocaml gen_tests.ml)))) + +(alias + (name settests) + (action + (diff dune.inc dune.inc.gen))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/test/dune.inc new/ocaml-mccs-1.1+10/test/dune.inc --- old/ocaml-mccs-1.1+9/test/dune.inc 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-mccs-1.1+10/test/dune.inc 2019-09-10 12:16:25.000000000 +0200 @@ -0,0 +1,16 @@ +; This file is generated using `MCCS_BACKENDS=jbuilder build @settests --auto-promote` + +(rule + (with-stdout-to + test-glpk.result + (run %{exe:mccs_test.exe} %{dep:test.cudf}))) + +(rule + (with-stdout-to + test.glpk.reference + (cat %{dep:test.output}))) + +(alias + (name runtest) + (action + (system "diff %{dep:test-glpk.result} %{dep:test.glpk.reference}"))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/test/gen_tests.ml new/ocaml-mccs-1.1+10/test/gen_tests.ml --- old/ocaml-mccs-1.1+9/test/gen_tests.ml 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/test/gen_tests.ml 2019-09-10 12:16:25.000000000 +0200 @@ -30,26 +30,26 @@ | None -> Printf.printf " (rule - (with-stdout-to test-%s.result (run ${exe:mccs_test.exe} ${path:test.cudf}%s))) + (with-stdout-to test-%s.result (run %%{exe:mccs_test.exe} %%{dep:test.cudf}%s))) (rule - (with-stdout-to test.%s.reference (cat ${path:test%s.output})))" name solver name ref + (with-stdout-to test.%s.reference (cat %%{dep:test%s.output})))" name solver name ref | Some ignore -> Printf.printf " (rule - (with-stdout-to test-%s.raw (run ${exe:mccs_test.exe} ${path:test.cudf}%s))) + (with-stdout-to test-%s.raw (run %%{exe:mccs_test.exe} %%{dep:test.cudf}%s))) (rule - (with-stdout-to test-%s.result (system \"grep -v %s ${path:test-%s.raw}\"))) + (with-stdout-to test-%s.result (system \"grep -v %s %%{dep:test-%s.raw}\"))) (rule - (with-stdout-to test.%s.reference (progn (cat ${path:test.%s}) (cat ${path:test%s.output}))))" name solver name ignore name name name ref + (with-stdout-to test.%s.reference (progn (cat %%{dep:test.%s}) (cat %%{dep:test%s.output}))))" name solver name ignore name name name ref in Printf.printf " (alias - ((name runtest) - (action (system \"diff %s${path:test-%s.result} ${path:test.%s.reference}\"))))\n" ignore_eol name name + (name runtest) + (action (system \"diff %s%%{dep:test-%s.result} %%{dep:test.%s.reference}\")))\n" ignore_eol name name let () = print_endline "; This file is generated using `MCCS_BACKENDS=jbuilder build @settests --auto-promote`"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/test/jbuild new/ocaml-mccs-1.1+10/test/jbuild --- old/ocaml-mccs-1.1+9/test/jbuild 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/test/jbuild 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -(jbuild_version 1) - -(executable - ((name mccs_test) - (modules (mccs_test)) - (libraries (mccs)))) - -(executable - ((name cbclp) - (modules (cbclp)) - (libraries (unix)))) - -(include jbuild.inc) - -(rule - ((targets (jbuild.inc.gen)) - (deps (gen_tests.ml (universe))) - (action (with-stdout-to ${@} (run ocaml gen_tests.ml))))) - -(alias - ((name settests) - (action (diff jbuild.inc jbuild.inc.gen)))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-mccs-1.1+9/test/jbuild.inc new/ocaml-mccs-1.1+10/test/jbuild.inc --- old/ocaml-mccs-1.1+9/test/jbuild.inc 2018-10-05 18:27:00.000000000 +0200 +++ new/ocaml-mccs-1.1+10/test/jbuild.inc 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -; This file is generated using `MCCS_BACKENDS=jbuilder build @settests --auto-promote` - -(rule - (with-stdout-to test-glpk.result (run ${exe:mccs_test.exe} ${path:test.cudf}))) - -(rule - (with-stdout-to test.glpk.reference (cat ${path:test.output}))) - -(alias - ((name runtest) - (action (system "diff ${path:test-glpk.result} ${path:test.glpk.reference}"))))
