chiark / gitweb /
octave4.4
[nlopt.git] / debian / patches / octave-4.0.patch
1 Description: Fix FTBFS against Octave 4.0
2  Replace Octave_map by octave_map.
3 Origin: upstream, https://github.com/stevengj/nlopt/commit/131148eb02b770da0e5c1049b4e82c78e4a50fa2
4 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792826
5 Reviewed-by: Sébastien Villemot <sebastien@debian.org>
6 Last-Update: 2015-07-20
7 ---
8 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
9 diff --git a/octave/nlopt_optimize-oct.cc b/octave/nlopt_optimize-oct.cc
10 index 4e08421..a66da8e 100644
11 --- a/octave/nlopt_optimize-oct.cc
12 +++ b/octave/nlopt_optimize-oct.cc
13 @@ -29,7 +29,7 @@
14  #include "nlopt.h"
15  #include "nlopt_optimize_usage.h"
16  
17 -static int struct_val_default(Octave_map &m, const std::string& k,
18 +static int struct_val_default(octave_map &m, const std::string& k,
19                                  int dflt)
20  {
21    if (m.contains(k)) {
22 @@ -39,7 +39,7 @@ static int struct_val_default(Octave_map &m, const std::string& k,
23    return dflt;
24  }
25  
26 -static double struct_val_default(Octave_map &m, const std::string& k,
27 +static double struct_val_default(octave_map &m, const std::string& k,
28                                  double dflt)
29  {
30    if (m.contains(k)) {
31 @@ -49,7 +49,7 @@ static double struct_val_default(Octave_map &m, const std::string& k,
32    return dflt;
33  }
34  
35 -static Matrix struct_val_default(Octave_map &m, const std::string& k,
36 +static Matrix struct_val_default(octave_map &m, const std::string& k,
37                                  Matrix &dflt)
38  {
39    if (m.contains(k)) {
40 @@ -140,7 +140,7 @@ static double user_function1(unsigned n, const double *x,
41  
42  #define CHECK1(cond, msg) if (!(cond)) { fprintf(stderr, msg "\n\n"); nlopt_destroy(opt); nlopt_destroy(local_opt); return NULL; }
43  
44 -nlopt_opt make_opt(Octave_map &opts, int n)
45 +nlopt_opt make_opt(octave_map &opts, int n)
46  {
47    nlopt_opt opt = NULL, local_opt = NULL;
48  
49 @@ -195,7 +195,7 @@ nlopt_opt make_opt(Octave_map &opts, int n)
50      CHECK1(opts.contents("local_optimizer").length() == 1 
51           && (opts.contents("local_optimizer"))(0).is_map(),
52           "opt.local_optimizer must be a structure");
53 -    Octave_map local_opts = (opts.contents("local_optimizer"))(0).map_value();
54 +    octave_map local_opts = (opts.contents("local_optimizer"))(0).map_value();
55      CHECK1((local_opt = make_opt(local_opts, n)), 
56           "error initializing local optimizer");
57      nlopt_set_local_optimizer(opt, local_opt);
58 @@ -216,7 +216,7 @@ DEFUN_DLD(nlopt_optimize, args, nargout, NLOPT_OPTIMIZE_USAGE)
59    CHECK(args.length() == 2 && nargout <= 3, "wrong number of args");
60  
61    CHECK(args(0).is_map(), "opt must be structure")
62 -  Octave_map opts = args(0).map_value();
63 +  octave_map opts = args(0).map_value();
64  
65    CHECK(args(1).is_real_matrix() || args(1).is_real_scalar(),
66         "x must be real vector");