Skip to content

Commit b2ef93d

Browse files
committed
Style: PEP7: add braces.
1 parent 25bbf4d commit b2ef93d

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

Objects/longobject.c

+18-11
Original file line numberDiff line numberDiff line change
@@ -4502,47 +4502,53 @@ long_rshift1(PyLongObject *a, Py_ssize_t wordshift, digit remshift)
45024502

45034503
if (IS_MEDIUM_VALUE(a)) {
45044504
stwodigits sval;
4505-
if (wordshift > 0)
4505+
if (wordshift > 0) {
45064506
return get_small_int(-(Py_SIZE(a) < 0));
4507-
4507+
}
45084508
sval = Py_ARITHMETIC_RIGHT_SHIFT(stwodigits, medium_value(a), remshift);
4509-
if (IS_SMALL_INT(sval))
4509+
if (IS_SMALL_INT(sval)) {
45104510
return get_small_int((sdigit)sval);
4511-
4511+
}
45124512
z = _PyLong_New(Py_SIZE(a));
45134513
z->ob_digit[0] = (digit)(a->ob_digit[0] >> remshift);
4514-
if (Py_SIZE(a) < 0 && (a->ob_digit[0] & ~(PyLong_MASK << remshift)))
4514+
if (Py_SIZE(a) < 0 && (a->ob_digit[0] & ~(PyLong_MASK << remshift))) {
45154515
z->ob_digit[0] += 1;
4516+
}
45164517
return (PyObject *)z;
45174518
}
45184519

45194520
newsize = Py_ABS(Py_SIZE(a)) - wordshift;
4520-
if (newsize <= 0)
4521+
if (newsize <= 0) {
45214522
return PyLong_FromLong(0);
4523+
}
45224524
z = _PyLong_New(newsize);
4523-
if (z == NULL)
4525+
if (z == NULL) {
45244526
return NULL;
4527+
}
45254528

45264529
hishift = PyLong_SHIFT - remshift;
45274530
lomask = ((digit)1 << hishift) - 1;
45284531
himask = PyLong_MASK ^ lomask;
45294532
for (i = 0, j = wordshift; i < newsize; i++, j++) {
45304533
z->ob_digit[i] = (a->ob_digit[j] >> remshift) & lomask;
4531-
if (i + 1 < newsize)
4534+
if (i + 1 < newsize) {
45324535
z->ob_digit[i] |= (a->ob_digit[j + 1] << hishift) & himask;
4536+
}
45334537
}
45344538

45354539
if (Py_SIZE(a) < 0) {
45364540
Py_SET_SIZE(z, -newsize);
45374541
omitmark = a->ob_digit[wordshift] & ((1 << remshift) - 1);
4538-
for (j = 0; omitmark == 0 && j < wordshift; j++)
4542+
for (j = 0; omitmark == 0 && j < wordshift; j++) {
45394543
omitmark |= a->ob_digit[j];
4544+
}
45404545
if (omitmark) {
45414546
PyLongObject *z0 = z;
45424547
z = (PyLongObject *) long_sub(z0, (PyLongObject *)_PyLong_GetOne());
45434548
Py_DECREF(z0);
4544-
if (z == NULL)
4549+
if (z == NULL) {
45454550
return NULL;
4551+
}
45464552
}
45474553
}
45484554

@@ -4596,8 +4602,9 @@ long_lshift1(PyLongObject *a, Py_ssize_t wordshift, digit remshift)
45964602
if (wordshift == 0 && IS_MEDIUM_VALUE(a) &&
45974603
(a->ob_digit[0] & ~(PyLong_MASK >> remshift)) == 0) {
45984604
stwodigits sval = medium_value(a) << remshift;
4599-
if (IS_SMALL_INT(sval))
4605+
if (IS_SMALL_INT(sval)) {
46004606
return get_small_int((sdigit)sval);
4607+
}
46014608
z = _PyLong_New(Py_SIZE(a));
46024609
z->ob_digit[0] = (digit)(a->ob_digit[0] << remshift);
46034610
return (PyObject *)z;

0 commit comments

Comments
 (0)