File: octave-4.0.0.patch

package info (click to toggle)
plplot 5.14.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 30,424 kB
  • sloc: ansic: 79,613; xml: 28,583; cpp: 20,037; ada: 19,456; tcl: 12,081; f90: 11,423; ml: 7,276; java: 6,863; python: 6,792; sh: 3,185; perl: 828; lisp: 75; makefile: 48; sed: 33; fortran: 5
file content (297 lines) | stat: -rw-r--r-- 8,673 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
From 248890aad08a2b1e1182f9b5986806e2b8c92d17 Mon Sep 17 00:00:00 2001
From: Orion Poplawski <orion@cora.nwra.com>
Date: Wed, 8 Jul 2015 13:26:36 -0600
Subject: [PATCH 1/5] Support for octave 4.0.0

---
 Lib/octave/octrun.swg | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg
index b5c3e5d..4003544 100644
--- a/Lib/octave/octrun.swg
+++ b/Lib/octave/octrun.swg
@@ -868,6 +868,17 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
     }
 
 #if defined (HAVE_HDF5)
+# if SWIG_OCTAVE_PREREQ(4,0,0)
+    virtual bool
+      save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) {
+      return true;
+    }
+
+    virtual bool
+      load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) {
+      return true;
+    }
+# else
     virtual bool
       save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) {
       return true;
@@ -877,6 +888,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
       load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) {
       return true;
     }
+# endif
 #endif
 
     virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const {
@@ -1089,6 +1101,15 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
       { return ptr->load_binary(is, swap, fmt); }
 
 #if defined (HAVE_HDF5)
+# if SWIG_OCTAVE_PREREQ(4,0,0)
+    virtual bool
+      save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats)
+      { return ptr->save_hdf5(loc_id, name, save_as_floats); }
+
+    virtual bool
+      load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug)
+      { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); }
+# else
     virtual bool
       save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats)
       { return ptr->save_hdf5(loc_id, name, save_as_floats); }
@@ -1096,6 +1117,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
     virtual bool
       load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug)
       { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); }
+# endif
 #endif
 
     virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const
@@ -1108,10 +1130,14 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
       { return ptr->print(os, pr_as_read_syntax); }
 
   private:
+#if !SWIG_OCTAVE_PREREQ(4,0,0)
     DECLARE_OCTAVE_ALLOCATOR;
+#endif
     DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
   };
+#if !SWIG_OCTAVE_PREREQ(4,0,0)
   DEFINE_OCTAVE_ALLOCATOR(octave_swig_ref);
+#endif
   DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_ref, "swig_ref", "swig_ref");
 
   class octave_swig_packed:public octave_base_value {
@@ -1167,6 +1193,17 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
     }
 
 #if defined (HAVE_HDF5)
+# if SWIG_OCTAVE_PREREQ(4,0,0)
+    virtual bool
+      save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) {
+      return true;
+    }
+
+    virtual bool
+      load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) {
+      return true;
+    }
+# else
     virtual bool
       save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) {
       return true;
@@ -1176,13 +1213,18 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
       load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) {
       return true;
     }
+# endif
 #endif
 
   private:
+#if !SWIG_OCTAVE_PREREQ(4,0,0)
     DECLARE_OCTAVE_ALLOCATOR;
+#endif
     DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
   };
+#if !SWIG_OCTAVE_PREREQ(4,0,0)
   DEFINE_OCTAVE_ALLOCATOR(octave_swig_packed);
+#endif
   DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_packed, "swig_packed", "swig_packed");
 
   SWIGRUNTIME octave_value_list octave_set_immutable(const octave_value_list &args, int nargout) {

From 350c410d4bba978263e592a070e87cdae1663c7f Mon Sep 17 00:00:00 2001
From: Orion Poplawski <orion@cora.nwra.com>
Date: Thu, 9 Jul 2015 19:20:46 -0600
Subject: [PATCH 2/5] Update print() signature for octave 4.0

---
 Lib/octave/octrun.swg | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg
index 4003544..ddfd489 100644
--- a/Lib/octave/octrun.swg
+++ b/Lib/octave/octrun.swg
@@ -981,7 +981,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
       return octave_value();
     }
 
