Commit graph

346 commits

Author SHA1 Message Date
William S Fulton
0f1e3da5de Fix the high passed to PyTuple_GetSlice in varargs wrappers.
Harmless bug as slices can take any size larger than the actual size for
the high value. Reported in SF Bug 1326.
2013-05-23 21:25:41 +01:00
William S Fulton
d172e3d0ed Apply patch SF #334 - Fix Python default value conversions TRUE->True, FALSE->False. 2013-01-29 07:31:11 +00:00
William S Fulton
7841a0d097 Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
William S Fulton
4c1b566f62 Fix fully qualified package paths for Python 3 even if a module is in the same package
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13955 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-11 18:42:58 +00:00
William S Fulton
092e2104c7 More consistent use of DOH namespace
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13940 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-26 20:31:54 +00:00
William S Fulton
d93dc0f8e2 Distinguish between an "abstract" attribute on a class containing a list of abstract members and an "abstract" flag on pure virtual methods - renamed former to "abstracts"
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13935 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-24 14:13:58 +00:00
William S Fulton
0d2c459046 Remove some unused code and pointless variable assignments
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13932 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-23 07:38:00 +00:00
William S Fulton
2b8bfe410e Remove unnecessary null checks or fix potential null dereferences
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13924 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-20 23:29:35 +00:00
William S Fulton
d918bddfc0 Fix segfaults when using filename paths greater than 1024 characters in length - use String * and heap instead of fixed size static char array buffers.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13904 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-18 00:45:18 +00:00
William S Fulton
5a1e82a2f4 Remove DohClose (Close) and replace with calls to DohDelete (Delete) to fix some minor memory leaks in most uses of NewFile.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13885 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-14 22:16:07 +00:00
William S Fulton
b1ee062d2a Cosmetic variable renaming for consistency across language modules
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-10-27 17:38:05 +00:00
William S Fulton
f6229d4b73 Fix director typemap searching so that a typemap specified with a name will be correctly matched. Previously the name was ignored during the typemap search. Implemented by ensuring the 'type' attribute in the Node is set up correctly and using the usual Swig_typemap_lookup on the Node.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13873 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-10-27 17:37:34 +00:00
William S Fulton
7b58300cbd Fix display of pointers on 64 bit systems, only 32 bit values were being shown.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13340 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-07-21 22:52:30 +00:00
Olly Betts
49efe65a08 Remove superfluous ; after closing } of if statement
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12966 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-05 01:20:51 +00:00
Olly Betts
d3987ca87c Fix bad change from r12830.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12964 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-04 13:46:16 +00:00
William S Fulton
468ca084fc Correct special variables in 'directorargout' typemap. This change will break any 'directorargout' typemaps you may have written. Please change: to and to \n Also fix the named 'directorargout' DIRECTOROUT typemaps for these languages which didn't previously compile and add in , etc expansion.\n [C#, Go, Java, D] Add support for the 'directorargout' typemap.\n [Java] Add (char *STRING, size_t LENGTH) director typemaps.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12877 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-20 20:50:36 +00:00
William S Fulton
24133bacd7 Remove numerous hard coded 'result' variable name in generated c/c++ wrappers. The variable name is now defined in just one place, making it possible to change the name easily if a target language so wishes - see cwrap.c.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12830 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-10-30 21:51:50 +00:00
Stefan Zager
b61ccd00ec Bug 3400486: Fix error signalling for built-in constructors.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12792 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-30 21:37:16 +00:00
William S Fulton
44c202d048 Add in $symname expansion for director methods
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12772 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-04 19:45:19 +00:00
Stefan Zager
498367bc9d From swig-user 7/6/11: fix closure for tp_call.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12761 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-20 15:20:24 +00:00
Stefan Zager
0df6937fbf Bug 3324753: fix %rename for member variables under -builtin
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12756 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-14 05:15:05 +00:00
William S Fulton
72ffdb930d Repeat autodoc fixes for Octave and Ruby as done previously for Python
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12740 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-13 20:46:20 +00:00
William S Fulton
a4f8ed4fc9 Fix last checkin for renamed parameters
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12736 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-10 20:26:07 +00:00
William S Fulton
3243cbaad4 Numerous autodoc fixes for Python
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12735 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-10 19:33:40 +00:00
William S Fulton
315dd8fb2f Add in error handling in the even of not being able to find a base when initializing a builtin type - should the base not be loaded
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12693 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-20 05:58:05 +00:00
William S Fulton
b78392832f [Lua, Python, Tcl] C/C++ prototypes shown in error message when calling an overloaded method with incorrect arguments improved to show always show fully qualified name and if a const method. Also fixed other Lua error messages in generated code which weren't consistently using the fully qualified C++ name.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12655 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-05 06:23:02 +00:00
Stefan Zager
e629b192e2 Fixed the argument counts passed to SWIG_Python_UnpackTuple for varargs.
Removed obsolete methods from std_map.i and pyiterators.swg.

Added builtin-check target to python test suite Makefile.

