Commit graph

19,373 commits

Author SHA1 Message Date
Olly Betts
5839d9cce0 Use relative link to another manual chapter
Explicitly linking to the copy on the website breaks the link for
those browsing installed documentation offline.
2016-08-27 11:12:16 +12:00
William S Fulton
253a39fdff Fix hash function type checking for older versions of Python
Python 2.6 was asserting instead of throwing a Python TypeError.
2016-08-23 18:46:28 +01:00
William S Fulton
17d68afedd changes file updates 2016-08-22 19:52:41 +01:00
William S Fulton
1cef6b7440 Merge branch 'builtin-tweaks'
* builtin-tweaks:
  Python builtin minor tweaks
  Cosmetic code formatting corrections
  Further additional Python builtin slots as features for user customization
  Add additional Python builtin slots as features for user customization
  Correct notes on customising Python builtin comparison operators
  Set tp_new statically rather than during initialisation
  Customize slots tp_basicsize tp_methods tp_getset
  Additional Python builtin slot overrides and slightly better formatted Python generated code
  Add Python builtin tp_dealloc override test
  Python getSlot() refactor
  Add Python builtin closure method in comment
  Update Python docs on builtin slots
  Python builtin hashfunc closure fix
2016-08-22 19:37:10 +01:00
William S Fulton
ae32fb4f9a Python builtin minor tweaks
Remove internal Python struct names from generated code
Cosmetic code formatting
2016-08-22 19:28:52 +01:00
William S Fulton
ad452edf3e Cosmetic code formatting corrections 2016-08-22 08:48:04 +01:00
William S Fulton
bf4174d121 Further additional Python builtin slots as features for user customization
Added:
- tp_flags
- was_sq_slice
- was_sq_ass_slice
2016-08-22 08:39:24 +01:00
William S Fulton
e5a09c4141 Add additional Python builtin slots as features for user customization
Added:
- tp_is_gc
- tp_bases
- tp_mro
- tp_cache
- tp_subclasses
- tp_weaklist
- tp_del
- tp_allocs
- tp_frees
- tp_maxalloc
- tp_prev
- tp_next
2016-08-22 07:51:42 +01:00
William S Fulton
4f777b181c Correct notes on customising Python builtin comparison operators
Also add example for python:compare feature
2016-08-22 07:22:40 +01:00
William S Fulton
3b6f4af15c Set tp_new statically rather than during initialisation 2016-08-21 14:29:27 +01:00
William S Fulton
3744c45082 Customize slots tp_basicsize tp_methods tp_getset 2016-08-19 23:46:50 +01:00
William S Fulton
239785ce7d Additional Python builtin slot overrides and slightly better formatted Python generated code
The following slots can now be overidden by users if they know what they
are doing:
- tp_dictoffset
- tp_init
- tp_new
- tp_as_number
- tp_as_sequence
- tp_as_mapping
- tp_as_buffer
2016-08-19 23:16:32 +01:00
William S Fulton
4c0c802aa0 Add Python builtin tp_dealloc override test 2016-08-19 18:35:51 +01:00
William S Fulton
67ece1d2bf Python getSlot() refactor
getSlot() now takes a default that can override "0" default - simpler
code and for future commits to override some currently non-overridable
slots.
2016-08-19 08:43:40 +01:00
William S Fulton
a3fc743f32 Add Python builtin closure method in comment
For less mystifying code and easier code searching
2016-08-18 08:41:07 +01:00
William S Fulton
4f681f751d Update Python docs on builtin slots 2016-08-18 07:11:00 +01:00
William S Fulton
f778ee19df Python builtin hashfunc closure fix
If the wrong return type in the hash function was used, an error:
  SystemError: error return without exception set
was raised

Add some tests for testing builtin slots
2016-08-18 07:10:54 +01:00
joequant
1fcbf07441 Merge pull request #765 from richardbeare/RexternCRemove
This changes the location of the R includes to match what is required from the documentation by moving C++ includes outside of the extern "C" block.
2016-08-09 13:47:05 +08:00
Richard Beare
c334efd36b Writing R extensions says:
Most R header files can be included within C++ programs but they should
not be included within an extern "C" block (as they include system headers).

This patch moves the Rdefines.h and Rversion.h outside the extern block.
2016-08-05 15:46:14 +10:00
Olly Betts
a950d1309b [xml] Fix how the output filename is built
Avoid problems when it contains the embedded strings ".c", ".cpp" or ".cxx".
Fixes #540 reported by djack42.
2016-08-05 11:52:35 +12:00
William S Fulton
2740812970 changes entry for vector<T *> fix 2016-08-01 07:03:42 +01:00
William S Fulton
4ab3af90cb Merge branch 'stl-vector-ptrs'
* stl-vector-ptrs:
  Test case warning fixes for nodejs
  Fix testcase causing nodejs test failure
  UTL STL container descriptor checks
  Fix std::vector of pointers which failed if a pointer to a pointer of the container element type existed (Python)
  Remove unused traits.swg
