[Bf-blender-cvs] [f754283bb8e] pygpu_extensions: Fix errors and warnings

Germano Cavalcante noreply at git.blender.org
Fri Feb 12 16:17:22 CET 2021


Commit: f754283bb8efa2603a47eb2b660cbc849b3e54dc
Author: Germano Cavalcante
Date:   Fri Feb 12 12:02:03 2021 -0300
Branches: pygpu_extensions
https://developer.blender.org/rBf754283bb8efa2603a47eb2b660cbc849b3e54dc

Fix errors and warnings

===================================================================

M	source/blender/python/gpu/gpu_py_framebuffer.c
M	source/blender/python/gpu/gpu_py_state.c
M	source/blender/python/gpu/gpu_py_texture.c

===================================================================

diff --git a/source/blender/python/gpu/gpu_py_framebuffer.c b/source/blender/python/gpu/gpu_py_framebuffer.c
index 48b7cf90284..1cc812237e0 100644
--- a/source/blender/python/gpu/gpu_py_framebuffer.c
+++ b/source/blender/python/gpu/gpu_py_framebuffer.c
@@ -386,7 +386,9 @@ PyDoc_STRVAR(py_framebuffer_viewport_set_doc,
              "   :param x, y: lower left corner of the viewport_set rectangle, in pixels.\n"
              "   :param xsize, ysize: width and height of the viewport_set.\n"
              "   :type x, y, xsize, ysize: `int`\n");
-static int py_framebuffer_viewport_set(BPyGPUFrameBuffer *self, PyObject *args, void *UNUSED(type))
+static PyObject *py_framebuffer_viewport_set(BPyGPUFrameBuffer *self,
+                                             PyObject *args,
+                                             void *UNUSED(type))
 {
   int x, y, xsize, ysize;
   if (!PyArg_ParseTuple(args, "iiii:viewport_set", &x, &y, &xsize, &ysize)) {
diff --git a/source/blender/python/gpu/gpu_py_state.c b/source/blender/python/gpu/gpu_py_state.c
index 5193e92134a..e1e264dde92 100644
--- a/source/blender/python/gpu/gpu_py_state.c
+++ b/source/blender/python/gpu/gpu_py_state.c
@@ -202,7 +202,7 @@ PyDoc_STRVAR(py_state_viewport_get_doc,
              ".. function:: viewport_get()\n"
              "\n"
              "   Viewport of the active framebuffer.\n");
-static PyObject *py_state_viewport_get(PyObject *UNUSED(self), PyObject *args)
+static PyObject *py_state_viewport_get(PyObject *UNUSED(self), PyObject *UNUSED(args))
 {
   int viewport[4];
   GPU_viewport_size_get_i(viewport);
diff --git a/source/blender/python/gpu/gpu_py_texture.c b/source/blender/python/gpu/gpu_py_texture.c
index d22130c2d48..d4a5ebcc6e0 100644
--- a/source/blender/python/gpu/gpu_py_texture.c
+++ b/source/blender/python/gpu/gpu_py_texture.c
@@ -180,21 +180,20 @@ static PyObject *py_texture_new(PyTypeObject *UNUSED(self), PyObject *args, PyOb
     if (is_cubemap) {
       if (is_layered) {
         tex = GPU_texture_create_cube_array(
-            name, width, depth, 1, pygpu_textureformat.value_found, GPU_DATA_FLOAT, data);
+            name, width, depth, 1, pygpu_textureformat.value_found, data);
       }
       else {
-        tex = GPU_texture_create_cube(
-            name, width, 1, pygpu_textureformat.value_found, GPU_DATA_FLOAT, data);
+        tex = GPU_texture_create_cube(name, width, 1, pygpu_textureformat.value_found, data);
       }
     }
     else if (is_layered) {
       if (depth) {
         tex = GPU_texture_create_2d_array(
-            name, width, height, depth, 1, pygpu_textureformat.value_found, GPU_DATA_FLOAT, data);
+            name, width, height, depth, 1, pygpu_textureformat.value_found, data);
       }
       else {
         tex = GPU_texture_create_1d_array(
-            name, width, height, 1, pygpu_textureformat.value_found, GPU_DATA_FLOAT, data);
+            name, width, height, 1, pygpu_textureformat.value_found, data);
       }
     }
     else if (depth) {
@@ -202,12 +201,10 @@ static PyObject *py_texture_new(PyTypeObject *UNUSED(self), PyObject *args, PyOb
           name, width, height, depth, 1, pygpu_textureformat.value_found, GPU_DATA_FLOAT, data);
     }
     else if (height) {
-      tex = GPU_texture_create_2d(
-          name, width, height, 1, pygpu_textureformat.value_found, GPU_DATA_FLOAT, data);
+      tex = GPU_texture_create_2d(name, width, height, 1, pygpu_textureformat.value_found, data);
     }
     else {
-      tex = GPU_texture_create_1d(
-          name, width, height, 1, pygpu_textureformat.value_found, GPU_DATA_FLOAT, data);
+      tex = GPU_texture_create_1d(name, width, 1, pygpu_textureformat.value_found, data);
     }
   }



More information about the Bf-blender-cvs mailing list