Cleanup: use nodiscard attribute for functions in the Python API
In most (cases functions returning a PyObject pointer requires it to be used by the caller, declare functions in the Python API with the `nodiscard` attribute.
This commit is contained in:
@@ -39,7 +39,7 @@ struct BPyGPUBuffer {
|
||||
} buf;
|
||||
};
|
||||
|
||||
size_t bpygpu_Buffer_size(BPyGPUBuffer *buffer);
|
||||
[[nodiscard]] size_t bpygpu_Buffer_size(BPyGPUBuffer *buffer);
|
||||
/**
|
||||
* Create a buffer object
|
||||
*
|
||||
@@ -47,7 +47,7 @@ size_t bpygpu_Buffer_size(BPyGPUBuffer *buffer);
|
||||
* \param buffer: When not NULL holds a contiguous buffer
|
||||
* with the correct format from which the buffer will be initialized
|
||||
*/
|
||||
BPyGPUBuffer *BPyGPU_Buffer_CreatePyObject(int format,
|
||||
const Py_ssize_t *shape,
|
||||
int shape_len,
|
||||
void *buffer);
|
||||
[[nodiscard]] BPyGPUBuffer *BPyGPU_Buffer_CreatePyObject(int format,
|
||||
const Py_ssize_t *shape,
|
||||
int shape_len,
|
||||
void *buffer);
|
||||
|
||||
Reference in New Issue
Block a user