2016-08-01 06:55:01 +01:00
Olly Betts
5648418c98 Remove bogus full stop 2016-08-01 09:51:51 +12:00
William S Fulton
56ab717ff3 Test case warning fixes for nodejs
nodejs 4.2.1 on Ubuntu Xenial Xerus
2016-07-30 21:23:57 +01:00
William S Fulton
0177937f7e Fix testcase causing nodejs test failure 2016-07-30 15:00:55 +01:00
Simon Marchetto
d0a45be1eb scilab: fix issue #746 2016-07-29 16:56:30 +02:00
Simon Marchetto
95a5def328 scilab: fix issue #755 2016-07-29 11:52:26 +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
William S Fulton
6e9184b6f8 Fix std::vector of pointers which failed if a pointer to a pointer of the container element type existed (Python)
Closes SF Bug 2359417 created after commit 93f0390322 (svn rev 10958)
2016-07-28 22:51:22 +01:00
William S Fulton
9c3f608ef7 Remove unused traits.swg
This file has code that looks like it was migrated to Lib/std/std_common.i
2016-07-27 18:46:23 +01:00
William S Fulton
8c8937dbdb Minor c++11 doc change 2016-07-20 00:04:47 +01:00
William S Fulton
0cfc6cbd83 %interface documentation corrections and tweaks
Correction is for %interface_impl.

[skip ci]
2016-07-13 22:09:51 +01:00
William S Fulton
36bbeb478d changes file entry for ignoring nested classes 2016-06-26 00:42:12 +01:00
William S Fulton
b24e970a28 Merge branch 'wkalinin-nested-ignore-fix'
* wkalinin-nested-ignore-fix:
  renamed test module, in accordance with other tests
  function body fixed
  added foo() definition to satisfy some test linking fails
  func() renamed to foo() for 'go'
  fixed test-suite/nested_ignore.i
  test for #662
  fix for nested ignored types

Closes #662
2016-06-26 00:33:19 +01:00
William S Fulton
2da7e066b3 Merge branch 'avalluri-leaks'
* avalluri-leaks:
  whitespace fix
  memory leak improvements - delete at end of scope
  CCache: Fix typo in null check
  CCache: Fix memory/file descriptor leaks
  scilab.cxx: Fix memory leaks
  Fix leaked file descriptor
  Lua: Fix possible memory leaks
  go.cxx: Fix use of a freed variable

Closes #710
Closes #712
Closes #713
Closes #715
Closes #716
2016-06-26 00:16:30 +01:00
William S Fulton
adfa531a3b whitespace fix 2016-06-26 00:06:15 +01:00
William S Fulton
7ec7cc63da memory leak improvements - delete at end of scope 2016-06-26 00:06:01 +01:00
William S Fulton
875aca5976 Add changes entry for -castmode and integer conversion fix
Closes #711
2016-06-25 21:43:55 +01:00
Mike Romberg
7dc5879714 castmode was failing overflow tests. Fix it. 2016-06-25 21:17:38 +01:00
William S Fulton
23caea3b68 Add changes entry for %implicitconv fix with -castmode or -fastdispatch 2016-06-25 21:06:17 +01:00
William S Fulton
91a79c8df2 Merge branch 'ahnolds-implicittest'
* ahnolds-implicittest:
  Fixing implicitconv handling for fastdispatch and castmode
2016-06-25 20:46:58 +01:00
William S Fulton
9f37796e80 Add new C++11 type aliasing support to changes file 2016-06-25 16:08:44 +01:00
Alec Cooper
4f1c491090 Fixing implicitconv handling for fastdispatch and castmode 2016-06-23 08:06:14 -04:00
Lior Goldberg
c363a93d69 Added support for type alias 2016-06-22 23:13:28 +03:00
William S Fulton
86fd5c9858 Fix autodoc testcase for python -fastproxy
Also fixes -O.
This is a minimal change avoiding the differences in the function names
when -fastproxy is used until autodoc code is improved with doxygen
changes.

Closes #721.
2016-06-22 00:15:05 +01:00
William S Fulton
3459099fb8 %shared_ptr and %template testcase modified to work for python -O
Testcase has now been modified to mask the problem by providing the default parameter 'int' in:
%shared_ptr(Space::BaseDefault<short, int>)
If this is not done then d fails to convert to BaseDefault<short>&

This needs fixing in SWIG, but the problem is masked for now, so that the python
testcase works when run with the -O option.
2016-06-21 19:49:27 +01:00
William S Fulton
38cda92938 smartptr inheritance fix when using templates and typedefs
Fixes SF bug 3333549 - %shared_ptr fixes when the type is a template using
template parameters that are typedef'd to another type.

Also fixes python -O optimization where the smart pointer conversion to the
base class needs to work because of the virtual methods that have been
optimized away.
2016-06-21 07:00:56 +01:00
William S Fulton
cc7319f52f Replace assert from Python testcases with code that always runs.
assert code is sometimes not executed, eg when running python -O.
2016-06-19 20:11:51 +01:00
Amarnath Valluri
6234ebd486 CCache: Fix typo in null check 2016-06-17 15:07:39 +03:00
Amarnath Valluri
478d5df911 CCache: Fix memory/file descriptor leaks
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
2016-06-17 15:07:36 +03:00