@@ -32,8 +32,10 @@ PyObject_Type(PyObject *o)
3232{
3333 PyObject * v ;
3434
35- if (o == NULL )
35+ if (o == NULL ) {
3636 return null_error ();
37+ }
38+
3739 v = (PyObject * )o -> ob_type ;
3840 Py_INCREF (v );
3941 return v ;
@@ -137,8 +139,9 @@ PyObject_GetItem(PyObject *o, PyObject *key)
137139{
138140 PyMappingMethods * m ;
139141
140- if (o == NULL || key == NULL )
142+ if (o == NULL || key == NULL ) {
141143 return null_error ();
144+ }
142145
143146 m = o -> ob_type -> tp_as_mapping ;
144147 if (m && m -> mp_subscript ) {
@@ -1125,8 +1128,10 @@ PyNumber_Negative(PyObject *o)
11251128{
11261129 PyNumberMethods * m ;
11271130
1128- if (o == NULL )
1131+ if (o == NULL ) {
11291132 return null_error ();
1133+ }
1134+
11301135 m = o -> ob_type -> tp_as_number ;
11311136 if (m && m -> nb_negative )
11321137 return (* m -> nb_negative )(o );
@@ -1139,8 +1144,10 @@ PyNumber_Positive(PyObject *o)
11391144{
11401145 PyNumberMethods * m ;
11411146
1142- if (o == NULL )
1147+ if (o == NULL ) {
11431148 return null_error ();
1149+ }
1150+
11441151 m = o -> ob_type -> tp_as_number ;
11451152 if (m && m -> nb_positive )
11461153 return (* m -> nb_positive )(o );
@@ -1153,8 +1160,10 @@ PyNumber_Invert(PyObject *o)
11531160{
11541161 PyNumberMethods * m ;
11551162
1156- if (o == NULL )
1163+ if (o == NULL ) {
11571164 return null_error ();
1165+ }
1166+
11581167 m = o -> ob_type -> tp_as_number ;
11591168 if (m && m -> nb_invert )
11601169 return (* m -> nb_invert )(o );
@@ -1167,8 +1176,10 @@ PyNumber_Absolute(PyObject *o)
11671176{
11681177 PyNumberMethods * m ;
11691178
1170- if (o == NULL )
1179+ if (o == NULL ) {
11711180 return null_error ();
1181+ }
1182+
11721183 m = o -> ob_type -> tp_as_number ;
11731184 if (m && m -> nb_absolute )
11741185 return m -> nb_absolute (o );
@@ -1184,8 +1195,10 @@ PyObject *
11841195PyNumber_Index (PyObject * item )
11851196{
11861197 PyObject * result = NULL ;
1187- if (item == NULL )
1198+ if (item == NULL ) {
11881199 return null_error ();
1200+ }
1201+
11891202 if (PyLong_Check (item )) {
11901203 Py_INCREF (item );
11911204 return item ;
@@ -1273,8 +1286,10 @@ PyNumber_Long(PyObject *o)
12731286 Py_buffer view ;
12741287 _Py_IDENTIFIER (__trunc__ );
12751288
1276- if (o == NULL )
1289+ if (o == NULL ) {
12771290 return null_error ();
1291+ }
1292+
12781293 if (PyLong_CheckExact (o )) {
12791294 Py_INCREF (o );
12801295 return o ;
@@ -1349,8 +1364,10 @@ PyNumber_Float(PyObject *o)
13491364{
13501365 PyNumberMethods * m ;
13511366
1352- if (o == NULL )
1367+ if (o == NULL ) {
13531368 return null_error ();
1369+ }
1370+
13541371 if (PyFloat_CheckExact (o )) {
13551372 Py_INCREF (o );
13561373 return o ;
@@ -1451,8 +1468,9 @@ PySequence_Concat(PyObject *s, PyObject *o)
14511468{
14521469 PySequenceMethods * m ;
14531470
1454- if (s == NULL || o == NULL )
1471+ if (s == NULL || o == NULL ) {
14551472 return null_error ();
1473+ }
14561474
14571475 m = s -> ob_type -> tp_as_sequence ;
14581476 if (m && m -> sq_concat )
@@ -1475,8 +1493,9 @@ PySequence_Repeat(PyObject *o, Py_ssize_t count)
14751493{
14761494 PySequenceMethods * m ;
14771495
1478- if (o == NULL )
1496+ if (o == NULL ) {
14791497 return null_error ();
1498+ }
14801499
14811500 m = o -> ob_type -> tp_as_sequence ;
14821501 if (m && m -> sq_repeat )
@@ -1504,8 +1523,9 @@ PySequence_InPlaceConcat(PyObject *s, PyObject *o)
15041523{
15051524 PySequenceMethods * m ;
15061525
1507- if (s == NULL || o == NULL )
1526+ if (s == NULL || o == NULL ) {
15081527 return null_error ();
1528+ }
15091529
15101530 m = s -> ob_type -> tp_as_sequence ;
15111531 if (m && m -> sq_inplace_concat )
@@ -1528,8 +1548,9 @@ PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count)
15281548{
15291549 PySequenceMethods * m ;
15301550
1531- if (o == NULL )
1551+ if (o == NULL ) {
15321552 return null_error ();
1553+ }
15331554
15341555 m = o -> ob_type -> tp_as_sequence ;
15351556 if (m && m -> sq_inplace_repeat )
@@ -1557,8 +1578,9 @@ PySequence_GetItem(PyObject *s, Py_ssize_t i)
15571578{
15581579 PySequenceMethods * m ;
15591580
1560- if (s == NULL )
1581+ if (s == NULL ) {
15611582 return null_error ();
1583+ }
15621584
15631585 m = s -> ob_type -> tp_as_sequence ;
15641586 if (m && m -> sq_item ) {
@@ -1583,7 +1605,9 @@ PySequence_GetSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2)
15831605{
15841606 PyMappingMethods * mp ;
15851607
1586- if (!s ) return null_error ();
1608+ if (!s ) {
1609+ return null_error ();
1610+ }
15871611
15881612 mp = s -> ob_type -> tp_as_mapping ;
15891613 if (mp && mp -> mp_subscript ) {
@@ -1710,8 +1734,9 @@ PySequence_Tuple(PyObject *v)
17101734 PyObject * result = NULL ;
17111735 Py_ssize_t j ;
17121736
1713- if (v == NULL )
1737+ if (v == NULL ) {
17141738 return null_error ();
1739+ }
17151740
17161741 /* Special-case the common tuple and list cases, for efficiency. */
17171742 if (PyTuple_CheckExact (v )) {
@@ -1791,8 +1816,9 @@ PySequence_List(PyObject *v)
17911816 PyObject * result ; /* result list */
17921817 PyObject * rv ; /* return value from PyList_Extend */
17931818
1794- if (v == NULL )
1819+ if (v == NULL ) {
17951820 return null_error ();
1821+ }
17961822
17971823 result = PyList_New (0 );
17981824 if (result == NULL )
@@ -1812,8 +1838,9 @@ PySequence_Fast(PyObject *v, const char *m)
18121838{
18131839 PyObject * it ;
18141840
1815- if (v == NULL )
1841+ if (v == NULL ) {
18161842 return null_error ();
1843+ }
18171844
18181845 if (PyList_CheckExact (v ) || PyTuple_CheckExact (v )) {
18191846 Py_INCREF (v );
@@ -1996,8 +2023,9 @@ PyMapping_GetItemString(PyObject *o, const char *key)
19962023{
19972024 PyObject * okey , * r ;
19982025
1999- if (key == NULL )
2026+ if (key == NULL ) {
20002027 return null_error ();
2028+ }
20012029
20022030 okey = PyUnicode_FromString (key );
20032031 if (okey == NULL )
@@ -2292,8 +2320,9 @@ PyObject_CallFunction(PyObject *callable, const char *format, ...)
22922320 va_list va ;
22932321 PyObject * args , * result ;
22942322
2295- if (callable == NULL )
2323+ if (callable == NULL ) {
22962324 return null_error ();
2325+ }
22972326
22982327 if (format && * format ) {
22992328 va_start (va , format );
@@ -2318,8 +2347,9 @@ _PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...)
23182347 va_list va ;
23192348 PyObject * args , * result ;
23202349
2321- if (callable == NULL )
2350+ if (callable == NULL ) {
23222351 return null_error ();
2352+ }
23232353
23242354 if (format && * format ) {
23252355 va_start (va , format );
@@ -2375,8 +2405,9 @@ PyObject_CallMethod(PyObject *o, const char *name, const char *format, ...)
23752405 PyObject * func = NULL ;
23762406 PyObject * retval = NULL ;
23772407
2378- if (o == NULL || name == NULL )
2408+ if (o == NULL || name == NULL ) {
23792409 return null_error ();
2410+ }
23802411
23812412 func = PyObject_GetAttrString (o , name );
23822413 if (func == NULL )
@@ -2397,8 +2428,9 @@ _PyObject_CallMethodId(PyObject *o, _Py_Identifier *name,
23972428 PyObject * func = NULL ;
23982429 PyObject * retval = NULL ;
23992430
2400- if (o == NULL || name == NULL )
2431+ if (o == NULL || name == NULL ) {
24012432 return null_error ();
2433+ }
24022434
24032435 func = _PyObject_GetAttrId (o , name );
24042436 if (func == NULL )
@@ -2419,8 +2451,9 @@ _PyObject_CallMethod_SizeT(PyObject *o, const char *name,
24192451 PyObject * func = NULL ;
24202452 PyObject * retval ;
24212453
2422- if (o == NULL || name == NULL )
2454+ if (o == NULL || name == NULL ) {
24232455 return null_error ();
2456+ }
24242457
24252458 func = PyObject_GetAttrString (o , name );
24262459 if (func == NULL )
@@ -2440,8 +2473,9 @@ _PyObject_CallMethodId_SizeT(PyObject *o, _Py_Identifier *name,
24402473 PyObject * func = NULL ;
24412474 PyObject * retval ;
24422475
2443- if (o == NULL || name == NULL )
2476+ if (o == NULL || name == NULL ) {
24442477 return null_error ();
2478+ }
24452479
24462480 func = _PyObject_GetAttrId (o , name );
24472481 if (func == NULL ) {
@@ -2482,8 +2516,9 @@ PyObject_CallMethodObjArgs(PyObject *callable, PyObject *name, ...)
24822516 PyObject * args , * tmp ;
24832517 va_list vargs ;
24842518
2485- if (callable == NULL || name == NULL )
2519+ if (callable == NULL || name == NULL ) {
24862520 return null_error ();
2521+ }
24872522
24882523 callable = PyObject_GetAttr (callable , name );
24892524 if (callable == NULL )
@@ -2511,8 +2546,9 @@ _PyObject_CallMethodIdObjArgs(PyObject *callable,
25112546 PyObject * args , * tmp ;
25122547 va_list vargs ;
25132548
2514- if (callable == NULL || name == NULL )
2549+ if (callable == NULL || name == NULL ) {
25152550 return null_error ();
2551+ }
25162552
25172553 callable = _PyObject_GetAttrId (callable , name );
25182554 if (callable == NULL )
@@ -2539,8 +2575,9 @@ PyObject_CallFunctionObjArgs(PyObject *callable, ...)
25392575 PyObject * args , * tmp ;
25402576 va_list vargs ;
25412577
2542- if (callable == NULL )
2578+ if (callable == NULL ) {
25432579 return null_error ();
2580+ }
25442581
25452582 /* count the args */
25462583 va_start (vargs , callable );
0 commit comments