Commit b3f568f1 authored by Georg Brandl's avatar Georg Brandl

Remove a few stray tabs from bytesobject.c.

parent 0b9b9e04
...@@ -926,38 +926,38 @@ bytes_join(PyObject *cls, PyObject *it) ...@@ -926,38 +926,38 @@ bytes_join(PyObject *cls, PyObject *it)
seq = PySequence_Fast(it, "can only join an iterable"); seq = PySequence_Fast(it, "can only join an iterable");
if (seq == NULL) if (seq == NULL)
return NULL; return NULL;
n = PySequence_Fast_GET_SIZE(seq); n = PySequence_Fast_GET_SIZE(seq);
items = PySequence_Fast_ITEMS(seq); items = PySequence_Fast_ITEMS(seq);
/* Compute the total size, and check that they are all bytes */ /* Compute the total size, and check that they are all bytes */
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
PyObject *obj = items[i]; PyObject *obj = items[i];
if (!PyBytes_Check(obj)) { if (!PyBytes_Check(obj)) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"can only join an iterable of bytes " "can only join an iterable of bytes "
"(item %ld has type '%.100s')", "(item %ld has type '%.100s')",
/* XXX %ld isn't right on Win64 */ /* XXX %ld isn't right on Win64 */
(long)i, obj->ob_type->tp_name); (long)i, obj->ob_type->tp_name);
goto error; goto error;
} }
totalsize += PyBytes_GET_SIZE(obj); totalsize += PyBytes_GET_SIZE(obj);
if (totalsize < 0) { if (totalsize < 0) {
PyErr_NoMemory(); PyErr_NoMemory();
goto error; goto error;
} }
} }
/* Allocate the result, and copy the bytes */ /* Allocate the result, and copy the bytes */
result = PyBytes_FromStringAndSize(NULL, totalsize); result = PyBytes_FromStringAndSize(NULL, totalsize);
if (result == NULL) if (result == NULL)
goto error; goto error;
dest = PyBytes_AS_STRING(result); dest = PyBytes_AS_STRING(result);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
PyObject *obj = items[i]; PyObject *obj = items[i];
Py_ssize_t size = PyBytes_GET_SIZE(obj); Py_ssize_t size = PyBytes_GET_SIZE(obj);
memcpy(dest, PyBytes_AS_STRING(obj), size); memcpy(dest, PyBytes_AS_STRING(obj), size);
dest += size; dest += size;
} }
/* Done */ /* Done */
...@@ -980,15 +980,15 @@ bytes.fromhex('10 2030') -> bytes([0x10, 0x20, 0x30])."); ...@@ -980,15 +980,15 @@ bytes.fromhex('10 2030') -> bytes([0x10, 0x20, 0x30]).");
static int static int
hex_digit_to_int(int c) hex_digit_to_int(int c)
{ {
if (isdigit(c)) if (isdigit(c))
return c - '0'; return c - '0';
else { else {
if (isupper(c)) if (isupper(c))
c = tolower(c); c = tolower(c);
if (c >= 'a' && c <= 'f') if (c >= 'a' && c <= 'f')
return c - 'a' + 10; return c - 'a' + 10;
} }
return -1; return -1;
} }
static PyObject * static PyObject *
...@@ -1092,14 +1092,14 @@ PyTypeObject PyBytes_Type = { ...@@ -1092,14 +1092,14 @@ PyTypeObject PyBytes_Type = {
0, /* tp_as_number */ 0, /* tp_as_number */
&bytes_as_sequence, /* tp_as_sequence */ &bytes_as_sequence, /* tp_as_sequence */
&bytes_as_mapping, /* tp_as_mapping */ &bytes_as_mapping, /* tp_as_mapping */
0, /* tp_hash */ 0, /* tp_hash */
0, /* tp_call */ 0, /* tp_call */
(reprfunc)bytes_str, /* tp_str */ (reprfunc)bytes_str, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */ PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */ 0, /* tp_setattro */
&bytes_as_buffer, /* tp_as_buffer */ &bytes_as_buffer, /* tp_as_buffer */
/* bytes is 'final' or 'sealed' */
Py_TPFLAGS_DEFAULT, /* tp_flags */ Py_TPFLAGS_DEFAULT, /* tp_flags */
/* bytes is 'final' or 'sealed' */
bytes_doc, /* tp_doc */ bytes_doc, /* tp_doc */
0, /* tp_traverse */ 0, /* tp_traverse */
0, /* tp_clear */ 0, /* tp_clear */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment