Commit graph

572 commits

Author SHA1 Message Date
Marcelo Matus
135a367a2e fix template complex
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5756 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-03-17 09:43:35 +00:00
William S Fulton
93492cfe6a All tests now use the -namespace commandline option
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5740 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-24 21:06:54 +00:00
William S Fulton
d3d9210bd0 Replace ; with && where appropriate. This fixes the makefiles so that Make correctly errors out rather than blindly carrying on when some error occurs.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5731 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-20 22:57:23 +00:00
William S Fulton
f4a2470325 overloading when SWIG cannot disambiguate parameters tests added
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5711 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-12 21:45:11 +00:00
Marcelo Matus
2c15a0a2b1 add argcargv test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5708 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-10 10:02:33 +00:00
Marcelo Matus
4e3d516cee now use the new argcargv.i
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5707 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-10 09:55:58 +00:00
Marcelo Matus
7fef280ae0 Added the ref/unref 'recursive' featues. See refcount.i for details
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5705 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-10 09:21:36 +00:00
Marcelo Matus
2a573e9a08 Keep the old non-resolved type str and add the fully
resolved one if is needed.

Add examples showing the problem with SWIG_TypeQuery
and template+typedef and the old type str, and how
it works now.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5704 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-10 08:37:30 +00:00
William S Fulton
b0bb8b7158 New test case testing some broken aspects of %feature
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5698 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-04 21:05:39 +00:00
Marcelo Matus
c856fbdde1 added another simple method
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5696 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-02 21:11:28 +00:00
Marcelo Matus
f1ed62c2a2 add complex test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5693 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-28 01:38:59 +00:00
Marcelo Matus
3f1f31d1e8 Fix long long and other warnings.
Add the macros

%typemap_asfromcheck()
%typemap_asfrom()

that can be used to defined all the different typemaps
for types where the As/From/Check methods are provided.

All the basic type (int, char,...) typemaps are implemented
using them.

The std::string and std::complex<T> are reimplemented using
the new %typemap_asfrom/check macros too. This helps to complete
all the previously missing typemaps (consttab, varin, varout,..)
and also ilustrates how to define the As/From/Check methods
to use with the %typemap_asfrom/check macros.

As a byproduct, the C complex typemap was added, and the file

complex.i

can be used to load the complex support for either C or C++. The
original C++ std_complex.i is still there, and the corresponding C
ccomplex.i too, if they need to be included explicitly.

Also, the As/From methods are declared via %fragment, so, they
can be reused as needed, and only appear in the wrapped code if
they corresponding typemap is invoked, making the typemaps
and the entire code shorter and simpler.


Marcelo.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-28 01:30:13 +00:00
Marcelo Matus
6dceec6fdb Simple patch to allow fragments to include other fragments:
%fragment("Hello","header") "..."

%fragment("Hi","header",fragment="Hello") "..."

the latter fragment will include the first one if is invoked.

more than one fragment can be included at the time, just
keep adding fragment="f1",fragment="f2", etc.

this is used to emulate typemaps reuse, where all the
reusable typemap code is put in a fragment static method,
and then it can be included from another fragment typemap
as needed.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5690 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-27 23:39:35 +00:00
Marcelo Matus
c429cdb9fc add support for char* to accepts char* :), before
they only accept PyStrings.

now the raw pointer from calloc.i, for example, works
fine.

