This fixes the case when an integer is used as the initializer, such as:
struct W { static const char w = 100; };
The "valuetype" attribute has been added to the "cdecl" Node which enables
us to distinguish the declared type from the type of the initializer.
It is possible that the module we're wrapping defines an Exception
class. This will confuse code that uses an unqualified "Exception"
class (e.g. "try: ... except Exception") since it now won't match
the Python builtin Exception. Fix this by explicitly using
the class from the __builtin__ module ("builtins" in Python 3).
* missing-initializers:
Tcl fix when using -Wmissing-field-initializers warnings
Php fix for -Wmissing-field-initializers warning
Fixes for Octave and missing -Wmissing-field-initializers in swig_octave_member
Fixes for Ruby and using -Wmissing-field-initializers
R test case warning fixes
Use -Wmissing-field-initializers warning testing all languages on Travis
Use ZEND_FE_END (introduced sometime around 5.2) to obtain the correct
number of arguments for zend_function_entry. Fallback to the original
3 argument initializer if not defined, however, this will not fix the
initializer warning though for some older versions of PHP.
* ahnolds-python34:
Python tp_allocs -> tp_next corrections
Cosmetic correction for Python tp_version -> tp_version_tag
Add -Wmissing-field-initializers to python Travis testing
Python 3.3 builtin missing field initializers added
Adding tp_finalize field to PyTypeObject for Python 3.4 and -builtin
Adding nb_matrix_multiply and nb_inplace_matrix_multiply fields to PyNumberMethods for Python version 3.5 and up
Adding tp_finalize field to PyTypeObject for Python version 3.4 and up
Fix %shared_ptr support for private and protected inheritance.
- Remove unnecessary Warning 520: Derived class 'Derived' of 'Base'
is not similarly marked as a smart pointer
- Do not generate code that attempts to cast up the inheritance chain in the
type system runtime in such cases as it doesn't compile and can't be used.
Remove unnecessary warning 520 for %shared_ptr when the base class is ignored.
* ruby-shared-ptr:
Add more Ruby shared_ptr runtime tests
Add RUBYFLAGS for Ruby testing
li_boost_shared_ptr tests cleanup
Ruby shared_ptr testing enhancements
Add shared_ptr Ruby runtime test
SWIG_Ruby_ConvertPtrAndOwn changes for smartptr feature
Fix Ruby smartptr feature for classes in a namespace
Turn on missing shared_ptr tests for Octave
Turn on Ruby shared_ptr testing
shared_ptr typemap error message fix for global variables
Add Ruby shared_ptr support
smartptr feature support - factor out common code
Add Ruby shared_ptr typemaps
Ruby ownership refactor ready for smart pointers
Ruby free function declaration change
The functions Swig_typemap_new_scope() and Swig_typemap_pop_scope() introduced
by 503746e964 back in 2000 were never used and
ended up being commented out themselves, but support for typemap scopes still
remain in several other functions. Remove it completely to make the code
simpler without any ill effects.
* lyze-cffi-export-package:
Add user documentation to the export package extension.
Extend the export feature in the CFFI module to support exporting to a particular package.
Reinstates autodoc for callback function testcase from #467, actually
tests the resulting docstring in the _runme.py and fixes SWIG/Python
so the expected result is obtained.
Suppresses warning:
error: control may reach end of non-void function [-Werror,-Wreturn-type]
The UNUSED macro is not expanded in ruby.h for rb_exc_raise for clang when
it ought to be.
For patch #512
By using the 'except:', you can catch all kinds of exceptions, including
the KeyboardInterrupt and SystemExit exceptions. From the generated
code, it is quite obvious that it is not these cases that should be
caught, but more specific ones like AttributeError and TypeError. To be
on the safe side, I decided to keep using 'Exception' for now.
includes the addition of a _runme for an existing test - preproc_constants
that was previously not run. That tests includes a preprocessor based
setting of an enumeration which is ignored by the existing r enumeration
infrastructure. The new version correctly reports the enumeration value
as 4 - previous versions set it to 0. Traditional enumerations are unchanged.
The approach used to deal with these enumerations is similar to that of
other languages, and requires a call to a C function at runtime to return
the enumeration value. The previous approach figured out the values statically
and this is still used where possible. The need for a runtime call leads to
changes in when swig code is used in packages - see below.
One test that previously passed now fails - namely the R sourcing of
preproc_constants.R, as the enumeration code requires the shared library,
which isn't loaded by that script.
There is also a modification to the way the R _runme.R files are used.
The call to R CMD BATCH now includes a --args option that indicates
the source folder for the unittest.R file, and the first couple
of lines of the _runme.R files deal with correctly locating this.
Out of source tests now run correctly.
This work was motivated by problems generating the SimpleITK binding,
specifically with some of the more complex enumerations.
This approach does have some issues wrt to code in packages, but I can't
see an alternative. The problem with packages is that the R code setting
up the enumeration structures requires the shared library so that the C
functions returning enumeration values can be called. The enumeration
setup code thus needs to be moved to the package initialisation section.
For SimpleITK I do this using an R script, which I think is an acceptable
solution. The core part of the process is the following function. I dump
all the enumeration stuff into a .onload function. This is only necessary
if some of the enumerations are tricky.
splitSwigFile <- function(filename, onloadfile, mainfile)
{
p1 <- parse(file=filename)
getdefineEnum <- function(X)
{
return (is.call(X) & (X[[1]]=="defineEnumeration"))
}
dd <- sapply(p1, getdefineEnum)
enums <- p1[dd]
enums <- unlist(lapply(enums, deparse))
enums <- c(".onLoad <- function(libname, pkgname) {", enums, "}")
everythingelse <- p1[!dd]
everythingelse <- unlist(lapply(everythingelse, deparse))
writeLines(everythingelse, mainfile)
writeLines(enums, onloadfile)
}