null chars, which are allowed in C++ and python, and proper
sizes:
you can use a shorter string to assign a char[6]:
x = "he\0l" -> x := {'h','e',0,'l',0, 0}
but you always get back in python the original size:
x := {'h','i','0','0',0, 0} -> "hi\0\0\0\0"
Better mapping of (char*)0, now you get a None in the python
side, and using None, you get a (char*)0, just like
all the other C++ pointers. Before (char*)0 was mapped
into python as "", or as seg. faults.
Better mapping of "", which is not None nor (char*)0.
Added more tests using primitive types with simple templates.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5687 626c5289-ae23-0410-ae9c-e8d60b6d4f22
typedef char namet[5];
const namet def_namet = {'h','o', 0, 'l','a'};
ie, char arrays with null embedded characters, and other odd
char[ANY] situations.
add the corresponding test to the primitive_types.i and runme files.
Marcelo
----------------------------------------------------------------------
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5685 626c5289-ae23-0410-ae9c-e8d60b6d4f22
for primitive types.
Finally, you can safetly write:
%apply int {enum Hello};
%apply long {size_t};
%apply int {MyIntClass};
or using references
%apply const int& {const enum Hello&};
%apply const long& {const size_t&};
%apply const int& {MyIntClass&};
and all the primitive typemaps(in, out, directorin, directorout,
constcode, throws, varin, varout) are safetly applied to the
desired types (including the proper conversions when needed).
In fact, the python.swg file now has no typemap
defined for enums, and only use the %apply directives
as above.
Now the primitive_types.i extensive test runs properly.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5683 626c5289-ae23-0410-ae9c-e8d60b6d4f22
(throw typemap).
- fix the examples with exception problems and warnings
- proper and consist treatment of basic types (short, unsigned char,...)
now all are checked for range and sign. Before, this was depending of
the use of parsing or no parsing, and/or the converter method, and/or
the use of directors, etc.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
the supported languages.
- Added keyword list for most of the languages that didn't
have one.
- "All keywords" warning support, through the -DSWIG_ALLKW
option.
Read the Changes.current
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5543 626c5289-ae23-0410-ae9c-e8d60b6d4f22
- Potential member variable and method name clashes remove by preceding with 'swig'
- consistent use of C++ booleans for the swig_disown flag across and within the modules that use this it in director code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5139 626c5289-ae23-0410-ae9c-e8d60b6d4f22
- Removed asserts
- The unused __DIRECTOR__ base class default constructor removed. I've used the conventional approach of having no default constructor rather than a private one (declaring it private doesn't serve any useful purpose when this constructor is not wanted).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5132 626c5289-ae23-0410-ae9c-e8d60b6d4f22
These were useless as they just produced a setter that gave a runtime error.
Exposes some missing varin SWIGTYPE[ANY] typemaps - they show up in the test-suite.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4843 626c5289-ae23-0410-ae9c-e8d60b6d4f22