some of the SWIG_PyObj_(As|From)XXX routines are getting
too large, so, they also will go into the runtime library.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5689 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-26 11:55:22 +00:00
Marcelo Matus
839f109a81 Better mapping of char[ANY] in python, including embedded
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
2004-01-25 09:45:18 +00:00
Marcelo Matus
59e7aca99a properly manage the strange but valid case:
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
2004-01-24 07:20:59 +00:00
Marcelo Matus
1a8089a2d4 add extensive tests for the primitive types, it will crash in almost every language now, see the file for instructions about some typemaps that need to be fixed
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5680 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-24 00:21:02 +00:00
William S Fulton
c24953d678 Fixes to link on Cygwin
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5675 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 22:43:32 +00:00
Marcelo Matus
308387b7a3 added refcount example using the old macro way and the proposed ref/unref features
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5667 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 06:26:17 +00:00
Marcelo Matus
c92d8c7cf7 added test for simple virtual derivation, where ruby fails
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5666 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 06:23:57 +00:00
Marcelo Matus
05d6e6b04f also, change the module name to director_frob
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5665 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 00:52:06 +00:00
Marcelo Matus
e524a03a55 using better names for frob
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5664 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 00:41:37 +00:00
William S Fulton
c4d49d6c2a Improved runtime tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5661 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 21:23:31 +00:00
Marcelo Matus
54737ee9a9 - recover the proper catching exception mechanism for classes
(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
2004-01-21 01:15:10 +00:00
Marcelo Matus
9cfb9a490b fixes for the nodirector feature and the '0' director member case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5657 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 00:46:08 +00:00
William S Fulton
c2d143e442 Memory management fixes and comment corrections
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5656 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-20 21:28:29 +00:00
William S Fulton
4039bf8075 Added missing delete
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5655 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-20 21:27:59 +00:00
William S Fulton
00a87d5a4b Added missing tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5654 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-20 21:27:27 +00:00
William S Fulton
5941257668 .cvsignore
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5653 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-20 21:25:32 +00:00
William S Fulton
636a5db77a All the runtime scripts are called runme.pl now for easier testing
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5652 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-20 21:24:12 +00:00
William S Fulton
8d4c509404 All the runtime scripts are called runme.tcl now for easier testing
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5651 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-20 21:22:56 +00:00
Marcelo Matus
8e73549052 add wrapmacro
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5650 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-20 20:54:12 +00:00
Marcelo Matus
10f3808329 add python runme
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5648 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-20 20:49:05 +00:00
Marcelo Matus
fe460c4c53 add file to test macro wrapping techniques
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5641 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-17 00:56:31 +00:00
Marcelo Matus
dde72e892f added more ugly 'self' cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5640 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-15 22:59:55 +00:00
Marcelo Matus
cbcb2216b8 added new testing case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5638 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-15 09:58:09 +00:00
Marcelo Matus
74d6f1eb43 Added the warning code
WARN_PARSE_REDUNDANT          322

similar to the g++ -Wredundant-decls flag.

This recovers the warnings that now are not been reported by
the original code

   WARN_PARSE_REDEFINED          302

Redundant example:

   int foo(int);
   int foo(int);

Redefined example:

   int foo(int);
   double foo(int);


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5634 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-15 08:16:53 +00:00
Marcelo Matus
eaa0062cd2 Fix for friend declarations, and other 'repeated' declarations.
Now, this doesn't generate warnings:

 class A; class B*;

 int foo(A*, B*);

 struct A {
   friend int foo(A*, B*);
 };

but this generates

 struct B {
   friend double foo(A*, B*);
 };

which is correct, since they have different return types.

See the redefined.i file for most cases where
repeated (but not redefined) declarations are
not generating warnings now, such as:

// no warning
#define REPEATED 1
#define REPEATED 1

// yes warning
#define REDEFINED 1
#define REDEFINED 2

this is following the C, C++ and preprocessor
standard behavior.

The function 'need_redefined_warn(..)' was added to
util.c, if some strange corner appears, and therefore,
the parser.y file doesn't need to be changed latter.

Also, the redefined warning format in parser.y
was changed, so now it respond to William's -Fmicrosoft
flag.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5633 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-15 03:16:40 +00:00
Marcelo Matus
b44aafbe68 eliminate spurious temporal variables
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5631 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-14 06:46:20 +00:00
Marcelo Matus
de5e00b97a added constructor case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5630 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-14 02:45:29 +00:00
Marcelo Matus
4bf191197f fix warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5629 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 02:52:25 +00:00
Marcelo Matus
f1178eabac added new test files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5627 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 01:39:27 +00:00
Marcelo Matus
6d1978b1ef added friend support and reduced spurious name(kw) warnings for non-wrapped symbols
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5624 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 01:32:13 +00:00
Marcelo Matus
66c06af171 added support for friend declarations and clean/fix the
unrollVirtualMethods for the error shown in the director_redefined.i
example.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5621 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 01:12:53 +00:00
Marcelo Matus
faee816f18 improved warning for abstract classes and fixed a spurious warning for smart_pointers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5618 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 00:43:44 +00:00
Marcelo Matus
386d53ce62 fix precatching exception behaviour to postcatching
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5617 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-12 23:40:58 +00:00
Dave Beazley
5b49cee830 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5612 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-09 19:37:24 +00:00
Dave Beazley
b8f98e8cad new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5610 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-09 19:32:08 +00:00
Dave Beazley
1f06d723a8 Fixed broken run script
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5609 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-09 18:32:44 +00:00
Dave Beazley
bd9c1752f3 Fixed run problem
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5608 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-09 18:32:31 +00:00