Commit graph

321 commits

Author SHA1 Message Date
William S Fulton
52063a732b Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
William S Fulton
6d27ead9c0 Add STL container copy constructors where missing
Also provide consistent copy constructor declarations.
2019-02-14 18:53:05 +00:00
William S Fulton
a47c2553f5 Add missing typedefs to std::pair 2019-02-13 22:46:28 +00:00
William S Fulton
9dd33e6367 Add missing typedefs to std::map 2019-02-13 22:46:27 +00:00
William S Fulton
6d0c495fd0 Add missing parameter names in STL container wrappers
Mostly in STL copy constructors.

Best to have parameter names as they make their way into the wrappers in
some target languages.
2019-02-13 22:45:47 +00:00
William S Fulton
68e86614ff Create a consistent stl.i library file
Same file now for all languages except R which is still missing std_map.i.
Recent Java changes adding in std_set.i removed.
2019-02-12 18:46:05 +00:00
William S Fulton
b48339cfca Fix overloading for non-pointers and NULL - Scilab 2018-12-30 14:22:13 +00:00
William S Fulton
6f5417499a Fix incorrect casts for Scilab enums 2018-11-13 07:35:44 +00:00
William S Fulton
ca287ae13b Add support for non-default compare template argument in std::map wrappers 2018-10-09 19:44:00 +01:00
luz.paz
60dfa31a67 Misc. typos
found via `codespell` and `grep`
2018-05-17 10:04:23 -04:00
William S Fulton
35c5a3a42a Scilab portability fixes - remove use of strdup 2018-05-04 20:02:13 +01:00
William S Fulton
179b41067d Scilab array overbounds fix handling char type exceptions 2018-05-04 20:02:13 +01:00
William S Fulton
3ce3ce0683 Add std_shared_ptr.i for Scilab and R as boost_shared_ptr.i is already available 2018-03-09 06:58:08 +00:00
Simon Marchetto
1647135369 [scilab] fix compilation (checked with the additional compiler options) 2018-02-01 14:31:52 +01:00
Simon Marchetto
7a9ee39412 [Scilab] fix compilation error 2018-02-01 10:09:35 +01:00
Simon Marchetto
862501480e add type name argument in SWIG_ptr() function to cast from pointer adress to typed pointers 2018-01-30 16:34:31 +01:00
William S Fulton
cd9b7c3c34 std_basic_string.i fixes
- Remove python code from octave's std_basic_string.i
- Correctly return an error to fix error handling when using std::basic_string in
  overloaded methods - issue #1171.
2018-01-04 07:00:26 +00:00
William S Fulton
3f8b8fe734 Enhancements for directorin typemaps
The directorin typemaps will now generate a temporary variable
(specified after the type), such as:
%typemap(directorin) MyType (MyType *temp) { ... use temp ... }

The shared_ptr director typemaps have been fixed for use in functions
that take more than one parameter.
2017-10-16 19:28:27 +01:00
William S Fulton
6470fe8c36 Director shared_ptr typemaps for scripting languages
Modify the Python and Ruby director shared_ptr typemaps to be language neutral.
Port the director modifications to other scripting languages that
have shared_ptr support - Octave, R and Scilab. Scilab shared_ptr
support is not fully working and needs work though.
2017-10-13 07:34:38 +01:00
William S Fulton
114fab31a1 Scilab, R and Octave shared_ptr typemaps null fix
Merge changes from Python/Ruby equivalent files to obtain a fix
for NULL handling of T*const& typemaps.
2017-10-11 18:08:32 +01:00
William S Fulton
eca67ee880 Ruby and Scilab shared_ptr typemap fragment correction
Remove some left over cruft from the python port
2017-09-25 08:45:31 +01:00
William S Fulton
ed4b84f4d3 Fix overloading of shared_ptr method overloading
Add 'equivalent' attribute to typecheck typemap.
Closes #1098.
2017-09-23 15:19:34 +01:00
Olly Betts
90f9117e10 Fix various comment and documentation typos 2017-08-13 18:04:33 +12:00
Mike Romberg
c3ba9506bf as() no longer uses memset and always throws. 2017-07-20 14:48:51 -06:00
William S Fulton
82969b0755 Fix warning in generated code - traits_asptr.
Visual Studio 2015 debug builds:
error C4703: potentially uninitialized local pointer variable 'p' used
2017-06-13 19:02:59 +01:00
William S Fulton
5d5fd5b122 Fix scilab fragment dependency problem in STL headers
import_stl test now working again
2017-06-06 19:56:59 +01:00
William S Fulton
ab1e9f5bd9 Consistent whitespace amongst all the shared_ptr and intrusive_ptr typemaps
[skip ci]
2017-04-20 19:21:47 +01:00
Simon Marchetto
e517128e08 [Scilab] fix compilation, missing return 2016-12-20 10:09:07 +01:00
Simon Marchetto
94bee6b35a [Scilab] put typemap int/double check into function (to reduce generated code size) 2016-12-19 15:04:30 +01:00
Simon Marchetto
4d46527c9c scilab: clean 2016-12-19 15:04:30 +01:00
Simon Marchetto
88b4827d87 scilab: SWIG_ptr() accepts mlist typed pointers and converts them to pointers 2016-12-15 23:57:42 +01:00
Simon Marchetto
6b2caca8b9 scilab: add runtime function SWIG_Scilab_TypeQuery() checks runtime is initialized 2016-10-05 14:09:08 +02:00
Simon Marchetto
36156a2295 scilab: clean runtime code (move error functions..) 2016-10-05 14:09:08 +02:00
Simon Marchetto
457ea5d209 scilab: remove compilation warnings 2016-09-26 13:55:45 +02:00
Simon Marchetto
0c09b00d6e scilab: mlists that map pointers can be given a custom type name 2016-09-26 11:54:17 +02:00
Simon Marchetto
c252d5cb40 scilab: pointer is mapped to mlist instead of tlist (for scilab overloading) 2016-09-02 11:36:02 +02:00
William S Fulton
91aba9f719 UTL STL container descriptor checks
The vector of pointers (just fixed) were not working correctly because the
descriptors returned from swig::type_info() were sometimes returning
zero. Zero should only be used for void * as the subsequent call to
SWIG_ConvertPtr will blindly cast the pointer without checking
descriptor.