Fixed using_namespace_loop.i so that the generated wrappers will compile.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12644 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-29 18:25:16 +00:00
Stefan Zager
8f07b3f851 Testcase and fix for bug 1163440: vararg typemaps.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12639 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-12 18:55:24 +00:00
Stefan Zager
257b75c23c Fixed PyVarObject_HEAD_INIT calls for VC++.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12634 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-11 22:06:02 +00:00
William S Fulton
139ccc434e Workaround incorrect gcc 4.4 and 4.5 warning with -O2 -Wextra in generated code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12631 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-11 18:45:07 +00:00
William S Fulton
781b468aa1 Sun Studio warning fixes for Python builtin
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12625 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-10 00:23:48 +00:00
William S Fulton
abdd41dc91 Restore extern "C" back to what it was to remove Solaris warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12621 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-09 23:08:03 +00:00
Stefan Zager
8f876a6287 Minor tweaks to enable -builtin with C code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12618 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-08 23:05:20 +00:00
Stefan Zager
5c4f47302a Initialize all fields of PyTypeObject, to eliminate compiler warnings. Fixed typo in docs.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12612 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-05 23:16:13 +00:00
William S Fulton
b2b9e2eb91 Python builtin - warning suppression/fixes for 'gcc -Wall' and cosmetic changes in generated code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12609 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-05 20:39:44 +00:00
William S Fulton
5f6389ab31 Cosmetic Python changes and replace DOH types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12608 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-04 20:13:14 +00:00
Stefan Zager
20cda0168e Eliminate warnings about empty case statements.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12604 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-03 19:44:46 +00:00
Stefan Zager
c95cc72454 Merged %pythonnondynamic fix
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12594 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-03 05:15:48 +00:00
Stefan Zager
90fe22acf7 Fix for METH_O and -compactdefaultargs, in two parts:
- Don't mark a method as METH_O if it has compactdefaultargs
  - In SWIG_Python_UnpackTuple, allow for a non-tuple 'args'.

Added compatibility for python versions 2.3 and 2.4.  These are only
partially supported; inheriting from wrapped types looks problematic.
Versions older that 2.3 are unlikely ever to work.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12590 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-02 21:40:00 +00:00
Stefan Zager
cd7fc2047b Factored some #ifdef noise out of the initialization function by adding
SwigPyBuiltin_SetMetaType.

For %import statements, move the runtime import out of SWIG_init and into the
.py file.  The reason for this is that the import must be executed within the
python execution frame of the module, which is true in the .py file, but *not*
true in the initialization function.  Had to re-order the .py file slightly
to put the 'import' statements at the top; that's necessary to make sure base
types from an imported module are initialized first.  If -builtin isn't used,
then the .py code is not re-ordered.

Added an explanation and workaround for the limitation that wrapped types are
not raise-able.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12585 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-01 19:35:30 +00:00
Stefan Zager
51ef340eed Converted rest of slot outputting to use printSlot.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12583 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-31 21:26:12 +00:00
Stefan Zager
f1cb5b7ca6 Bug fix: missing quotation mark on autodoc string
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-31 20:37:23 +00:00
Stefan Zager
bc200998b1 Added usage message for -builtin, and tweaked -builtin docs.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12574 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-30 19:51:22 +00:00
Stefan Zager
3d444101d1 A slew of changes based on William Fulton's code review.
- Fixed naming conventions; SwigPyBuiltin is used a lot
- Removed use of std::vector
- builtin.swg isn't included if -builtin isn't specified
- Changed many feature names to use a "python:" prefix
- Eliminated static vars in std_pair.i
- Eliminated C++-style comments (//)
- Enabled autodoc and docstring with -builtin
- Fixed non-ansi generated C code
- Detect and complain if two incompatible swig modules are loaded
- Removed argcargvtest_runme3.py, and fixed argcargvtest_runme.py
  so that 2to3 handles it better
- Removed anonymous namespaces
- Eliminated builtin_init typemaps; consolidated functionality into
  SWIG_Python_NewPointerObj
- Eliminate printf warnings from %U conversion character by switching
  to %S, which works just as well
- Fixed li_std_set_runme.py for python3, which returns set members in
  a different order from python2





git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12562 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-29 06:57:02 +00:00
Stefan Zager
93499e12af Merged trunk up to revision 12551
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12552 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-24 05:46:05 +00:00
William S Fulton
a63d456f8a Remove redundant code highlighted by warnings in gcc-4.6
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12536 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-14 07:22:08 +00:00
William S Fulton
5f4d8c6112 Fix SF #3194294 - corner case bug when 'NULL' is used as the default value for a primitive type parameter in a method declaration.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12525 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-09 22:31:08 +00:00
William S Fulton
d008ab2bc6 Remove local mode editor setting - editors should be set up correctly for the whole of SWIG
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12517 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-03 19:42:43 +00:00
William S Fulton
cca5a76d91 Minor rewrites of some recent builtin changes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12516 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-03 19:39:48 +00:00
William S Fulton
908c37cef8 Coding style fixes for Python builtin changes added on the szager-builtin branch
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12515 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-03 19:34:18 +00:00