Commit graph

264 commits

Author SHA1 Message Date
Olly Betts
36be36d618 Eliminate needless casting away const from string constants 2014-04-30 12:00:23 +12:00
William S Fulton
dc8428889e Ignored enum fixes.
C#/Java - Enums which have been ignored via %ignore and are subsequently
used are handled slightly differently. Type wrapper classes are now generated
which are effectively a wrapper of an empty enum. Previously in Java uncompilable
code was generated and in C# an int was used.
2014-04-08 23:25:27 +01:00
William S Fulton
cd2085aae7 Fixes for C enums used in an API and the definition of the enum has not been parsed.
For D, this fixes a segfault in SWIG.

Java, C#, D, Go now produce code that compiles, although the definition of the
enum is needed in order to use the enum properly from the target language.
2014-03-28 07:54:03 +00:00
William S Fulton
bbd8f85de4 Forward null fix for Coverity analysis 2014-03-20 19:14:53 +00:00
Vladimir Kalinin
2f3d93e93a Nested classes support is diversified, depending on the language capability. If the language cannot support nested classes, they will be unconditionally moved to the global namespace. If language module does not override Language::nestedClassesSupport() function, nested classes will be ignored, unless "feature:flatnested" is used. 2014-02-02 22:38:13 +04:00
Vladimir Kalinin
715e254e05 fixed enums & enum values language symbol table namespace
fixed skipping of %templates in %extend if they are in the wrong scope
2013-12-20 07:37:49 +04:00
Vladimir Kalinin
b4fef06c42 fixed %template within %extend, test added
fixed language symbol table nested classes name separator, test added
fixed %feature "flatnested" working with %extend
fixed Swig_offset_string for empty string
added simple template to save/restore values in current scope (readability reasons)
2013-12-19 02:11:22 +04:00
William S Fulton
7103a06849 Swig_offset_string moved to misc.c 2013-12-05 20:59:09 +00:00
Vladimir Kalinin
e1a4e11bea fixed out-of-scope nested class definitions, added a test
enabled nested C structs assignment (still disabled for Octave), added Java runtime test
fixed nested_private test case for Java & C#
2013-12-04 01:53:42 +04:00
William S Fulton
44a883a057 Cosmetics/code beautification of nested class support 2013-11-29 07:29:58 +00:00
Vladimir Kalinin
b63c4839fe Nested classes support
Closes #89
Squash merge branch 'master' of https://github.com/wkalinin/swig into wkalinin-nested

By Vladimir Kalinin
* 'master' of https://github.com/wkalinin/swig:
  CPlusPlusOut mode for Octave
  nested class illustration
  fixed "Abstract" flag for nested classes added an example enabled anonymous nested structs runtime test
  porting
  warnings disabled
  porting fixes
  java runtime tests ported
  nested class closing bracket offset fixed
  removed double nested template (not supported by %template parsing)
  template_nested test extended
  parent field made public
  property access fixed
  replaced tabs with spaces
  warning W-reorder
  deprecated warnings removed, derived_nested runtime test added
  optimized string indenting
  Nested classes indenting
  nested classes docs
  fixed the order in which flattened inner classes are added after the outer
  Private nested classes were getting into the type table.
  Java getProxyName() fix for nested classes fixes the case when nested classes is forward declared
  Fix for a case when a nested class inherits from the same base as the outer. (Base class constructor declaration is found first in this case)
  merge fix
  nested C struct first immediate declaration incorrectly renamed sample fixed
  tests updated to reflect nested classes support
  Java nested classes support (1)
  flattening should remove the link to the outer class
  access mode correctly set/restored for nested classes
  nested templates should be skipped while flattening (template nodes themselves, not expanded versions) also non-public nested classes should be ignored
  If nested classes are not supported, default behaviour is flattening, not ignoring flag "nested" is preserved, so, the nested classes can be ignored by user
  nested workaround test updated
  template instantiated within a class is marked as nested for ignoring purposes
  %ignore not applied to the nested classed, because "nested" flag is set too late
  typedef name takes precedence over the real name (reason?)
  unnamed structs should be processed for all the languages
  nested C struct instances are wrapped as "immutable"
  tree building
  typedef declaration for unnamed C structures fixed
  nested classes "flattening"
  fixed %ignoring nested classes
  renamed "nested" attribute to "nested:outer" added "nested" flag, to be used with $ignore (it is not removed while flattening) added nestedClassesSupported() function to the Language interface
  renamed "nested" attribute to "nested:outer" added "nested" flag, to be used with $ignore (it is not removed while flattening) added nestedClassesSupported() function to the Language interface
  tree iteration fix
  dirclassname variable names unified memory issue fixed
  merge error
  ignore unnamed structs for C++
  unnamed nested C structs naming & unnesting
  class added to classes hash under typedef name
  private nested classes skipped
  test updated due to nested templates support
  anonymous structs with inheritance fixed nested_class test to allow anonymous structs w/o declarator
  tests updated: nested workaround removed from namespace_class.i propagated nested template declaration to the C++ file
  injected members scope
  nested tempplates fixes, nested structures in "C" mode parsing added utility function "appendSibling" (like "appendChild")
  nested unnamed structures parsing fixes, access mode restored on nested class end, tdname is properly patched with outer class name prefix
  memory management fixes
  nested templates (1)
  Nested unnamed structs
  Nested class support (1)
  Nested class support (1)
2013-11-29 07:02:34 +00:00
William S Fulton
e717ed3056 Improve directorthrows patch
Separate $packagepath substitution from non-director code (as
documented). Some of the directorthrows code has been rewritten
so that fewer code changes are present compared to before the patch.

