code cleanup: unused defines, shadowing and unintended enum-as-variable.
[blender.git] / source / blender / python / intern / gpu.c
index e5f45ca7736dc602368c71a22b4f3ab7e2240c7e..747390abd0ded01cc786d2fd965658e9fcee4c63 100644 (file)
@@ -74,8 +74,7 @@ static struct PyModuleDef gpumodule = {
        NULL, NULL, NULL, NULL, NULL
 };
 
-PyMODINIT_FUNC
-PyInit_gpu(void)
+static PyObject *PyInit_gpu(void)
 {
        PyObject *m;
 
@@ -83,7 +82,7 @@ PyInit_gpu(void)
        if (m == NULL)
                return NULL;
 
-       // device constants
+       /* device constants */
        PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_VIEWMAT);
        PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_MAT);
        PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_VIEWIMAT);
@@ -132,6 +131,7 @@ PyInit_gpu(void)
        PyDict_SetItemString(d, # f, val);               \
        Py_DECREF(val)
 
+#if 0  /* UNUSED */
 #define PY_OBJ_ADD_ID(d, s, f)                      \
        val = PyUnicode_FromString(&s->f->id.name[2]);  \
        PyObject_SetAttrString(d, # f, val);            \
@@ -146,6 +146,7 @@ PyInit_gpu(void)
        val = PyUnicode_FromString(s->f);    \
        PyObject_SetAttrString(d, # f, val); \
        Py_DECREF(val)
+#endif
 
 PyDoc_STRVAR(GPU_export_shader_doc,
 "export_shader(scene, material)\n"
@@ -187,13 +188,13 @@ static PyObject *GPU_export_shader(PyObject *UNUSED(self), PyObject *args, PyObj
                return NULL;
        }
 
-       // we can call our internal function at last:
+       /* we can call our internal function at last: */
        shader = GPU_shader_export(scene, material);
        if (!shader) {
                PyErr_SetString(PyExc_RuntimeError, "cannot export shader");
                return NULL;
        }
-       // build a dictionary
+       /* build a dictionary */
        result = PyDict_New();
        if (shader->fragment) {
                PY_DICT_ADD_STRING(result, shader, fragment);