I think it may be better to revert the change to bool parsing here because there is the py_capi_utils.h#PyC_AsArray()
function, which is a good candidate for replacing the conversion from Python sequence to array here, and its bool parsing matches the existing int(PyLong_AsLong(item)) != 0
rather than using #PyC_Long_AsBool()
. Reverting this change to bool parsing should make any future transition to using #PyC_AsArray()
easier.
Might there be concerns of integer overflow when doing size * out.len
? Both are int
, so I guess passing size_t(size) * out.len
to memcpy
or declaring size_t size;
instead of int size;
would be better.
I've updated the PR description to group together the changes based on whether they are functional or for performance, and I've updated and added the functional changes of the last few commits,…
Since this PR does nothing on its own, I'm intending to only merge it when one of the PRs that use it are also approved.
signed char
) buffers from being compatible with PROP_RAW_CHAR
__index__
fallback to existing py_capi_utils functions rather than adding new functions
I've had a further think about this and I don't think ulong
potentially being 64-bit will be an issue because there is no PROP_RAW_ULONG
and code should be using fixed-width types where…
I didn't know that functional-style casts can only be done with simple type specifiers, and for some reason it does compile on Windows.
I didn't think that ulong
would be guaranteed to fit in a uint32_t
since I thought it was usually 64-bit on 64-bit Linux. Similarly for fitting unsigned long long
into uint64_t
which…
@ideasman42 @brecht Can I get a review from you both on this please? It looks like Campbell worked a lot on bpy_rna.cc#foreach_getset
and py_capi_utils.h
and Brecht on `rna_access.cc#rna_raw_ac…