canonicalizeJNIDescriptor() refactored so it can be used for general
code, not just the directorin:descriptor typemap attribute.

Better implementation for substituting '$packagepath/$javaclassname' -
fixes some quirks in '$packagepath/$javaclassname' descriptor substitutions
if a dot was present in the descriptor string.
2013-10-31 23:16:09 +00:00
William S Fulton
cf4f5e8118 More conventional variable naming in directorExceptHandling 2013-10-24 08:03:33 +01:00
William S Fulton
fc13a24ecb directorthrows warning fixes
- Fix line number display - now the usual simpler warning message can be displayed
for WARN_TYPEMAP_DIRECTORTHROWS_UNDEF - it still points to the problem method.
- Use macro names for warning suppression in test.
2013-10-24 07:45:56 +01:00
William S Fulton
88678ed492 director:except tweaks Recode whitespace handling, remove unnecessary comments in generated code. 2013-10-24 07:06:55 +01:00
William S Fulton
f55e0092ef Remove pointless code from Java director:except patch 2013-10-23 18:43:36 +01:00
William S Fulton
97fd20a58d Minor improvements to Java director:except patch 2013-10-23 18:43:13 +01:00
William S Fulton
9237c4553c Code style conforming channges for Java director:except patch 2013-10-23 18:26:41 +01:00
Marvin Greenberg
6736e74127 Add feature director:except for improved director exception handling in Java
Closes #91
2013-10-22 20:44:35 +01:00
William S Fulton
67659773cc Remove some Java references from C# module 2013-09-02 19:14:20 +01:00
William S Fulton
3f9d7ed416 Minor fixes after Coverity analysis 2013-05-16 08:13:56 +01:00
William S Fulton
296498c159 Cosmetic tidyup in smartptr feature code and document smartptr fix in previous commit 2013-04-17 21:56:23 +01:00
William S Fulton
e182b4844c Fix seg fault in SWIG using directors when class and virtual method names are the same except being in different namespaces when the %nspace feature is not being used. 2013-03-19 19:50:44 +00:00
William S Fulton
397409fbb1 Ensure 'javapackage' typemap is used as it stopped working from version 2.0.5 2013-01-30 22:18:13 +00:00
Brant K. Kyser
3654031d4f Repair typo from previous commit. 2013-01-19 01:27:34 +00:00
William S Fulton
bd3e93ae61 Tidy up last few commits for Java new jniclasspackage pragma 2013-01-19 00:58:56 +00:00
William S Fulton
36ce54da8d Whitespace fixup 2013-01-19 00:34:05 +00:00
Brant K. Kyser
9318ece01f Use NSPACE_SEPARATOR rather than literal. 2013-01-17 08:13:05 +00:00
Brant K. Kyser
f7e27ec7a9 Fix issue with using directors with the nspace feature without the -package commandline argument. 2013-01-17 08:13:05 +00:00
Brant K. Kyser
ace33bbf41 Fix issue with using directors with the nspace feature without the -package commandline argument. 2013-01-17 08:13:04 +00:00
Brant K. Kyser
7104b20d0d imclass_class_package variable names seems to have class in it one too many times... renamed to imclass_package. 2013-01-17 08:13:04 +00:00
Brant K. Kyser
862d27f05a Fix issue of package directory not being created when using jniclasspackage pragma. General cleanup of implementation. 2013-01-17 08:13:04 +00:00
Brant K. Kyser
3bdcb14117 Add jniclasspackage pragma & change error regarding use of nspace without -package to warning. 2013-01-17 08:13:03 +00:00
William S Fulton
7841a0d097 Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
Brant K. Kyser
e1a59ae2c7 Clean up local variable name that store the director class's name to prevent confusion with the class name. 2013-01-08 21:38:57 -06:00
Brant K. Kyser
54b576d8b2 Merge in upstream changes 2013-01-05 02:26:15 -06:00
William S Fulton
328d6d01bb Cosmetic whitespace change 2013-01-04 20:35:13 +00:00
Brant K. Kyser
d5d7655544 Merge branch 'master' into SFbug1299 2013-01-03 21:26:47 -06:00
Brant K. Kyser
f6ce5f089f Qualify generated SwigDirector class names with namespaces 2013-01-03 21:26:08 -06:00
Brant K. Kyser
540ede0dd3 Fix for SourceForge Bug #1283.
* Change the name of the memory own variable for base java director classes to match that expected by the director code
* Add conditional to appropriately dynamically cast director classes wrapped in smart pointers.
2013-01-04 00:31:55 +00:00
Brant K. Kyser
3e70da14c9 Fix for SourceForge Bug #1283.
* Change the name of the memory own variable for base java director classes to match that expected by the director code
* Add conditional to appropriately dynamically cast director classes wrapped in smart pointers.
2013-01-03 14:54:06 -06:00
Brant K. Kyser
7ff0dfe426 Fix for SourceForge Bug #1278
* Modify test-suite to test Java directors with multi-level namespaces.
* Path java module to correctly generate method descriptors when multilevel namespaces are used.
2013-01-02 15:07:56 -06: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
660b15ea5a Correctly handle errors if language symbol already exists
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13913 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-19 19:46:21 +00:00
William S Fulton
e0967f3e13 Fix unnecessary and inconsistent null pointer checks
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13912 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-19 19:44:48 +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
fd24b188e2 Fix Coverity 'Uninitialized pointer fields' - member variables are now initialized
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13887 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-14 22:17:28 +00:00
William S Fulton
46d2486115 Resource leak fixes (or hiding them from Coverity static analysis tool by using String instead of char *)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13886 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-14 22:16:54 +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