std::vector<void *> does not work and will require further changes:
specializing traits_info<void *> to return 0 and traits_asptr<void *>.
I tried this and traits_asptr<void> also needs to be added in which
seems odd and requires further investigation...

Lib/python/pystdcommon.swg:
  template <> struct traits_info<void *> {
    static swig_type_info *type_info() {
      static swig_type_info *info = 0;
    }
  };

Lib/std/std_common.i:
  template <>
  struct traits_asptr<void *> {
    static int asptr(PyObject *obj, void ***val) {
      void **p;
      swig_type_info *descriptor = 0;
      int res = SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0);
      if (SWIG_IsOK(res)) {
	if (val) *val = p;
      }
      return res;
    }
  };

  // this is needed, but am not sure this is expected
  template <>
  struct traits_asptr<void> {
    static int asptr(PyObject *obj, void **val) {
      void **p;
      swig_type_info *descriptor = 0;
      int res = SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0);
      if (SWIG_IsOK(res)) {
	if (val) *val = p;
      }
      return res;
    }
  };
2016-07-28 22:51:29 +01:00
Simon Marchetto
9f4ad6e7dc scilab: fix pointer type name 2016-04-06 13:22:59 +02:00
Simon Marchetto
2e556a4cda scilab: fix warnings 2016-03-14 17:49:05 +01:00
Simon Marchetto
46a8acb538 scilab: fix compilation error (no return in SWIG_CheckPtr()) 2016-03-14 17:42:04 +01:00
simon
e2e06c0031 scilab: fix C90 non conformance 2016-03-11 18:03:32 +01:00
simon
1846dec899 scilab: remove debug stuff 2016-03-11 12:29:21 +01:00
simon
b9bddada7a scilab: fix object/pointer type checking 2016-03-08 17:37:39 +01:00
simon
424bebb165 scilab: pointers are mapped as a tlist (instead of pointers) containing type info 2016-03-08 17:37:39 +01:00
simon
e5f4a60fbf scilab: fix indentation 2016-03-02 05:14:44 -05:00
simon
94a94edae4 scilab: fix scilab 6.0 beta1 compilation error 2016-03-02 05:14:44 -05:00
William S Fulton
6b4e57245d Fix STL wrappers to not generate <: digraphs.
For example std::vector<::X::Y> was sometimes generated, now
corrected to std::vector< ::X::Y >.
2015-12-12 14:05:46 +00:00
William S Fulton
fcb383b46b shared_ptr typemap error message fix for global variables
$argnum was not being expanded in the generated code
Correct to use the error message from the standard typemaps
2015-09-25 22:57:59 +01:00
Simon Marchetto
078ad6cb86 simplify SWIG_SciString_AsChar() 2015-06-23 16:24:35 +02:00
Simon Marchetto
b05f0057ca improve support of varargs 2015-06-23 16:24:35 +02:00