+#if SWIG_OCTAVE_PREREQ(4,0,0)
+    void print(std::ostream &os, bool pr_as_read_syntax = false) {
+#else
     void print(std::ostream &os, bool pr_as_read_syntax = false) const {
+#endif
       if (is_string()) {
 	os << string_value();
 	return;
@@ -1126,7 +1130,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
     virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const
       { return ptr->convert_to_str_internal(pad, force, type); }
 
+#if SWIG_OCTAVE_PREREQ(4,0,0)
+    void print(std::ostream &os, bool pr_as_read_syntax = false)
+#else
     void print(std::ostream &os, bool pr_as_read_syntax = false) const
+#endif
       { return ptr->print(os, pr_as_read_syntax); }
 
   private:
@@ -1169,7 +1177,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
       return true;
     }
 
+#if SWIG_OCTAVE_PREREQ(4,0,0)
+    void print(std::ostream &os, bool pr_as_read_syntax = false) {
+#else
     void print(std::ostream &os, bool pr_as_read_syntax = false) const {
+#endif
       indent(os);
       os << "swig packed type: name = " << (type ? type->name : std::string()) << ", len = " << buf.size(); newline(os);
     }

From 5a6a39a4eeaaef11cd8100cb2660722a2a3352c7 Mon Sep 17 00:00:00 2001
From: Orion Poplawski <orion@cora.nwra.com>
Date: Fri, 10 Jul 2015 08:24:09 -0600
Subject: [PATCH 3/5] Add #include <climits> for INT_MAX

---
 Lib/octave/octcontainer.swg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Lib/octave/octcontainer.swg b/Lib/octave/octcontainer.swg
index 723256c..0211b33 100644
--- a/Lib/octave/octcontainer.swg
+++ b/Lib/octave/octcontainer.swg
@@ -12,6 +12,7 @@
  * ----------------------------------------------------------------------------- */
 
 %{
+#include <climits>
 #include <iostream>
 %}
 

From 1d5d2243284534231fbca0842d2da68d5792ed09 Mon Sep 17 00:00:00 2001
From: Orion Poplawski <orion@cora.nwra.com>
Date: Fri, 10 Jul 2015 11:59:45 -0600
Subject: [PATCH 4/5] Fix default_constructor_runme.m test

---
 Examples/test-suite/octave/default_constructor_runme.m | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/Examples/test-suite/octave/default_constructor_runme.m b/Examples/test-suite/octave/default_constructor_runme.m
index 2f8bb39..ebe553b 100644
--- a/Examples/test-suite/octave/default_constructor_runme.m
+++ b/Examples/test-suite/octave/default_constructor_runme.m
@@ -14,24 +14,18 @@
 catch
 end_try_catch
 
-del_b = dc.delete_B;
-
 try
     bb = dc.new_BB();
     error("Whoa. new_BB created.")
 catch
 end_try_catch
 
-del_bb = dc.delete_BB;
-
 try
     c = dc.new_C();
     error("Whoa. new_C created.")
 catch
 end_try_catch
 
-del_c = dc.delete_C;
-
 cc = dc.new_CC();
 dc.delete_CC(cc);
 
@@ -41,24 +35,18 @@
 catch
 end_try_catch
 
-del_d = dc.delete_D;
-
 try
     dd = dc.new_DD();
     error("Whoa. new_DD created")
 catch
 end_try_catch
 
-dd = dc.delete_DD;
-
 try
     ad = dc.new_AD();
     error("Whoa. new_AD created")
 catch
 end_try_catch
 
-del_ad = dc.delete_AD;
-
 e = dc.new_E();
 dc.delete_E(e);
 
@@ -71,12 +59,10 @@
 catch
 end_try_catch
 
-del_eb = dc.delete_EB;
-
 f = dc.new_F();
 
 try
-    del_f = dc.delete_F;
+    del_f = dc.delete_F(f);
     error("Whoa. delete_F created")
 catch
 end_try_catch
@@ -86,7 +72,7 @@
 g = dc.new_G();
 
 try
-    del_g = dc.delete_G;
+    del_g = dc.delete_G(g);
     error("Whoa. delete_G created")
 catch
 end_try_catch

From 68e833a5b97ba02feeb594c736620b832697486a Mon Sep 17 00:00:00 2001
From: Orion Poplawski <orion@cora.nwra.com>
Date: Fri, 10 Jul 2015 22:37:43 -0600
Subject: [PATCH 5/5] Add octave 4.0 to travis

---
 .travis.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index a51c541..9c738b1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,6 +29,8 @@ matrix:
     - compiler: gcc
       env: SWIGLANG=octave SWIGJOBS=-j3 VER=3.8
     - compiler: gcc
+      env: SWIGLANG=octave SWIGJOBS=-j3 VER=4.0
+    - compiler: gcc
       env: SWIGLANG=perl5
     - compiler: gcc
       env: SWIGLANG=php