Sylvestre Ledru
e0b14786d6
Fix some useless code detected by scan-build (LLVM/Clang)
2013-03-08 20:53:18 +00:00
William S Fulton
7841a0d097
Remove cvs/svn Id strings
2013-01-12 01:21:16 +00:00
Olly Betts
0dd11cdd8d
Fix to work with a ZTS build of PHP (broken in 2.0.7)
2013-01-08 18:33:47 +13:00
William S Fulton
8a8c8e377b
gcc-4.6 warning fix
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13972 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-15 18:33:02 +00:00
William S Fulton
89052f3b0a
Fix Strcmp - it didn't have consistent null pointer handling - revert to what it used to be - a lightweight wrapper around strcmp which means functions once again must not pass in null to it.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13943 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-02 13:36:13 +00: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
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
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
William S Fulton
b1ee062d2a
Cosmetic variable renaming for consistency across language modules
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-10-27 17:38:05 +00:00
William S Fulton
f6229d4b73
Fix director typemap searching so that a typemap specified with a name will be correctly matched. Previously the name was ignored during the typemap search. Implemented by ensuring the 'type' attribute in the Node is set up correctly and using the usual Swig_typemap_lookup on the Node.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13873 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-10-27 17:37:34 +00:00
Olly Betts
7196e556a5
Fix SF#3528035, a regression introduced by the fix for SF#3428833.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13105 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-23 02:58:24 +00:00
Olly Betts
de9d01dbcd
[PHP] Fix getters for template members. (SF#3428833)
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13096 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-18 02:43:52 +00:00
Olly Betts
a2a42c7038
Add back 'NIL', dropped by mistake in change before last.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13082 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-14 05:11:02 +00:00
Olly Betts
e4763231be
Remove some commented out code
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13081 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-14 04:58:08 +00:00
Olly Betts
4f11fd51ab
Drop check for "ZEND_MODULE_API_NO > 20010900". We only support PHP5
...
now, and 5.0.0 was released in 2004.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13080 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-14 03:31:04 +00:00
Olly Betts
d81770dd93
[PHP] Fix memory leak in code generated for a callback. Patch from
...
SF bug #3510806 .
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13079 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-12 13:52:00 +00:00
Olly Betts
d96db667f7
[PHP] Avoid using zend_error_noreturn() as it doesn't work with all
...
builds of PHP (SF bug #3166423 ). Instead we now wrap it in a
SWIG_FAIL() function which we annotate as "noreturn" for GCC to
avoids warnings. This also reduces the size of the compiled
wrapper (e.g. the stripped size is 6% for Xapian's PHP bindings).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13077 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-12 13:26:16 +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
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
44c202d048
Add in $symname expansion for director methods
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12772 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-04 19:45:19 +00:00
Olly Betts
210266cd70
[PHP] Don't generate "return $r;" in cases where $r hasn't been set.
...
This was basically harmless, except it generated a PHP E_NOTICE if
the calling code had enabled them.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12767 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-29 10:51:02 +00:00
Olly Betts
688ea24560
[PHP] Fix director code to work when PHP is built with ZTS enabled,
...
which is the standard configuration on Microsoft Windows.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12749 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-23 16:04:42 +00:00
Olly Betts
29190559f8
SWIG_ZTS_SetPointerZval() now interprets bit 1 in newobject as meaning (wrap
...
in a PHP class wrapper), rather than taking newobject==2 as meaning this,
so we can wrap new and existing objects in this way.
Handle wrapping classes in a C++ namespace being returned by director methods.
No need to force classname to lowercase as zend_lookup_class() does that
internally.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12723 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-30 06:47:47 +00:00
Olly Betts
dce3b5bacf
[PHP] Fix handling of directors when -prefix is used.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12722 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-30 04:49:29 +00:00
Olly Betts
1d7f309a8a
[PHP] Fix handling of methods of classes with a virtual base class (SF#3124665).
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12711 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-24 14:51:59 +00:00
Olly Betts
72fc8be46c
[PHP] Fix handling of overloaded methods/functions where some
...
return void and others don't - whether this worked or not depended
on the order they were encountered in (SF#3208299).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12539 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-14 12:33:56 +00:00
William S Fulton
a63d456f8a
Remove redundant code highlighted by warnings in gcc-4.6
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12536 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-14 07:22:08 +00:00
William S Fulton
b69b793d8e
Better consistency in usage display
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12524 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-09 21:42:38 +00:00
Olly Betts
24053d7789
[PHP] Don't use zend_error_noreturn() for cases where the function
...
returns void - now this issue can only matter if you have a function
or method which is directed and returns non-void.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12523 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-07 23:05:01 +00:00
Olly Betts
630e438c6a
[PHP] Address bug in PHP on some platforms/architectures which
...
results in zend_error_noreturn() not being available using
SWIG_ZEND_ERROR_NORETURN which defaults to zend_error_noreturn but
can be overridden when building the module by passing
-DSWIG_ZEND_ERROR_NORETURN=zend_error to the compiler. This may
result in compiler warnings, but should at least allow a module
to be built on those platforms/architectures (SF#3166423).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12479 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-19 13:28:43 +00:00
Olly Betts
bf7c9e9a42
[PHP] An overloaded method which can return an object or a
...
primitive type no longer causes SWIG to segfault. Reported by Paul
Colby in SF#3168531.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12471 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-18 06:39:51 +00:00
William S Fulton
74883f1dd7
[PHP] SF #3166423 Recent PHP versions no longer define zend_error_noreturn - calls to this have been replaced with zend_error.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12430 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-04 20:25:59 +00:00
William S Fulton
1adc50e730
constify SwigType * in many places
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12349 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-12-15 21:55:08 +00:00
William S Fulton
004643ff30
Fix mangling of PHP constructor wrapper when types use global scope or typedefs
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12309 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-25 20:39:11 +00:00
Olly Betts
9eaf5ba1be
[PHP] Allow compilation on non-conforming Microsoft C++ compilers
...
which don't accept: return function_returning_void();
Reported by Frank Vanden Berghen on the SWIG mailing list.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12265 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-10-14 05:13:09 +00:00
Olly Betts
a25ccbf58b
[PHP] Fix handling of OUTPUT typemaps (Patch from Ryan in SF#3058394).
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12208 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-09-08 02:40:56 +00:00
Olly Betts
d0d40db326
Use SWIG_PTR rather than literal "_cPtr".
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12149 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-25 02:41:27 +00:00
Olly Betts
ae40eff993
The default visibility for methods is public, so don't specify that explicitly
...
to keep the wrapper size down.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12146 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-24 14:44:06 +00:00
William S Fulton
95a3eb5a7d
code style: fix inconsistent NULL pointer comparisons
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12137 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-17 23:49:12 +00:00
Olly Betts
f67c0fa12c
[PHP] Fix directors to correctly call a method with has a
...
different name in PHP to C++ (we were always using the C++ name
in this case).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12110 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-10 04:41:11 +00:00
William S Fulton
bb41eeb343
Fix potential name clashes with symbols in the Director class
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12062 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-27 20:55:24 +00:00
Olly Betts
e512093358
[PHP] Stop generating a bogus line of code in certain constructors.
...
This was mostly harmless, but caused a PHP notice to be issued, if
enabled (SF#2985684).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12033 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-21 07:07:15 +00:00
Olly Betts
227f2e2e0a
[PHP] Fix wrapping of global variables which was producing
...
uncompilable code in some cases.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12027 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-14 08:22:28 +00:00
William S Fulton
e81bfb86c0
Correct file and line number display for some error messages, these now also result in exiting with an error.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11945 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-03-13 23:08:02 +00:00
William S Fulton
cb64f65bae
SWIG license change - Source moves to GPLv3
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11876 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-27 23:53:33 +00:00
William S Fulton
83bd820285
Add typemaps used debugging option (-debug-tmused). Fix missing file/line numbers for typemap warnings and in the output from the -debug-tmsearch/-debug-tmused options
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11802 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-01-04 19:33:52 +00:00
Olly Betts
bfb09161f7
Eliminate "int error;" declaration from generated PHP director support code
...
if it isn't used. No change in behaviour, and the compiler will just optimise
away the unused variable, but it can cause an "unused variable" warning.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11776 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-10 11:52:29 +00:00
Olly Betts
bcda9644f1
Remove two commented out lines of code.
...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11773 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-04 04:56:10 +00:00