Cleanup: ignore GCC cast-function-type warning for PyMethodDef's

PyMethodDef::ml_flags define the function signature making the warning
meaningless.
This commit is contained in:
Campbell Barton 2023-07-22 11:11:42 +10:00
parent 19422044ed
commit 056a7bbb5c
23 changed files with 261 additions and 0 deletions

View File

@ -141,6 +141,11 @@ static PyObject *bpy_bm_update_edit_mesh(PyObject * /*self*/, PyObject *args, Py
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef BPy_BM_methods[] = {
{"new", (PyCFunction)bpy_bm_new, METH_VARARGS | METH_KEYWORDS, bpy_bm_new_doc},
{"from_edit_mesh", (PyCFunction)bpy_bm_from_edit_mesh, METH_O, bpy_bm_from_edit_mesh_doc},
@ -151,6 +156,10 @@ static PyMethodDef BPy_BM_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(BPy_BM_doc,
"This module provides access to blenders bmesh data structures.\n"
"\n"

View File

@ -227,12 +227,21 @@ static PyObject *bpy_bmesh_ops_module_dir(PyObject * /*self*/)
return ret;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef BPy_BM_ops_methods[] = {
{"__getattr__", (PyCFunction)bpy_bmesh_ops_module_getattro, METH_O, nullptr},
{"__dir__", (PyCFunction)bpy_bmesh_ops_module_dir, METH_NOARGS, nullptr},
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(BPy_BM_ops_doc, "Access to BMesh operators");
static PyModuleDef BPy_BM_ops_module_def = {
/*m_base*/ PyModuleDef_HEAD_INIT,

View File

@ -2803,6 +2803,11 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef bpy_bmesh_methods[] = {
/* utility */
{"copy", (PyCFunction)bpy_bmesh_copy, METH_NOARGS, bpy_bmesh_copy_doc},
@ -3057,6 +3062,10 @@ static PyMethodDef bpy_bmloopseq_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
/* Sequences
* ========= */

View File

@ -670,6 +670,11 @@ static PyMethodDef bpy_bmlayeritem_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef bpy_bmelemseq_methods[] = {
{"verify",
(PyCFunction)bpy_bmlayercollection_verify,
@ -694,6 +699,10 @@ static PyMethodDef bpy_bmelemseq_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
/* Sequences
* ========= */

View File

@ -706,6 +706,11 @@ static PyObject *bpy_bmdeformvert_clear(BPy_BMDeformVert *self)
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef bpy_bmdeformvert_methods[] = {
{"keys", (PyCFunction)bpy_bmdeformvert_keys, METH_NOARGS, bpy_bmdeformvert_keys_doc},
{"values", (PyCFunction)bpy_bmdeformvert_values, METH_NOARGS, bpy_bmdeformvert_values_doc},
@ -716,6 +721,10 @@ static PyMethodDef bpy_bmdeformvert_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyTypeObject BPy_BMDeformVert_Type; /* bm.loops.layers.uv.active */
static void bm_init_types_bmdvert(void)

View File

@ -141,6 +141,11 @@ static PyObject *bpy_bmeditselseq_discard(BPy_BMEditSelSeq *self, BPy_BMElem *va
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef bpy_bmeditselseq_methods[] = {
{"validate",
(PyCFunction)bpy_bmeditselseq_validate,
@ -154,6 +159,10 @@ static PyMethodDef bpy_bmeditselseq_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
/* Sequences
* ========= */

View File

@ -763,6 +763,11 @@ static PyObject *bpy_bm_utils_loop_separate(PyObject * /*self*/, BPy_BMLoop *val
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef BPy_BM_utils_methods[] = {
{"vert_collapse_edge",
(PyCFunction)bpy_bm_utils_vert_collapse_edge,
@ -813,6 +818,10 @@ static PyMethodDef BPy_BM_utils_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(BPy_BM_utils_doc, "This module provides access to blenders bmesh data structures.");
static PyModuleDef BPy_BM_utils_module_def = {
/*m_base*/ PyModuleDef_HEAD_INIT,

View File

@ -614,11 +614,20 @@ static PyObject *Buffer_dimensions(Buffer *self, void * /*arg*/)
return list;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef Buffer_methods[] = {
{"to_list", (PyCFunction)Buffer_to_list_recursive, METH_NOARGS, "return the buffer as a list"},
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
static PyGetSetDef Buffer_getseters[] = {
{"dimensions", (getter)Buffer_dimensions, nullptr, nullptr, nullptr},
{nullptr, nullptr, nullptr, nullptr, nullptr},

View File

@ -1603,6 +1603,11 @@ static PyObject *BPy_IDGroup_get(BPy_IDProperty *self, PyObject *args)
return def;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef BPy_IDGroup_methods[] = {
{"pop", (PyCFunction)BPy_IDGroup_pop, METH_VARARGS, BPy_IDGroup_pop_doc},
{"keys", (PyCFunction)BPy_IDGroup_keys, METH_NOARGS, BPy_IDGroup_keys_doc},
@ -1615,6 +1620,10 @@ static PyMethodDef BPy_IDGroup_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
/** \} */
/* -------------------------------------------------------------------- */
@ -1766,11 +1775,20 @@ static PyObject *BPy_IDArray_to_list(BPy_IDArray *self)
return BPy_IDGroup_MapDataToPy(self->prop);
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef BPy_IDArray_methods[] = {
{"to_list", (PyCFunction)BPy_IDArray_to_list, METH_NOARGS, BPy_IDArray_to_list_doc},
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
static Py_ssize_t BPy_IDArray_Len(BPy_IDArray *self)
{
return self->prop->len;

View File

@ -749,6 +749,11 @@ static PyObject *BPy_IDPropertyUIManager_update_from(BPy_IDPropertyUIManager *se
/** \name UI Data Manager Definition
* \{ */
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef BPy_IDPropertyUIManager_methods[] = {
{"update",
(PyCFunction)BPy_IDPropertyUIManager_update,
@ -769,6 +774,10 @@ static PyMethodDef BPy_IDPropertyUIManager_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
static PyObject *BPy_IDPropertyUIManager_repr(BPy_IDPropertyUIManager *self)
{
return PyUnicode_FromFormat(

View File

@ -209,6 +209,11 @@ static PyObject *py_imbuf_free(Py_ImBuf *self)
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef Py_ImBuf_methods[] = {
{"resize", (PyCFunction)py_imbuf_resize, METH_VARARGS | METH_KEYWORDS, py_imbuf_resize_doc},
{"crop", (PyCFunction)py_imbuf_crop, METH_VARARGS | METH_KEYWORDS, (char *)py_imbuf_crop_doc},
@ -219,6 +224,10 @@ static PyMethodDef Py_ImBuf_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
/** \} */
/* -------------------------------------------------------------------- */
@ -551,6 +560,11 @@ static PyObject *M_imbuf_write(PyObject * /*self*/, PyObject *args, PyObject *kw
/** \name Module Definition (`imbuf`)
* \{ */
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef IMB_methods[] = {
{"new", (PyCFunction)M_imbuf_new, METH_VARARGS | METH_KEYWORDS, M_imbuf_new_doc},
{"load", (PyCFunction)M_imbuf_load, METH_VARARGS | METH_KEYWORDS, M_imbuf_load_doc},
@ -558,6 +572,10 @@ static PyMethodDef IMB_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(IMB_doc,
"This module provides access to Blender's image manipulation API.\n"
"\n"

View File

@ -336,6 +336,11 @@ static PyObject *pygpu_batch_program_use_end(BPyGPUBatch *self)
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_batch__tp_methods[] = {
{"vertbuf_add", (PyCFunction)pygpu_batch_vertbuf_add, METH_O, pygpu_batch_vertbuf_add_doc},
{"program_set", (PyCFunction)pygpu_batch_program_set, METH_O, pygpu_batch_program_set_doc},
@ -353,6 +358,10 @@ static PyMethodDef pygpu_batch__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
#ifdef USE_GPU_PY_REFERENCES
static int pygpu_batch__tp_traverse(BPyGPUBatch *self, visitproc visit, void *arg)

View File

@ -566,6 +566,11 @@ static int pygpu_buffer__mp_ass_subscript(BPyGPUBuffer *self, PyObject *item, Py
return -1;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_buffer__tp_methods[] = {
{"to_list",
(PyCFunction)pygpu_buffer_to_list_recursive,
@ -574,6 +579,10 @@ static PyMethodDef pygpu_buffer__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
static PyGetSetDef pygpu_buffer_getseters[] = {
{"dimensions",
(getter)pygpu_buffer_dimensions_get,

View File

@ -234,6 +234,11 @@ static PyObject *pygpu_shader_image_load_store_support_get(PyObject * /*self*/)
/** \name Module
* \{ */
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_capabilities__tp_methods[] = {
{"max_texture_size_get",
(PyCFunction)pygpu_max_texture_size_get,
@ -301,6 +306,10 @@ static PyMethodDef pygpu_capabilities__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(pygpu_capabilities__tp_doc, "This module provides access to the GPU capabilities.");
static PyModuleDef pygpu_capabilities_module_def = {
/*m_base*/ PyModuleDef_HEAD_INIT,

View File

@ -167,12 +167,21 @@ static PyObject *pygpu_framebuffer_stack_context_exit(PyFrameBufferStackContext
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_framebuffer_stack_context__tp_methods[] = {
{"__enter__", (PyCFunction)pygpu_framebuffer_stack_context_enter, METH_NOARGS},
{"__exit__", (PyCFunction)pygpu_framebuffer_stack_context_exit, METH_VARARGS},
{nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
static PyTypeObject FramebufferStackContext_Type = {
/*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
/*tp_name*/ "GPUFrameBufferStackContext",
@ -705,6 +714,11 @@ static PyGetSetDef pygpu_framebuffer__tp_getseters[] = {
{nullptr, nullptr, nullptr, nullptr, nullptr} /* Sentinel */
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_framebuffer__tp_methods[] = {
{"bind", (PyCFunction)pygpu_framebuffer_bind, METH_NOARGS, pygpu_framebuffer_bind_doc},
{"clear",
@ -733,6 +747,10 @@ static PyMethodDef pygpu_framebuffer__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(pygpu_framebuffer__tp_doc,
".. class:: GPUFrameBuffer(depth_slot=None, color_slots=None)\n"
"\n"

View File

@ -154,12 +154,21 @@ enum {
static PyObject *pygpu_matrix_stack_context_enter(BPyGPU_MatrixStackContext *self);
static PyObject *pygpu_matrix_stack_context_exit(BPyGPU_MatrixStackContext *self, PyObject *args);
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_matrix_stack_context__tp_methods[] = {
{"__enter__", (PyCFunction)pygpu_matrix_stack_context_enter, METH_NOARGS},
{"__exit__", (PyCFunction)pygpu_matrix_stack_context_exit, METH_VARARGS},
{nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
static PyTypeObject PyGPUMatrixStackContext_Type = {
/*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
/*tp_name*/ "GPUMatrixStackContext",
@ -506,6 +515,11 @@ static PyObject *pygpu_matrix_get_normal_matrix(PyObject * /*self*/)
/** \name Module
* \{ */
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_matrix__tp_methods[] = {
/* Manage Stack */
{"push", (PyCFunction)pygpu_matrix_push, METH_NOARGS, pygpu_matrix_push_doc},
@ -575,6 +589,10 @@ static PyMethodDef pygpu_matrix__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(pygpu_matrix__tp_doc, "This module provides access to the matrix stack.");
static PyModuleDef pygpu_matrix_module_def = {
/*m_base*/ PyModuleDef_HEAD_INIT,

View File

@ -138,12 +138,21 @@ static PyObject *pygpu_offscreen_stack_context_exit(OffScreenStackContext *self,
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_offscreen_stack_context__tp_methods[] = {
{"__enter__", (PyCFunction)pygpu_offscreen_stack_context_enter, METH_NOARGS},
{"__exit__", (PyCFunction)pygpu_offscreen_stack_context_exit, METH_VARARGS},
{nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
static PyTypeObject PyGPUOffscreenStackContext_Type = {
/*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
/*tp_name*/ "GPUFrameBufferStackContext",
@ -521,6 +530,11 @@ static PyGetSetDef pygpu_offscreen__tp_getseters[] = {
{nullptr, nullptr, nullptr, nullptr, nullptr} /* Sentinel */
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_offscreen__tp_methods[] = {
{"bind", (PyCFunction)pygpu_offscreen_bind, METH_NOARGS, pygpu_offscreen_bind_doc},
{"unbind",
@ -537,6 +551,10 @@ static PyMethodDef pygpu_offscreen__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(pygpu_offscreen__tp_doc,
".. class:: GPUOffScreen(width, height, *, format='RGBA8')\n"
"\n"

View File

@ -117,6 +117,11 @@ static PyObject *pygpu_platform_backend_type_get(PyObject * /*self*/)
/** \name Module
* \{ */
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_platform__tp_methods[] = {
{"vendor_get",
(PyCFunction)pygpu_platform_vendor_get,
@ -141,6 +146,10 @@ static PyMethodDef pygpu_platform__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(pygpu_platform__tp_doc, "This module provides access to GPU Platform definitions.");
static PyModuleDef pygpu_platform_module_def = {
/*m_base*/ PyModuleDef_HEAD_INIT,

View File

@ -658,6 +658,11 @@ static PyObject *pygpu_shader_attrs_info_get(BPyGPUShader *self, PyObject * /*ar
return ret;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_shader__tp_methods[] = {
{"bind", (PyCFunction)pygpu_shader_bind, METH_NOARGS, pygpu_shader_bind_doc},
{"uniform_from_name",
@ -711,6 +716,10 @@ static PyMethodDef pygpu_shader__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(pygpu_shader_name_doc,
"The name of the shader object for debugging purposes (read-only).\n\n:type: str");
static PyObject *pygpu_shader_name(BPyGPUShader *self)
@ -928,6 +937,11 @@ static PyObject *pygpu_shader_create_from_info(BPyGPUShader * /*self*/, BPyGPUSh
return BPyGPUShader_CreatePyObject(shader, false);
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_shader_module__tp_methods[] = {
{"unbind", (PyCFunction)pygpu_shader_unbind, METH_NOARGS, pygpu_shader_unbind_doc},
{"from_builtin",
@ -941,6 +955,10 @@ static PyMethodDef pygpu_shader_module__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(pygpu_shader_module__tp_doc,
"This module provides access to GPUShader internal functions.\n"
"\n"

View File

@ -430,6 +430,11 @@ static PyObject *pygpu_state_framebuffer_active_get(PyObject * /*self*/)
/** \name Module
* \{ */
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_state__tp_methods[] = {
/* Manage Stack */
{"blend_set", (PyCFunction)pygpu_state_blend_set, METH_O, pygpu_state_blend_set_doc},
@ -509,6 +514,10 @@ static PyMethodDef pygpu_state__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(pygpu_state__tp_doc, "This module provides access to the gpu state.");
static PyModuleDef pygpu_state_module_def = {
/*m_base*/ PyModuleDef_HEAD_INIT,

View File

@ -486,6 +486,11 @@ static PyGetSetDef pygpu_texture__tp_getseters[] = {
{nullptr, nullptr, nullptr, nullptr, nullptr} /* Sentinel */
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_texture__tp_methods[] = {
{"clear",
(PyCFunction)pygpu_texture_clear,
@ -498,6 +503,10 @@ static PyMethodDef pygpu_texture__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
PyDoc_STRVAR(
pygpu_texture__tp_doc,
".. class:: GPUTexture(size, layers=0, is_cubemap=False, format='RGBA8', data=None)\n"

View File

@ -311,6 +311,11 @@ static PyObject *pygpu_vertbuf_attr_fill(BPyGPUVertBuf *self, PyObject *args, Py
Py_RETURN_NONE;
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_vertbuf__tp_methods[] = {
{"attr_fill",
(PyCFunction)pygpu_vertbuf_attr_fill,
@ -319,6 +324,10 @@ static PyMethodDef pygpu_vertbuf__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
static void pygpu_vertbuf__tp_dealloc(BPyGPUVertBuf *self)
{
GPU_vertbuf_discard(self->buf);

View File

@ -121,6 +121,11 @@ static PyObject *pygpu_vertformat_attr_add(BPyGPUVertFormat *self, PyObject *arg
return PyLong_FromLong(attr_id);
}
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef pygpu_vertformat__tp_methods[] = {
{"attr_add",
(PyCFunction)pygpu_vertformat_attr_add,
@ -129,6 +134,10 @@ static PyMethodDef pygpu_vertformat__tp_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
static void pygpu_vertformat__tp_dealloc(BPyGPUVertFormat *self)
{
Py_TYPE(self)->tp_free(self);