swig/Lib/r
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
..
boost_shared_ptr.i shared_ptr typemap error message fix for global variables 2015-09-25 22:57:59 +01:00
cdata.i Committing R-SWIG 2006-06-29 03:01:18 +00:00
exception.i Committing R-SWIG 2006-06-29 03:01:18 +00:00
r.swg Suppress message at package load - Creating a generic function for ‘print’ from package ‘base’ in package <some package> 2016-03-10 20:29:15 -08:00
rcontainer.swg check in R-swig changes that implement vector conversions to and 2012-03-29 16:32:51 +00:00
rfragments.swg Don't use long long if it isn't available 2016-01-06 16:52:37 -05:00
rkw.swg R - fix duplicate generation of 'self' parameter. 2015-06-12 20:25:00 +01:00
ropers.swg rename non-classes operators 2006-08-26 20:23:48 +00:00
rrun.swg Remove unused code in R wrappers 2016-06-05 21:40:03 +01:00
rstdcommon.swg UTL STL container descriptor checks 2016-07-28 22:51:29 +01:00
rtype.swg Fix R Lib files and testcase failing due to new preprocessor checks 2014-10-29 23:11:09 +00:00
srun.swg R - Call to SWIG_createNewRef in copyToC was incorrectly named. 2015-06-12 20:23:56 +01:00
std_alloc.i Committing R-SWIG 2006-06-29 03:01:18 +00:00
std_common.i Fix STL wrappers to not generate <: digraphs. 2015-12-12 14:05:46 +00:00
std_container.i Committing R-SWIG 2006-06-29 03:01:18 +00:00
std_deque.i Committing R-SWIG 2006-06-29 03:01:18 +00:00
std_except.i Committing R-SWIG 2006-06-29 03:01:18 +00:00
std_list.i add list to R backend 2012-03-18 09:33:53 +00:00
std_map.i add std_map 2009-11-10 02:32:29 +00:00
std_pair.i add std_map 2009-11-10 02:32:29 +00:00
std_string.i Committing R-SWIG 2006-06-29 03:01:18 +00:00
std_vector.i cleaned up constants 2016-04-21 18:11:56 +10:00
stl.i add pair to stl.i 2012-08-08 14:13:37 +00:00
typemaps.i Committing R-SWIG 2006-06-29 03:01:18 +00:00