We don't seem to have anything in the testsuite which exercises this
case.
There's some special handling of casts applied to string literals in the
parser which was committed as part of the fix for this, but removing it
doesn't seem to cause anything to fail (not even this testcase which
it reportedly fixed), and a wide character version seems to work without
any equivalent special handling. Maybe other things have changed since
which fixed this case without needing special cast handling. Deserves
further investigation.
Specifying the minimum 32 bit signed int value is not easily portable.
Remove min_32bit_int2 method, min_32bit_int1 provides runtime coverage.
g++ 32bit resulted in:
warning: this decimal constant is unsigned only in ISO C90
and some versions of clang++ resulted in:
error: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will have type 'long long' in C++11 onwards [-Werror,-Wc++11-compat]
32 bit and 64 bit compiled versions of SWIG generated different Python files
when default arguments were outside the range of 32 bit signed integers.
The default arguments specified in Python are now only those that are in the
range of a 32 bit signed integer, otherwise the default is obtained from C/C++ code.
Closes#1108
1. Fix negative octals. Currently not handled correctly by `-py3`
(unusual case, but incorrect).
2. Fix arguments of type "octal + something" (e.g. `0640 | 04`).
Currently drops everything after the first octal. Nasty!
3. Fix bool arguments "0 + something" (e.g. `0 | 1`) are always
"False" (unusual case, but incorrect).
4. Remove special handling of "TRUE" and "FALSE" from
`convertValue` since there's no reason these have to match
"true" and "false".
5. Remove the Python 2 vs. Python 3 distinction based on the
`-py3` flag. Now the same python code is produced for default
arguments for Python 2 and Python 3. For this, octal default
arguments, e.g. 0644, are now wrapped as `int('644', 8)`. This
is required, as Python 2 and Python 3 have incompatible syntax
for octal literals.
Fixes#707
Don't skip checking subsequent arguments just because one of them has "in"
typemap with numinputs=0 attribute.
Add a unit test showing the problem which is relatively rare as it doesn't
happen for the class methods and is hidden unless autodoc feature is used for
the global functions.
Closes#377.
Use "compact" arguments form for the function if "default" typemap is defined
for any of its arguments to allow omitting this argument when calling it from
Python.
Closes#377.
Accept not only manifest pointer types (such as e.g. "void *") but also types
that are typedefs for pointer types when checking whether C++ value of 0 must
be represented as 0 or None in Python.
Closes#365, #376.
Default values are no longer generated as Python code by default.
They must be explicitly turned on using the "python:defaultargs" feature.
Closes#294Closes#296
The problems in these two issues when "python:defaultargs" is turned
on still need to be fixed and should be addressed in separate patches.
The important thing is the default code generation is now fixed.