Skip to content

Commit 7d5f4d2

Browse files
committed
cosmetic changes
1 parent 08ce01c commit 7d5f4d2

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Objects/unicodeobject.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,8 +1314,9 @@ ascii_new(Py_ssize_t size)
13141314
void *data;
13151315
Py_ssize_t struct_size = sizeof(PyASCIIObject);
13161316

1317-
if (size > ((PY_SSIZE_T_MAX - struct_size) - 1))
1317+
if (size > ((PY_SSIZE_T_MAX - struct_size) - 1)) {
13181318
return PyErr_NoMemory();
1319+
}
13191320

13201321
/* Duplicated allocation code from _PyObject_New() instead of a call to
13211322
* PyObject_New() so we are able to allocate space for the object and
@@ -1339,7 +1340,7 @@ ascii_new(Py_ssize_t size)
13391340
((char*)data)[size] = 0;
13401341

13411342
#ifdef Py_DEBUG
1342-
unicode_fill_invalid((PyObject*)unicode, 0);
1343+
unicode_fill_invalid((PyObject*)obj, 0);
13431344
#endif
13441345
assert(_PyUnicode_CheckConsistency(obj, 0));
13451346
return obj;
@@ -5092,12 +5093,16 @@ ascii_decode(const char *start, const char *end, Py_UCS1 *dest)
50925093

50935094
#if (defined(__clang__) || defined(__GNUC__))
50945095
#define HAS_CTZ 1
5095-
static inline unsigned int ctz(size_t v) {
5096+
static inline unsigned int
5097+
ctz(size_t v)
5098+
{
50965099
return __builtin_ctzll((unsigned long long)v);
50975100
}
50985101
#elif defined(_MSC_VER)
50995102
#define HAS_CTZ 1
5100-
static inline unsigned int ctz(size_t v) {
5103+
static inline unsigned int
5104+
ctz(size_t v)
5105+
{
51015106
unsigned long pos;
51025107
#if SIZEOF_SIZE_T == 4
51035108
_BitScanForward(&pos, v);
@@ -5410,10 +5415,10 @@ unicode_decode_utf8(const char *s, Py_ssize_t size,
54105415
if (error_handler == _Py_ERROR_STRICT && !consumed && ch >= 0xc2) {
54115416
maxsize = utf8_count_codepoints((const unsigned char *)s, (const unsigned char *)end);
54125417
if (ch < 0xc4) { // latin1
5413-
maxchr = 255;
5418+
maxchr = 0xff;
54145419
}
54155420
else if (ch < 0xf0) { // ucs2
5416-
maxchr = 65535;
5421+
maxchr = 0xffff;
54175422
}
54185423
else { // ucs4
54195424
maxchr = 0x10ffff;
@@ -5493,8 +5498,8 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
54935498
Py_ssize_t *consumed)
54945499
{
54955500
return unicode_decode_utf8(s, size,
5496-
errors ? _Py_ERROR_UNKNOWN : _Py_ERROR_STRICT,
5497-
errors, consumed);
5501+
errors ? _Py_ERROR_UNKNOWN : _Py_ERROR_STRICT,
5502+
errors, consumed);
54985503
}
54995504

55005505

0 commit comments

Comments
 (0)