From d8dbd49a2f23b7637f05fc058f39bdf6ab706624 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 31 May 2019 22:51:19 +1000 Subject: Cleanup: style, use braces in source/ Automated using clang-tidy. --- .../blender/freestyle/intern/python/BPy_SShape.cpp | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'source/blender/freestyle/intern/python/BPy_SShape.cpp') diff --git a/source/blender/freestyle/intern/python/BPy_SShape.cpp b/source/blender/freestyle/intern/python/BPy_SShape.cpp index f8930a89a38..d007fead345 100644 --- a/source/blender/freestyle/intern/python/BPy_SShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_SShape.cpp @@ -35,11 +35,13 @@ extern "C" { //-------------------MODULE INITIALIZATION-------------------------------- int SShape_Init(PyObject *module) { - if (module == NULL) + if (module == NULL) { return -1; + } - if (PyType_Ready(&SShape_Type) < 0) + if (PyType_Ready(&SShape_Type) < 0) { return -1; + } Py_INCREF(&SShape_Type); PyModule_AddObject(module, "SShape", (PyObject *)&SShape_Type); @@ -68,20 +70,24 @@ static int SShape_init(BPy_SShape *self, PyObject *args, PyObject *kwds) static const char *kwlist[] = {"brother", NULL}; PyObject *brother = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &SShape_Type, &brother)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &SShape_Type, &brother)) { return -1; - if (!brother) + } + if (!brother) { self->ss = new SShape(); - else + } + else { self->ss = new SShape(*(((BPy_SShape *)brother)->ss)); + } self->borrowed = false; return 0; } static void SShape_dealloc(BPy_SShape *self) { - if (self->ss && !self->borrowed) + if (self->ss && !self->borrowed) { delete self->ss; + } Py_TYPE(self)->tp_free((PyObject *)self); } @@ -103,8 +109,9 @@ static PyObject *SShape_add_edge(BPy_SShape *self, PyObject *args, PyObject *kwd static const char *kwlist[] = {"edge", NULL}; PyObject *py_fe = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &FEdge_Type, &py_fe)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &FEdge_Type, &py_fe)) { return NULL; + } self->ss->AddEdge(((BPy_FEdge *)py_fe)->fe); Py_RETURN_NONE; } @@ -123,8 +130,9 @@ static PyObject *SShape_add_vertex(BPy_SShape *self, PyObject *args, PyObject *k static const char *kwlist[] = {"edge", NULL}; PyObject *py_sv = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &SVertex_Type, &py_sv)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &SVertex_Type, &py_sv)) { return NULL; + } self->ss->AddNewVertex(((BPy_SVertex *)py_sv)->sv); Py_RETURN_NONE; } -- cgit v1.2.3