[Bf-blender-cvs] [1e3e066] framebuffer: Cleanup: style

Campbell Barton noreply at git.blender.org
Mon Oct 19 17:03:43 CEST 2015


Commit: 1e3e06652ce2df2bdd20c400b060d0f8e16d8a00
Author: Campbell Barton
Date:   Tue Oct 20 01:34:05 2015 +1100
Branches: framebuffer
https://developer.blender.org/rB1e3e06652ce2df2bdd20c400b060d0f8e16d8a00

Cleanup: style

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

M	source/blender/python/intern/gpu_offscreen.c

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

diff --git a/source/blender/python/intern/gpu_offscreen.c b/source/blender/python/intern/gpu_offscreen.c
index dc6a543..624d465 100644
--- a/source/blender/python/intern/gpu_offscreen.c
+++ b/source/blender/python/intern/gpu_offscreen.c
@@ -64,22 +64,22 @@ typedef struct {
 	GPUOffScreen *ofs;
 } PyGPUOffScreen;
 
-static int bpy_gpu_offscreen_valid_check(PyGPUOffScreen *pygpu, const char *error_prefix)
+static int bpy_gpu_offscreen_valid_check(PyGPUOffScreen *py_gpu_ofs, const char *error_prefix)
 {
-	if (UNLIKELY(pygpu->ofs == NULL)) {
+	if (UNLIKELY(py_gpu_ofs->ofs == NULL)) {
 		PyErr_Format(PyExc_ReferenceError,
 		             "%.200s: GPU offscreen was freed, no further access is valid",
-		             error_prefix, Py_TYPE(pygpu)->tp_name);
+		             error_prefix, Py_TYPE(py_gpu_ofs)->tp_name);
 		return -1;
 	}
 	return 0;
 }
 
 #define BPY_GPU_OFFSCREEN_CHECK_OBJ(pygpu, errmsg) { \
-    if (UNLIKELY(bpy_gpu_offscreen_valid_check(pygpu, errmsg) == -1)) { \
+	if (UNLIKELY(bpy_gpu_offscreen_valid_check(pygpu, errmsg) == -1)) { \
 		return NULL; \
 	} \
-} (void)0
+} ((void)0)
 
 /* annoying since arg parsing won't check overflow */
 #define UINT_IS_NEG(n) ((n) > INT_MAX)
@@ -118,7 +118,7 @@ PyDoc_STRVAR(pygpu_offscreen_bind_doc,
 "   Bind the offscreen object.\n"
 "\n"
 "   :param save: save OpenGL current states\n"
-"   :type save: bool"
+"   :type save: bool\n"
 );
 static PyObject *pygpu_offscreen_bind(PyGPUOffScreen *self, PyObject *args, PyObject *kwds)
 {
@@ -144,7 +144,7 @@ PyDoc_STRVAR(pygpu_offscreen_unbind_doc,
 "   Unbind the offscreen object.\n"
 "\n"
 "   :param restore: restore OpenGL previous states\n"
-"   :type restore: bool"
+"   :type restore: bool\n"
 );
 static PyObject *pygpu_offscreen_unbind(PyGPUOffScreen *self, PyObject *args, PyObject *kwds)
 {
@@ -204,7 +204,7 @@ PyDoc_STRVAR(pygpu_offscreen_draw_view3d_doc,
 "   :param modelview_matrix: ModelView Matrix\n"
 "   :type modelview_matrix: :class:`mathutils.Matrix`\n"
 "   :param projection_matrix: Projection Matrix\n"
-"   :type projection_matrix: :class:`mathutils.Matrix`"
+"   :type projection_matrix: :class:`mathutils.Matrix`\n"
 );
 static PyObject *pygpu_offscreen_draw_view3d(PyGPUOffScreen *self, PyObject *args, PyObject *kwds)
 {
@@ -240,20 +240,20 @@ static PyObject *pygpu_offscreen_draw_view3d(PyGPUOffScreen *self, PyObject *arg
 	}
 
 	ar = (ARegion *)PyC_RNA_AsPointer(pyregion, "ARegion");
-	if (ar== NULL) {
+	if (ar == NULL) {
 		PyErr_SetString(PyExc_SystemError, "draw_view3d: No valid region");
 		return NULL;
 	}
 
 	v3d = (View3D *)PyC_RNA_AsPointer(pyview3d, "View3D");
-	if (v3d== NULL) {
+	if (v3d == NULL) {
 		PyErr_SetString(PyExc_SystemError, "draw_view3d: No valid 3d view");
 		return NULL;
 	}
 
 	fx = GPU_fx_compositor_create();
 
-	fx_settings= v3d->fx_settings; /* full copy */
+	fx_settings = v3d->fx_settings;  /* full copy */
 
 	ED_view3d_draw_offscreen_init(scene, v3d);
 
@@ -285,7 +285,7 @@ PyDoc_STRVAR(pygpu_offscreen_free_doc,
 "free()\n"
 "\n"
 "   Free the offscreen object\n"
-"   The framebuffer, texture and render objects will no longer be accessible."
+"   The framebuffer, texture and render objects will no longer be accessible.\n"
 );
 static PyObject *pygpu_offscreen_free(PyGPUOffScreen *self)
 {
@@ -312,7 +312,7 @@ static PyGetSetDef bpy_gpu_offscreen_getseters[] = {
 };
 
 static struct PyMethodDef bpy_gpu_offscreen_methods[] = {
-	{"bind", (PyCFunction)pygpu_offscreen_bind, METH_VARARGS | METH_KEYWORDS,pygpu_offscreen_bind_doc},
+	{"bind", (PyCFunction)pygpu_offscreen_bind, METH_VARARGS | METH_KEYWORDS, pygpu_offscreen_bind_doc},
 	{"unbind", (PyCFunction)pygpu_offscreen_unbind, METH_VARARGS | METH_KEYWORDS, pygpu_offscreen_unbind_doc},
 	{"draw_view3d", (PyCFunction)pygpu_offscreen_draw_view3d, METH_VARARGS | METH_KEYWORDS, pygpu_offscreen_draw_view3d_doc},
 	{"free", (PyCFunction)pygpu_offscreen_free, METH_NOARGS, pygpu_offscreen_free_doc},
@@ -320,9 +320,8 @@ static struct PyMethodDef bpy_gpu_offscreen_methods[] = {
 };
 
 PyDoc_STRVAR(py_gpu_offscreen_doc,
-"GPUOffscreen(width, height, samples) -> new GPU Offscreen object"
+"GPUOffscreen(width, height, samples) -> new GPU Offscreen object\n"
 "initialized to hold a framebuffer object of ``width`` x ``height`` with ``samples``.\n"
-""
 );
 static PyTypeObject PyGPUOffScreen_Type = {
 	PyVarObject_HEAD_INIT(NULL, 0)
@@ -397,7 +396,7 @@ PyDoc_STRVAR(pygpu_offscreen_new_doc,
 "   :param samples: OpenGL samples\n"
 "   :type samples: int\n"
 "   :return: struct with GPUFrameBuffer, GPUTexture, GPUTexture.\n"
-"   :rtype: :class:`gpu.OffScreenObject`"
+"   :rtype: :class:`gpu.OffScreenObject`\n"
 );
 static PyObject *pygpu_offscreen_new(PyObject *UNUSED(self), PyObject *args, PyObject *kwds)
 {




More information about the Bf-blender-cvs mailing list