Commit graph

2,389 commits

Author SHA1 Message Date
William S Fulton
5481270c2a Fix Python 3 inconsistency handling -ve numbers for unsigned C types.
An OverFlow error is now consistently thrown instead of a TypeError.

Fixes primitive_types testcase for Python 3
2013-05-25 10:36:14 +01:00
Artem Serebriyskiy
3e188e508d Add test case for attributes with moderately complex templates
* New test case tests that %attribute macros correctly supports passing
  template with multiple parameters as class name or attribute type name

* Some further changes were made to %attribute macros - now
  AttributeType is protected with %arg as well. This allows you
  to have attributes of type e.g. std::pair<int,int> etc

Update CHANGES file for %attribute template fixes

Closes #48
2013-05-25 00:44:36 +01:00
Artem Serebriyskiy
c956c4c87f Fix %arg in Lib/attribute.i 2013-05-25 00:37:57 +01:00
Artem Serebriyskiy
3357ee85cd Fix all attributes macroses 2013-05-25 00:37:57 +01:00
William S Fulton
04b9037c70 Simplify and improve Guile FILE * in typemap
Fix incorrect special variable $name and remove unnecessary temporary
variable.
2013-05-16 19:21:59 +01:00
William S Fulton
ea2e615cec Fix some typos in directive names 2013-05-12 19:14:59 +01:00
Karl Wette
93650b2911 Octave: install functions only once, when creating module
- once installed, Octave functions can never really be uninstalled
  (clear -f doesn't prevent the function being called again), so
  it makes no sense to install functions more than once
- this can lead to a significant speed-up of module loading times,
  up to a factor of 10 for a large module loaded multiple times
2013-05-12 17:32:09 +01:00
Karl Wette
ef160ec072 Octave: remove allocation of new octave_value in SWIG_Octave_SetGlobalValue()
- this introduces a memory leak, which becomes significant for large
  modules (many global variables) and many module re-loadings (e.g.
  during a long-running script)
- the original motivation was to prevent double-frees on exit, but this
  problem appears to have been fixed by the _Exit() hack in later commits,
  and in any case is an issue only for Octave ~3.2, so it should be safe to
  remove; tested by running Octave examples/test suite with Debian 3.2.4 and
  built-from-source 3.2.4, 3.4.3, and 3.6.3
2013-05-12 17:32:08 +01:00
Geert Janssens
9110d47ea6 Use freearg instead of argout to free temp variable 2013-04-28 22:06:25 +02:00
William S Fulton
6a60efffd1 Some C++ experience needed
On 19/04/13 18:41, Geert Janssens wrote:
> Hi,
>
> I'm working through the failing testcases for guile. One testcase fails
> with a compilation error in some generated code based on std_map and
> std_pair. I know exactly where this generated code comes from, but my
> C++ knowledge is insufficient to understand the error, let alone remedy
> it. I gather some kind of const violation, but that's all I can read
> from it :( My hope is that someone used to working with stl will more
> easily understand it.
>
> So, if someone can help me understand the error and what the fix would
> be in C++, I can fix the corresponding .i file.
>
> This is the code snippet the causes the error:
>

<snip>

>
> /usr/lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:88:12:
> error: non-static const member ‘const std::pair<int, A*> std::pair<int,
> const std::pair<int, A*> >::second’, can’t use default assignment operator

This is the main problem - it is saying there is no default assignment
operator (because one of the members in pair is const). The solution is
to avoid assignment. I've attached a patch to do this plus some error
message corrections.

William
2013-04-28 22:06:25 +02:00
Geert Janssens
140829a826 guile: fix std_map.i "$1 not found" error 2013-04-28 22:06:25 +02:00
Geert Janssens
d689d9a860 Fix deprecation warnings for test suite under guile 2.0 2013-04-28 22:06:24 +02:00
Geert Janssens
b819d2a91e Drop guilegh interface
All of guile's interface files now use the scm interface.
This should not affect any users. Swig generated code
using the scm interface can be mixed with gh interface
using user code.
It does simplify maintenance of the guile swig code though.
2013-04-28 22:06:24 +02:00
Geert Janssens
3c47730803 Drop support for guile 1.6 and older 2013-04-28 22:06:22 +02:00
Geert Janssens
2c23a5d2cd Add support for guile 2.0: update swg and interface files
Note: only the scm interface is considered.
2013-04-28 22:06:22 +02:00
William S Fulton
62638bfd15 Pike - a few updates to get Pike 7.8 running most of the examples 2013-04-20 02:28:48 +01:00
William S Fulton
1f4bd0bfa5 Minor extraneous makefiles tidy up 2013-04-19 22:47:29 +01:00
Marvin Greenberg
d0202cbdac Fix typecheck OUTPUT typemaps for Java 2013-04-10 18:37:26 +01:00
Olly Betts
939fa86627 [PHP] Add missing directorin typemap for char* and char[] which
fixes director_string testcase failure.
2013-04-09 14:35:14 +12:00
Nishant Rodrigues
5fd059d80f Patch fixing warning 322 in rubycontainer_extended
'rubycontainer_extended.swg' generates warnings:

 Warning 322: Redundant redeclaration of 'map_bang',
 Warning 322: previous declaration of 'map_bang'.

The fix is to remove a redundant call to swig_container_extend for
swig::GC_VALUE.

Thanks

========================================================
2013-04-08 18:58:01 +01:00
William S Fulton
5ae6ff404d Cosmetic - use C comments instead of C++ comments for recent Ruby change 2013-04-08 07:58:09 +01:00
William S Fulton
bb3fe8c906 Rewrite Ruby's GC_VALUE without use of macros for easier debugging 2013-04-06 02:20:56 +01:00
William S Fulton
8484c2de9b More rb_protect rewrite to use rb_rescue for Ruby 1.9 2013-04-06 00:30:50 +01:00
William S Fulton
5d529d5a76 Ruby 1.9 fixes.
SF Bug#1292 - Runtime fixes for Proc changes in ruby-1.9 when using STL wrappers that override the default predicate, such as:

  %template(Map) std::map<swig::LANGUAGE_OBJ, swig::LANGUAGE_OBJ, swig::BinaryPredicate<> >;

Fixes li_std_functors testcases for Ruby 1.9.

Also rb_respond_to return values have changed subtely in 1.9 and return should be treated as a flag instead of checking for Qtrue, see SF Bug #1159.

Also fix li_std_map, li_std_set silently failing - rb_protect behaviour seems to have changed when an exception is thrown, so code has been changed to use rb_rescue. A call to 'rb_set_errinfo(Qnil)' could have solved this after the rb_protect call, but it is only available in 1.9+ and Ruby API changes are not easily and transparently detectable.
2013-04-05 23:41:59 +01:00
William S Fulton
9aaf4ad03c Fixes for Ruby 1.9 std::complex wrappers.
New native Ruby complex numbers are used.
2013-04-02 20:14:51 +01:00
William S Fulton
e13e1cba9e Fix seg fault when using STL containers of generic Ruby types, GC_VALUE or LANGUAGE_OBJECT, on exit of the Ruby interpreter. Observed on 64 bit Linux in the std_li_set testcase. The global hash which is meant to hold GC references was being deleted by the interpreter on exit before the GC_VALUES destructors were being called. 2013-03-31 00:55:34 +00:00
William S Fulton
2e0d1b12dc Fix delete_if (reject!) for the STL container wrappers.
Previously they would sometimes seg fault or not work.
2013-03-29 06:28:15 +00:00
William S Fulton
38b2b95c30 Fix some invalid iterator usage in Python when deleting/inserting slices from/into containers 2013-03-26 21:38:45 +00:00
William S Fulton
7eda619741 Fix invalid iterators used with -ve ranges - Python
Fixes li_std_containers_int testcase.
Valgrind reports no more problems for this testcase.
2013-03-26 21:38:44 +00:00
Olly Betts
23bcc1c66b Remove lingering relic of PHP4 support 2013-03-20 16:45:24 +13:00
Olly Betts
b72aca1d07 Fix typo in comment (swift->swig) 2013-03-20 15:39:03 +13:00
Olly Betts
7c80f007c4 Fix typo in Python docstring for acquire method 2013-03-19 18:38:45 +13:00
William S Fulton
670962cfe8 SWIG_TypeCompare was not working as commented - return values were 0,1 and not 1,0,-1. Although undocumented and not used anywhere within SWIG, it has been replaced with SWIG_TypeCmp to work as commented. 2013-03-04 07:32:40 +00:00
Michel Zou
8155e14579 Macro expansion to self assign is effectively ignored. 2013-02-26 09:26:13 +01:00
Michel Zou
c23b7606cf MOdified only no-cast-rank version of SWIG_AddCast. 2013-02-25 11:07:42 +01:00
Michel Zou
7acf6b5fef Revert "Fixed #1300 clang warning in SWIG_Python_ConvertPtrAndOwn."
This reverts commit 8e340c158c.
2013-02-25 09:53:45 +01:00
Michel Zou
8e340c158c Fixed #1300 clang warning in SWIG_Python_ConvertPtrAndOwn. 2013-02-22 10:11:50 +01:00
tpapp
054f9dba1a CFFI - Fix missing package before &body - patch #22
Should fix https://github.com/swig/swig/issues/21.
2013-02-09 17:23:16 +00:00
William S Fulton
afc2b884a4 Merge branch 'master' of github.com:swig/swig 2013-01-12 16:55:07 +00:00
William S Fulton
bd67f57921 Convert to unix fileformat 2013-01-12 16:54:37 +00:00
William S Fulton
a6d456a15e Replace references to Subversion with Git 2013-01-12 01:24:22 +00:00
Olly Betts
f9566ad2df Fix assorted typos.
From https://sourceforge.net/p/swig/patches/332/ and some others too.
2013-01-08 18:47:40 +13:00
joequant
beb40008b1 add boost_shared_ptr for R 2013-01-07 06:03:37 +08:00
joequant
308b5dab3f r changes to handle external pointers 2013-01-06 19:42:12 +08:00
William S Fulton
0bde711222 Merge branch 'SFbug1295' of https://github.com/ptomulik/swig 2013-01-05 17:59:18 +00:00
Paweł Tomulik
a6f733602e added patch for SF bug #1295 2013-01-04 16:57:04 +01:00
Brant K. Kyser
540ede0dd3 Fix for SourceForge Bug #1283.
* Change the name of the memory own variable for base java director classes to match that expected by the director code
* Add conditional to appropriately dynamically cast director classes wrapped in smart pointers.
2013-01-04 00:31:55 +00:00
Klaus Kämpf
23771ef027 Ruby: Replace all occurences of STR2CSTR macro with calls to StringValuePtr
STR2CSTR was deprecated in Ruby since years and got finally removed
in Ruby 1.9


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13967 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-14 15:48:31 +00:00
William S Fulton
16481c999e Bug #3563647 - PyInt_FromSize_t unavailable prior to Python 2.5 for unsigned int types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13953 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-09 20:49:52 +00:00
William S Fulton
5e507b82f1 Apply patch #3571029 which adds missing director support for const unsigned long long &.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13952 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-09 20:49:28 +00:00