Commit Graph

9 Commits

Author SHA1 Message Date
Thomas Barlow 1058a93994 Fix #106696: Invalid flag combinations used in #PyObject_GetBuffer
Code using #PyObject_GetBuffer was combining the `PyBUF_FORMAT` and
`PyBUF_SIMPLE` flags, but the documentation specifies that
`PyBUF_FORMAT` can be |'d to any of the flags except `PyBUF_SIMPLE`
because the latter already implies format `B` (unsigned bytes).

The flags in such cases have been replaced with
`PyBUF_ND | PyBUF_FORMAT`, which has the additional requirement that the
buffer must provide it's `shape` field.

This fixes `memoryview` objects raising a `BufferError` when requested,
due to the invalid combination of flags making them be considered
invalid buffers when they would otherwise be valid.

Ref: !106697
2023-11-09 18:43:05 +11:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton 3af7ed0e8e Cleanup: reduce number of calls to PyUnicode_FromString 2023-08-11 10:03:45 +10:00
Campbell Barton 6d2326dabf Cleanup: use function style casts 2023-07-31 19:57:32 +10:00
Campbell Barton 52acf6a6ec Cleanup: correct file names in comments after C -> C++ renaming
Use back-tick quotes to differentiate these from plain text.
2023-07-31 13:02:30 +10:00
Campbell Barton d1aac3b08c Cleanup: various non-functional changes for C++ (python, makesrna)
- Remove redundant void, struct.
- Use function style casts.
2023-07-22 11:33:36 +10:00
Campbell Barton c81fffaa30 Fix function signatures for PyGetSetDef callbacks
While in practice this didn't cause problems on supported platforms,
omitting the closure argument is incorrect.
2023-07-22 11:16:04 +10:00
Campbell Barton 056a7bbb5c Cleanup: ignore GCC cast-function-type warning for PyMethodDef's
PyMethodDef::ml_flags define the function signature making the warning
meaningless.
2023-07-22 11:13:55 +10:00
Jacques Lucke ec05e5a3fc Python: move remaining python files to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110352
2023-07-21 19:41:03 +02:00