Commit graph

539 commits

Author SHA1 Message Date
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
William S Fulton
5c6646fc3f Visual Studio .NET 2003 solution and project files added
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5606 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-07 21:45:20 +00:00
William S Fulton
a9315a5af1 Warning fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5605 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-07 21:34:12 +00:00
William S Fulton
7381bddd84 Warning fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5604 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-07 21:27:23 +00:00
William S Fulton
ae9b0c90e4 Added a reference polymorphic return type case test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5599 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-28 21:08:18 +00:00
William S Fulton
2dc773e643 Suppress warnings about covariant return types in Java and C#.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5598 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-28 21:06:52 +00:00
Marcelo Matus
ac011192ae added a reference polymorphic return type case, and
some extra test for the Java side.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5596 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-24 06:53:47 +00:00
William S Fulton
a7844fd600 Downcast not needed for narrow() call.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5595 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:59:40 +00:00
William S Fulton
8c78e18f7c Cast not needed for narrow() call.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5594 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:59:27 +00:00
William S Fulton
f9e55f5ec8 C# runtime test, based on Java one.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5593 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:51:46 +00:00
William S Fulton
c81661122e Fix test by using downcasts
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5592 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:51:19 +00:00
Marcelo Matus
394aacb890 using static narrow methods instead of %extended ones.
now it looks more natural and similar to the CORBA downcasting mechanism.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5587 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 10:10:04 +00:00
Marcelo Matus
bbeeed588b added the ruby runtime case and more comments.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5584 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 10:41:33 +00:00
Marcelo Matus
8c7824b76e fix bad variable name in example
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5583 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 06:32:02 +00:00
Marcelo Matus
c85521c002 Added a simple example where the current universal
Java wrapping mechanism doesn't work, showing the
need to use a different way to wrap polymorphic classes.

They are two runtime examples: one for java, which is
failing, and one for python, which works fine.

Detailed description of the case can be found
in the three files committed.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 06:26:44 +00:00
Marcelo Matus
708021a809 These is the current tests for the friend function support.
They will give you and idea of what is currently working.

If you have another case you think we need to test, please
send me an email to add it and trying it here.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5581 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-20 07:46:27 +00:00
William S Fulton
6bd65bba28 Test typemaps are being found for templated classes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5564 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-14 00:17:22 +00:00
William S Fulton
feae681f4e arrays of structures runtime test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5563 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-14 00:02:33 +00:00
Marcelo Matus
409dff398b added a new broken director case. the fix is simple but
it will require to modify lang.cxx, so, it will
wait the next release.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5561 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 09:05:54 +00:00
William S Fulton
fc6bdd5217 Director protected method wrapping tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5559 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 00:21:17 +00:00
William S Fulton
0116de6769 Added %javamethodmodifiers check
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5558 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 00:20:42 +00:00
William S Fulton
87cd33a6d6 Added missing function body which was causes linker errors
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5552 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-12 23:19:07 +00:00
William S Fulton
76e67c8cee *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5542 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 21:44:56 +00:00
William S Fulton
d71d6d1d85 Added test for %import
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5540 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 21:33:34 +00:00
William S Fulton
121f9b5740 Added test for %import
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5537 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 21:18:21 +00:00
William S Fulton
55c4bf307f base() changed to basemethod() - base is a C# keyword
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5536 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 21:16:21 +00:00
Marcelo Matus
9c372c5c64 Fixed more %rename errors, and moving
the function 'need_protected' outside parser.y,
ie, if more subtle cases appear, they can be
fixed without changing parser.y.

Now parser.y looks much more like the original 1.32.

 Source/CParse/parser.y: moving and fixing 'need_protected'
 Source/CParse/util.c:  moving and fixing 'need_protected'
 Examples/test-suite/director_protected.i: more %rename cases
 Examples/test-suite/director_using.i: fixing bad module name

The errors in question where related to the mix of
%rename + (typedef|static)  + protected + dirprot_mode:


%rename(s) Foo::p;
%rename(q) Foo::r;

%inline {
class Foo {
public:
  virtual ~Foo() {}

  int p(){ return 1;}
  int r(){ return 1;}

protected:

  typedef int q();
  static int s();
};

since q and s look like functions, the parser was adding them
completly to the symbol table, and clashing latter with the
attemped renames.

The error was only visible when dirprot was enabled, with
the old behavior it was ok.

Marcelo


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5533 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 03:59:18 +00:00
Marcelo Matus
72984676ca Lateral change to add runtime "reprotection" at the python
side for protected director members.

Lib/python/director.swg: added needed code for runtime checking
Source/Modules/python.cxx: added needed code for runtime checking
director_protected_runme.py: checks now that the runtime protection is working


The extra runtime checking is only done for protected members,
so, the old public directors members don't feel any overhead.

This finished the director protected support for the python language.
Java and Ocalm will need to add the "reprotection" mechanism latter.
But as in the python case, the changes will be localized in the
languages files, and there will be no need to touch the core
files anymore.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5532 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 01:59:12 +00:00
Marcelo Matus
c41374becc %rename(x) Foo::y();
%inline %{
class Foo {
protected:
    void x();
public:
    void y();
};

%}

will work in plain or plain director mode, but it will complain the
same as before with director protected support.

The reason is that the parser emmits the warning, and at that stage it
is not possible to decide if the protected Foo::x() could or not
conflict with the renamed Foo::y(), since Foo::x() could be virtual,
even when no "virtual" attribute is used.



Core:
 parser.y: Detect the dirprot mode and prevents the generation of
           protected symbols at the parsing stage.
 lang.cxx: Export the director_protected_mode for parser.y and the
           director protected member detection is much cleaner.
 main.cxx: Fix the -dirprot flag, it was working in SWIG_FEATURE but
           not in the command line.(minor thing not relate to the error).
 swigmod.h: added Lang::dirprot_mode() for cleaner detection.
 utils.cxx: is_member_director() centralizes and improve the test.

Test suite:
 protected_rename.i: added %inline, so it can compile now.
 director_protected.i: more cases, checking using %rename.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5530 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-10 23:10:31 +00:00
Logan Johnson
b3b75149de *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5529 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-10 14:28:29 +00:00
Marcelo Matus
45ffdc02a3 added the using_pointers test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5527 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 23:48:54 +00:00
Marcelo Matus
f7e02f46fc fixed the problem with 'using' and protected mebers. now it seems to be safe to generate the protected members as protected again. all the test are running and the director_protected_runme.rb now test for the right access control
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5526 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 23:46:39 +00:00
Marcelo Matus
66ae9df8b1 promote the 'using' methods to public. Also, fix a sef. fault for using with pointers, see using_pointers.i
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5525 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 23:24:37 +00:00
Dave Beazley
d18e73017f PHP OS X changes.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5519 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 18:53:39 +00:00