Commit graph

728 commits

Author SHA1 Message Date
Matthias Köppe
b661ffa634 Replace the "known_classes" hash table by a node attribute. Methods
of classes in C++ namespaces now get the proper specializer in the
GOOPS declaration.  Reported by rm@mh-freiburg.de.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5709 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-10 15:26:22 +00:00
Logan Johnson
c28431b42b Omit unused parameter names for C++ code only; this is illegal in C.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5702 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-09 23:08:54 +00:00
Logan Johnson
d43a3d22e4 Be sure to initialize all of the fields of a PyMethodDef struct to some
value, to avoid numerous compiler warnings.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5701 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-06 17:46:50 +00:00
William S Fulton
11ed0bc80b fix classLookup() to return consistent results when %ignore specified
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5697 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-03 21:19:19 +00:00
Matthias Köppe
6cf25c39da Fix typos in help text.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5695 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-01 12:01:49 +00:00
Marcelo Matus
2f9749cb04 cosmetic fix to avoid warnings in the generated code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5694 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-28 01:47:19 +00:00
Marcelo Matus
9b4df57aa4 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@5690 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-27 23:39:35 +00:00
Marcelo Matus
8a9803addf fix memory leak with director and NewPointerObjects
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5688 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-26 10:20:06 +00:00
Marcelo Matus
2625795a82 add support for 'throw' declarations in director classes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5682 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-24 00:28:54 +00:00
Marcelo Matus
94405ed6eb add support for 'throw' declarations in director classes and some fixes to compile the primitive_types.i test file
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5681 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-24 00:25:31 +00:00
Matthias Köppe
13aa3aa794 Uniquify the argument names used in GOOPS method declarations.
Reported by rm@mh-freiburg.de.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5677 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-23 15:05:34 +00:00
William S Fulton
238e948bbe Eric Sunshine patch - Mods to work on NextStep
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5674 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 22:42:18 +00:00
Marcelo Matus
4a50816ddb simple in fix the %new cleanup and the destructor handler
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5670 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 08:00:49 +00:00
Marcelo Matus
d02ce4b533 sorry, last commit was from an older version
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5669 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 07:17:05 +00:00
Marcelo Matus
4e40e430cf more comments and cases in the unrollVirtual method, still there is one that is not working...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5668 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 07:07:41 +00:00
William S Fulton
643da18a02 forte warning fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5663 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 21:27:43 +00:00
Marcelo Matus
91ea054303 fix the generation of spurious temps, and an exception call
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5660 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 01:33:07 +00:00
Marcelo Matus
7b6925d8ca better treatment of the '0' director methods case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5658 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 01:04:50 +00:00
Marcelo Matus
6b0485b6b5 fixes for the nodirector feature and the '0' director member case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5657 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 00:46:08 +00:00
William S Fulton
83a6039fa6 Removed redundant catch(...) { throw; } code generation when wrapping exception specifications and throws typemap.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5646 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-19 21:34:58 +00:00
William S Fulton
8377edf02a Various warning fixes for .NET 2003 cl /W4 to work barring one warning and for gcc -ansi -Wall -pedantic to be warning free:
const fixes and function prototype declarations matching the definition etc


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5639 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-15 22:46:07 +00:00
Marcelo Matus
48d11474ee - Normalize the 'Swig_error' calls and formats, before some
of the strings start like "Error. XXX", others like "XXX".
  The format is now defined in 'error.c:Swig_error_msg_format()'.

- Normalize the multiline error/warning messages to correctly
  use -Fformat definition.

- Centralize the error/warning format definitions in
  'error.c:Swig_error_msg_format()'.

- Fix a minor error in cpp.c, that after finding an error, still
  was emitting a redefined macro, producing duplicated error/warning
  messages in parser.y.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5635 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-15 08:33:12 +00:00
Marcelo Matus
aa8b13473e 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@5634 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-15 08:16:53 +00:00
Marcelo Matus
74922d7e03 eliminate spurious temporal variables
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5631 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-14 06:46:20 +00:00
Marcelo Matus
83f9a5a212 added friend dec support
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5623 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 01:20:37 +00:00
Marcelo Matus
1c31ef71f3 fixed repeated file inclusion for dirprot mode
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5622 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 01:19:48 +00:00
Marcelo Matus
826771ec31 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@5621 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 01:12:53 +00:00
Marcelo Matus
17b2dbcc0b added docs for -Werror and -w<list>
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5619 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 00:46:59 +00:00
Marcelo Matus
125e09c220 improved warning for abstract classes and fixed a spurious warning for smart_pointers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5618 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 00:43:44 +00:00
Marcelo Matus
b32024f2ab fix precatching exception behaviour to postcatching
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5617 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-12 23:40:58 +00:00
William S Fulton
e684591411 Warning and error messages output is selectable via commandline options
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5613 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-10 00:08:18 +00:00
Dave Beazley
629e32daec Fixed [ 871909 ] simple namespace problem.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5611 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-09 19:36:58 +00:00
William S Fulton
62ba646c89 Moved non static function declarations from source files into header files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5602 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-28 21:48:39 +00:00
William S Fulton
9e35a6e442 Marcelo's patch which fixes virtual:type attribute always being set.
Removes incorrect warnings about covariant return types in Java and C#.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5597 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-28 21:06:02 +00:00
William S Fulton
cf3a5e6222 Covariant return type fixes...
Fixed error where the base class was being used to wrap the derived class C++ pointer.
Emit a warning when encountering these return types as the return type is changed to the base class type.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5590 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:46:56 +00:00
William S Fulton
0af36656c1 Covariant return type fixes...
Fixed error where the base class was being used to wrap the derived class C++ pointer.
Also fixed runtime error when using directors - the wrong canonical description was not using the base class type.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5589 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:45:38 +00:00
Art Yerkes
98e493b6fa Added suffix arg for c output.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5588 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 20:31:06 +00:00
Logan Johnson
6d30946aa4 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5586 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 17:23:02 +00:00
Logan Johnson
bc186c445c Fix for virtual_poly.i test case.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5585 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 17:12:06 +00:00
Dave Beazley
7e526a0b21 Turned on shadow classes by default.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5577 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-17 19:09:36 +00:00
Dave Beazley
80a9062f1d Removed config.h
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5576 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-17 19:09:17 +00:00
Dave Beazley
6a6403d2bc Suppress warning 321 by default.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5572 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-16 03:43:51 +00:00
Dave Beazley
b29f77f801 Weakened constructor name check to work around nested-class hack reported by
Gustavo Niemeyer.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5565 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-14 15:42:32 +00:00
William S Fulton
66a19d43b0 remove SWIG_exception for director protected methods.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5562 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 23:52:31 +00:00
William S Fulton
c6de7c0de6 -dirprot display order
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5554 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 00:16:08 +00:00
William S Fulton
baa06d2509 %javamethodmodifiers (java) and %csmethodmodifiers (C#) operate slightly differently.
Previously this had to be present to set the method modifiers. Now this feature is only
used if it exists for the method being wrapped. The default is "public" as previous
however, when wrapping protected director methods it is "protected".


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5553 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 00:13:10 +00:00
Marcelo Matus
0c01d1edcc swig -DSWIG_ALLKW was too ugly. Use -Wallkw instead. Reverting swig.swg
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5545 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-12 06:12:29 +00:00
Marcelo Matus
beb5d78df2 bad spelling in warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5544 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-12 06:09:53 +00:00
Marcelo Matus
14d87ed24d 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@5532 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 01:59:12 +00:00
Marcelo Matus
7335663344 %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@5530 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-10 23:10:31 +00:00