static int
bytes_getbuffer(PyBytesObject *obj, PyBuffer *view, int flags)
-{
+{
int ret;
void *ptr;
if (view == NULL) {
obj->ob_exports++;
return 0;
}
- if (obj->ob_bytes == NULL)
+ if (obj->ob_bytes == NULL)
ptr = "";
else
ptr = obj->ob_bytes;
vb.len = -1;
if (_getbuffer(a, &va) < 0 ||
_getbuffer(b, &vb) < 0) {
- if (va.len != -1)
+ if (va.len != -1)
PyObject_ReleaseBuffer(a, &va);
if (vb.len != -1)
PyObject_ReleaseBuffer(b, &vb);
memcpy(result->ob_bytes, va.buf, va.len);
memcpy(result->ob_bytes + va.len, vb.buf, vb.len);
}
-
+
PyObject_ReleaseBuffer(a, &va);
PyObject_ReleaseBuffer(b, &vb);
return (PyObject *)result;
if (needed > 0)
memcpy(self->ob_bytes + lo, bytes, needed);
-
+
finish:
- if (vbytes.len != -1)
+ if (vbytes.len != -1)
PyObject_ReleaseBuffer(values, &vbytes);
return res;
}
}
return 0;
}
-
+
/* Use the modern buffer interface */
if (PyObject_CheckBuffer(arg)) {
Py_ssize_t size;
res = cmp ? Py_True : Py_False;
PyObject_ReleaseBuffer(self, &self_bytes);
- PyObject_ReleaseBuffer(other, &other_bytes);
+ PyObject_ReleaseBuffer(other, &other_bytes);
Py_INCREF(res);
return res;
}
from_len = PyBytes_GET_SIZE(from);
}
else {
- if (PyObject_GetBuffer(from, &vfrom, PyBUF_CHARACTER) < 0)
+ if (PyObject_GetBuffer(from, &vfrom, PyBUF_CHARACTER) < 0)
return NULL;
from_s = vfrom.buf;
from_len = vfrom.len;
{
PyObject *latin1;
if (self->ob_bytes)
- latin1 = PyUnicode_DecodeLatin1(self->ob_bytes,
+ latin1 = PyUnicode_DecodeLatin1(self->ob_bytes,
Py_Size(self), NULL);
else
latin1 = PyUnicode_FromString("");