William S Fulton
c7da8bb06e
Warning fixes in generated Java code for 64bit Visual C++ on Windows.
2015-07-03 20:59:24 +01:00
Olly Betts
e796ecaa23
Fix swapped parameters in memset call
2015-05-12 14:20:11 +12:00
William S Fulton
6c1630b152
Fix Java multi-argument typemaps (char *STRING, size_t LENGTH)
...
Now they can be applied to a wider range of types.
Closes #385 .
2015-05-10 13:35:51 +01:00
William S Fulton
775afd3579
Refactor Java director swig_override array code
...
Remove code duplication: Use new Swig::BoolArray to replace multiple
instances of ZeroedBoolArray.
Refactors #403 and #413 .
2015-05-10 11:40:42 +01:00
William S Fulton
ea1b6e8ed5
Memory leak in java directors when passing byte arrays (char*, size_t)
...
When passing a byte array from c++ to Java using the director feature, the generated jni code does not release a temporary byte array.
This is the typemap specified in Java.swg:
%typemap(directorin, descriptor="[B") (char *STRING, size_t LENGTH) {
jbyteArray jb = (jenv)->NewByteArray($2);
(jenv)->SetByteArrayRegion(jb, 0, $2, (jbyte *)$1);
$input = jb;
}
%typemap(directorargout) (char *STRING, size_t LENGTH)
%{(jenv)->GetByteArrayRegion($input, 0, $2, (jbyte *)$1); %}
Notice that the call to NewByteArray doesn't contain a symmetric release logic as the SetByteArrayRegion/GetByteArrayRegion does.
Closes #386
2015-04-23 19:17:35 +01:00
William S Fulton
25b48b85ec
Fix multiple definitions of 'ExceptionMatches' when using directors and multiple modules.
...
Java problem, closes #353 and closes #355 .
2015-04-11 22:51:29 +01:00
Witold Wolski
70cccf38fd
add @SuppressWarnings("unused") to constructors generated using SWIG_JAVABODY_TYPEWRAPPER macro
2015-02-04 10:12:37 +01:00
William S Fulton
0d34a0f0bf
Merge branch 'pingany-director_local_jstring_leak'
...
* pingany-director_local_jstring_leak:
Use more conventional naming for generated Java LocalRefGuard variables
Make more use of LocalRefGuard in Java
fixup! Patch of http://sourceforge.net/p/swig/mailman/message/29816385
Patch of http://sourceforge.net/p/swig/mailman/message/29816385
2014-09-27 14:33:31 +01:00
William S Fulton
f4964f5fb3
Use more conventional naming for generated Java LocalRefGuard variables
2014-09-27 14:32:03 +01:00
William S Fulton
2f5bf397ae
Make more use of LocalRefGuard in Java
2014-09-27 13:56:11 +01:00
Pingan Yi
f38f6371a3
fixup! Patch of http://sourceforge.net/p/swig/mailman/message/29816385
2014-08-13 16:14:57 +08:00
William S Fulton
1773726073
Doc/comment improvements in Java various.i
2014-08-04 19:22:02 +01:00
Yuval Kashtan
093fe2a556
Add support for java.nio.Buffer
...
including test-suite test case and documentation
2014-07-18 15:45:16 +03:00
Pingan Yi
b79646ce4c
Patch of http://sourceforge.net/p/swig/mailman/message/29816385
2014-05-04 19:10:44 +08:00
William S Fulton
f01c84cd8b
Java enums - remove redundant typemaps
2014-03-28 07:45:23 +00:00
Curtis Dunham
fe91d6449f
Remove register storage class declarations
...
They're unnecessary, anacronistic, deprecated in modern
standards, generally ignored, useless, and (most importantly)
clang complains about them.
2014-02-19 11:58:27 -06:00
Marvin Greenberg
843aa7cd65
Work around differences in clang libc++ std::vector<bool>::const_reference
...
clang++ using -stdlib=libc++ defines const_reference as a class,
to map boolean vectors onto a bit set. Because swig does
not "see" the type as "const &" it generates incorrect code for this case,
generating a declaration like:
const_reference result;
When const_reference is a typedef to 'bool' as is the case with stdlibc++
this works. When this is actually a constant reference, this is clearly
invalid since it is not initialized. For libc++, this is a class
which cannot be default constructed, resulting in an error. The fix
is to explicitly define the various accessor extensions as having a
bool return type for this specialization.
2014-02-04 16:00:12 -05:00
William S Fulton
cc650e692e
Director exceptions now derive from std::exception
2014-01-20 19:40:52 +00:00
William S Fulton
1a19451c1b
Error out attempting to use directors without -c++
...
Remove redundant #ifdef __cplusplus markers in director.swg
2013-12-23 20:23:54 +00:00
William S Fulton
135a7cc558
Beautify director.swg files
...
Also some comment corrections for Perl
2013-12-23 19:50:41 +00:00
Vadim Zeitlin
ed28725a15
Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>.
...
These typemaps are currently defined for C#, Java and Python only and the
tests are provided only for these languages.
Also add a brief description of the new header to the documentation.
2013-12-03 23:45:20 +01:00
William S Fulton
e7a6be289e
Rework the director.swg changes for director exception handling
...
- More robust implementation.
- Fix some bugs to give better exception messages when a user uses the
director utility exception functions and classes.
- Replace unnecessarily shortened variable names for easier reading of
code.
2013-11-07 22:51:35 +00:00
William S Fulton
fdc1772e38
Cosmetics/code style conformance in newly added Java director exception handling
2013-11-07 22:51:34 +00:00
William S Fulton
97fd20a58d
Minor improvements to Java director:except patch
2013-10-23 18:43:13 +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
bcb7aee022
Merge branch 'master' into gsoc2009-matevz
...
Conflicts:
Examples/Makefile.in
Examples/guile/Makefile.in
Lib/php/php.swg
Makefile.in
Source/CParse/parser.y
configure.ac
2013-10-10 07:26:09 +01:00
Gavin Kinsey
43032339d0
Fixed a memory leak for java STRING_ARRAY
...
The allocation loop uses size, so the free loop should do the same,
not size-1.
2013-09-20 18:44:44 +01:00
Marvin Greenberg
d0202cbdac
Fix typecheck OUTPUT typemaps for Java
2013-04-10 18:37:26 +01:00
William S Fulton
e805d5f925
Merge branch 'master' into gsoc2009-matevz
...
parser.y still to be fixed up
Conflicts:
Doc/Devel/engineering.html
Examples/Makefile.in
Lib/allegrocl/allegrocl.swg
Lib/csharp/csharp.swg
Lib/csharp/enums.swg
Lib/csharp/enumsimple.swg
Lib/csharp/enumtypesafe.swg
Lib/java/java.swg
Lib/python/pydocs.swg
Lib/r/rtype.swg
Source/Include/swigwarn.h
Source/Modules/octave.cxx
Source/Modules/python.cxx
Source/Modules/ruby.cxx
Source/Swig/scanner.c
Source/Swig/stype.c
Source/Swig/swig.h
configure.ac
2013-01-28 07:01:37 +00:00
William S Fulton
285198c48f
Add rvalue reference typemaps
2013-01-24 20:27:27 +00:00
William S Fulton
bd67f57921
Convert to unix fileformat
2013-01-12 16:54:37 +00: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
William S Fulton
d1bc8b5b21
Add caveat emptor for peek method in Java directors
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13838 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-13 19:18:25 +00:00
William S Fulton
863c25f9b8
Possibly incorrect DeleteGlobalRef call on a weak global reference in Java directors - patch from Marvin Greenberg
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13837 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-13 19:05:25 +00:00
William S Fulton
b38722e8ee
Apply patch for Java to fix direct use of a weak global reference in directors sometimes causing seg faults especially on Android.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13834 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-13 19:02:02 +00:00
William S Fulton
593c708a78
Fix (char *STRING, size_t LENGTH) typemaps to accept NULL string
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13736 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-07 06:07:20 +00:00
William S Fulton
12a9671440
std::string typemap modifications so they can be used with %apply for other string classes
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13120 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-26 06:33:49 +00:00
William S Fulton
4dfe131207
Fix unintended uninitialised memory access in OUTPUT typemaps
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13074 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-11 23:55:54 +00:00
William S Fulton
d9393bc22a
Fix possible uninitialised memory access in char **STRING_OUT typemap
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13073 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-11 23:13:55 +00:00
William S Fulton
0ebcf05637
Fix uninitialised size variable in char **STRING_ARRAY regression
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13072 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-11 23:13:35 +00:00
William S Fulton
a0e21e82ca
char **STRING_ARRAY typemaps fixed to handle null pointers
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13021 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-28 14:29:23 +00:00
William S Fulton
15c4a30d9f
Make generated support functions in arrays_java.i static for multiple module linking
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12906 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-02-16 07:14:18 +00:00
William S Fulton
4c898b023c
The 'directorin' typemap now accepts , etc expansions instead of having to use workarounds - _name, _name etc.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12879 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-21 07:16:44 +00:00
William S Fulton
468ca084fc
Correct special variables in 'directorargout' typemap. This change will break any 'directorargout' typemaps you may have written. Please change: to and to \n Also fix the named 'directorargout' DIRECTOROUT typemaps for these languages which didn't previously compile and add in , etc expansion.\n [C#, Go, Java, D] Add support for the 'directorargout' typemap.\n [Java] Add (char *STRING, size_t LENGTH) director typemaps.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12877 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-20 20:50:36 +00:00
William S Fulton
d9670b608e
Fix directors for Android and improve thread attachment/detachment in multi threading environments
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12868 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-10 15:00:35 +00:00
William S Fulton
6e56d87471
Fix inconsistencies in Java and C# getCPtr() and pointer constructor visibility - change to protected/internal from public. Add SWIG_JAVABODY_PROXY, SWIG_JAVABODY_TYPEWRAPPER and SWIG_CSBODY_PROXY, SWIG_CSBODY_TYPEWRAPPER for users to easily change when using multiple modules.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12844 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-11-25 21:20:47 +00:00
William S Fulton
6a74028e65
Fix inconsistencies in Java and C# getCPtr() and pointer constructor visibility - change to protected/internal from public. Add SWIG_JAVABODY_PROXY, SWIG_JAVABODY_TYPEWRAPPER and SWIG_CSBODY_PROXY, SWIG_CSBODY_TYPEWRAPPER for users to easily change when using multiple modules.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12843 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-11-25 20:56:56 +00:00
William S Fulton
24133bacd7
Remove numerous hard coded 'result' variable name in generated c/c++ wrappers. The variable name is now defined in just one place, making it possible to change the name easily if a target language so wishes - see cwrap.c.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12830 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-10-30 21:51:50 +00:00
William S Fulton
8a6e006a7b
Marshalling char[] and char[ANY] to Java byte[] is now a bit easier
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12742 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-17 06:41:53 +00:00
William S Fulton
8ee0593036
Remove incomplete directorin typemaps as users incorrectly assumed they were implemented and working
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12653 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-03 05:46:00 +00:00