1. Python does a range check for values passed to int, unsigned int, short, unsigned short
(and longs on Windows)
2. The round trip of a MIN_INT value through string now works
Problem was that integers are converted to "long long"
in Python, which creates Variants rendering "#l1" as
parsable strings. These are marked as invalid by the
Syntax highlighter of the user properties editor.
This patch fixes the user properties editor syntax
highlighter to cover all Variant variants and
uses "long" type for Variant if possible.
This happens when default arguments (specifically
user class or enum types) and passed between keyword
and positional arguments. We must not use a temporary
tl::Variant object as it gets out of scope and a
reference is stored.
In addition: better error messages for Python when
a method can't be matched to arguments.
* Fixed the issue - Byte array variant was not properly converted to Python/Ruby objects.
* Added tests + properly converting byte arrays to byte array variants in Python.
Because long is 32bit on Windows (like int), the
conversion from long to unsigned int was subject
to sign overflow. This was fixed by going to
unsigned int via unsigned long.
Reimplementing virtual functions with
"const &" arguments wasn't behaving as
expected because these arguments were
copied.
Now, "const &" for arguments (in virtual
function reimplementation) is not implemented
as a copy.
In addition, now it's possible to declare
results as references always (also if const &).
See gsiTest.cc:1078 for example:
// gsi::arg_make_reference makes the function's return value
// always being taken as a reference
gsi::method<C_P, const CopyDetector &, const CopyDetector &, gsi::arg_make_reference> ("pass_cd_cref_as_ref", &C_P::pass_cd_cref)
Needed to refactor the class hierarchy of the Python classes.
Basically the module specific base class was removed as it does
not provide any benefit. The object layout of the PyObject
specialization was modified such that the payload is attached
to the end. This is compatible with the hidden extensions
which Python adds to normal objects.
The fix consisted of introducing "factory" type virtual
methods which ensure that a reference is held to the
returned object. This is important for implementing
factory methods in Python. Without this, the object
get destroyed before we have a chance to increment the
reference count.