[Python-checkins] r80808 - in python/trunk/Modules/_multiprocessing: connection.h pipe_connection.c win32_functions.c
brett.cannon
python-checkins at python.org
Wed May 5 22:15:15 CEST 2010
Author: brett.cannon
Date: Wed May 5 22:15:14 2010
New Revision: 80808
Log:
Remove extraneous whitespace.
Modified:
python/trunk/Modules/_multiprocessing/connection.h
python/trunk/Modules/_multiprocessing/pipe_connection.c
python/trunk/Modules/_multiprocessing/win32_functions.c
Modified: python/trunk/Modules/_multiprocessing/connection.h
==============================================================================
--- python/trunk/Modules/_multiprocessing/connection.h (original)
+++ python/trunk/Modules/_multiprocessing/connection.h Wed May 5 22:15:14 2010
@@ -1,5 +1,5 @@
/*
- * Definition of a `Connection` type.
+ * Definition of a `Connection` type.
* Used by `socket_connection.c` and `pipe_connection.c`.
*
* connection.h
@@ -42,7 +42,7 @@
static char *kwlist[] = {"handle", "readable", "writable", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, F_HANDLE "|ii", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, F_HANDLE "|ii", kwlist,
&handle, &readable, &writable))
return NULL;
@@ -53,7 +53,7 @@
}
if (!readable && !writable) {
- PyErr_SetString(PyExc_ValueError,
+ PyErr_SetString(PyExc_ValueError,
"either readable or writable must be true");
return NULL;
}
@@ -120,10 +120,10 @@
} else {
if (size < 0) {
PyErr_SetString(PyExc_ValueError, "size is negative");
- return NULL;
+ return NULL;
}
if (offset + size > length) {
- PyErr_SetString(PyExc_ValueError,
+ PyErr_SetString(PyExc_ValueError,
"buffer length < offset + size");
return NULL;
}
@@ -142,7 +142,7 @@
}
static PyObject *
-connection_recvbytes(ConnectionObject *self, PyObject *args)
+connection_recvbytes(ConnectionObject *self, PyObject *args)
{
char *freeme = NULL;
Py_ssize_t res, maxlength = PY_SSIZE_T_MAX;
@@ -152,15 +152,15 @@
return NULL;
CHECK_READABLE(self);
-
+
if (maxlength < 0) {
PyErr_SetString(PyExc_ValueError, "maxlength < 0");
return NULL;
}
-
- res = conn_recv_string(self, self->buffer, CONNECTION_BUFFER_SIZE,
+
+ res = conn_recv_string(self, self->buffer, CONNECTION_BUFFER_SIZE,
&freeme, maxlength);
-
+
if (res < 0) {
if (res == MP_BAD_MESSAGE_LENGTH) {
if ((self->flags & WRITABLE) == 0) {
@@ -173,7 +173,7 @@
}
}
mp_SetError(PyExc_IOError, res);
- } else {
+ } else {
if (freeme == NULL) {
result = PyString_FromStringAndSize(self->buffer, res);
} else {
@@ -181,12 +181,12 @@
PyMem_Free(freeme);
}
}
-
+
return result;
}
static PyObject *
-connection_recvbytes_into(ConnectionObject *self, PyObject *args)
+connection_recvbytes_into(ConnectionObject *self, PyObject *args)
{
char *freeme = NULL, *buffer = NULL;
Py_ssize_t res, length, offset = 0;
@@ -194,8 +194,8 @@
Py_buffer pbuf;
CHECK_READABLE(self);
-
- if (!PyArg_ParseTuple(args, "w*|" F_PY_SSIZE_T,
+
+ if (!PyArg_ParseTuple(args, "w*|" F_PY_SSIZE_T,
&pbuf, &offset))
return NULL;
@@ -205,14 +205,14 @@
if (offset < 0) {
PyErr_SetString(PyExc_ValueError, "negative offset");
goto _error;
- }
+ }
if (offset > length) {
PyErr_SetString(PyExc_ValueError, "offset too large");
goto _error;
}
- res = conn_recv_string(self, buffer+offset, length-offset,
+ res = conn_recv_string(self, buffer+offset, length-offset,
&freeme, PY_SSIZE_T_MAX);
if (res < 0) {
@@ -231,8 +231,8 @@
if (freeme == NULL) {
result = PyInt_FromSsize_t(res);
} else {
- result = PyObject_CallFunction(BufferTooShort,
- F_RBUFFER "#",
+ result = PyObject_CallFunction(BufferTooShort,
+ F_RBUFFER "#",
freeme, res);
PyMem_Free(freeme);
if (result) {
@@ -266,7 +266,7 @@
CHECK_WRITABLE(self);
- pickled_string = PyObject_CallFunctionObjArgs(pickle_dumps, obj,
+ pickled_string = PyObject_CallFunctionObjArgs(pickle_dumps, obj,
pickle_protocol, NULL);
if (!pickled_string)
goto failure;
@@ -298,7 +298,7 @@
CHECK_READABLE(self);
- res = conn_recv_string(self, self->buffer, CONNECTION_BUFFER_SIZE,
+ res = conn_recv_string(self, self->buffer, CONNECTION_BUFFER_SIZE,
&freeme, PY_SSIZE_T_MAX);
if (res < 0) {
@@ -313,7 +313,7 @@
}
}
mp_SetError(PyExc_IOError, res);
- } else {
+ } else {
if (freeme == NULL) {
temp = PyString_FromStringAndSize(self->buffer, res);
} else {
@@ -323,7 +323,7 @@
}
if (temp)
- result = PyObject_CallFunctionObjArgs(pickle_loads,
+ result = PyObject_CallFunctionObjArgs(pickle_loads,
temp, NULL);
Py_XDECREF(temp);
return result;
@@ -400,7 +400,7 @@
static char *conn_type[] = {"read-only", "write-only", "read-write"};
assert(self->flags >= 1 && self->flags <= 3);
- return FROM_FORMAT("<%s %s, handle %zd>",
+ return FROM_FORMAT("<%s %s, handle %zd>",
conn_type[self->flags - 1],
CONNECTION_NAME, (Py_ssize_t)self->handle);
}
@@ -432,20 +432,20 @@
*/
static PyMethodDef connection_methods[] = {
- {"send_bytes", (PyCFunction)connection_sendbytes, METH_VARARGS,
+ {"send_bytes", (PyCFunction)connection_sendbytes, METH_VARARGS,
"send the byte data from a readable buffer-like object"},
- {"recv_bytes", (PyCFunction)connection_recvbytes, METH_VARARGS,
+ {"recv_bytes", (PyCFunction)connection_recvbytes, METH_VARARGS,
"receive byte data as a string"},
{"recv_bytes_into",(PyCFunction)connection_recvbytes_into,METH_VARARGS,
"receive byte data into a writeable buffer-like object\n"
"returns the number of bytes read"},
- {"send", (PyCFunction)connection_send_obj, METH_O,
+ {"send", (PyCFunction)connection_send_obj, METH_O,
"send a (picklable) object"},
- {"recv", (PyCFunction)connection_recv_obj, METH_NOARGS,
+ {"recv", (PyCFunction)connection_recv_obj, METH_NOARGS,
"receive a (picklable) object"},
- {"poll", (PyCFunction)connection_poll, METH_VARARGS,
+ {"poll", (PyCFunction)connection_poll, METH_VARARGS,
"whether there is any input available to be read"},
{"fileno", (PyCFunction)connection_fileno, METH_NOARGS,
"file descriptor or handle of the connection"},
@@ -456,11 +456,11 @@
};
static PyGetSetDef connection_getset[] = {
- {"closed", (getter)connection_closed, NULL,
+ {"closed", (getter)connection_closed, NULL,
"True if the connection is closed", NULL},
- {"readable", (getter)connection_readable, NULL,
+ {"readable", (getter)connection_readable, NULL,
"True if the connection is readable", NULL},
- {"writable", (getter)connection_writable, NULL,
+ {"writable", (getter)connection_writable, NULL,
"True if the connection is writable", NULL},
{NULL}
};
@@ -494,7 +494,7 @@
/* tp_getattro */ 0,
/* tp_setattro */ 0,
/* tp_as_buffer */ 0,
- /* tp_flags */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ /* tp_flags */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
Py_TPFLAGS_HAVE_WEAKREFS,
/* tp_doc */ connection_doc,
/* tp_traverse */ 0,
Modified: python/trunk/Modules/_multiprocessing/pipe_connection.c
==============================================================================
--- python/trunk/Modules/_multiprocessing/pipe_connection.c (original)
+++ python/trunk/Modules/_multiprocessing/pipe_connection.c Wed May 5 22:15:14 2010
@@ -39,7 +39,7 @@
*/
static Py_ssize_t
-conn_recv_string(ConnectionObject *conn, char *buffer,
+conn_recv_string(ConnectionObject *conn, char *buffer,
size_t buflength, char **newbuffer, size_t maxlength)
{
DWORD left, length, full_length, err;
@@ -130,7 +130,7 @@
Sleep(delay);
/* check for signals */
- Py_BLOCK_THREADS
+ Py_BLOCK_THREADS
res = PyErr_CheckSignals();
Py_UNBLOCK_THREADS
Modified: python/trunk/Modules/_multiprocessing/win32_functions.c
==============================================================================
--- python/trunk/Modules/_multiprocessing/win32_functions.c (original)
+++ python/trunk/Modules/_multiprocessing/win32_functions.c Wed May 5 22:15:14 2010
@@ -26,7 +26,7 @@
return NULL;
Py_BEGIN_ALLOW_THREADS
- success = CloseHandle(hObject);
+ success = CloseHandle(hObject);
Py_END_ALLOW_THREADS
if (!success)
@@ -42,7 +42,7 @@
LPOVERLAPPED lpOverlapped;
BOOL success;
- if (!PyArg_ParseTuple(args, F_HANDLE F_POINTER,
+ if (!PyArg_ParseTuple(args, F_HANDLE F_POINTER,
&hNamedPipe, &lpOverlapped))
return NULL;
@@ -68,17 +68,17 @@
HANDLE hTemplateFile;
HANDLE handle;
- if (!PyArg_ParseTuple(args, "s" F_DWORD F_DWORD F_POINTER
+ if (!PyArg_ParseTuple(args, "s" F_DWORD F_DWORD F_POINTER
F_DWORD F_DWORD F_HANDLE,
- &lpFileName, &dwDesiredAccess, &dwShareMode,
- &lpSecurityAttributes, &dwCreationDisposition,
+ &lpFileName, &dwDesiredAccess, &dwShareMode,
+ &lpSecurityAttributes, &dwCreationDisposition,
&dwFlagsAndAttributes, &hTemplateFile))
return NULL;
Py_BEGIN_ALLOW_THREADS
- handle = CreateFile(lpFileName, dwDesiredAccess,
- dwShareMode, lpSecurityAttributes,
- dwCreationDisposition,
+ handle = CreateFile(lpFileName, dwDesiredAccess,
+ dwShareMode, lpSecurityAttributes,
+ dwCreationDisposition,
dwFlagsAndAttributes, hTemplateFile);
Py_END_ALLOW_THREADS
@@ -101,17 +101,17 @@
LPSECURITY_ATTRIBUTES lpSecurityAttributes;
HANDLE handle;
- if (!PyArg_ParseTuple(args, "s" F_DWORD F_DWORD F_DWORD
+ if (!PyArg_ParseTuple(args, "s" F_DWORD F_DWORD F_DWORD
F_DWORD F_DWORD F_DWORD F_POINTER,
- &lpName, &dwOpenMode, &dwPipeMode,
- &nMaxInstances, &nOutBufferSize,
+ &lpName, &dwOpenMode, &dwPipeMode,
+ &nMaxInstances, &nOutBufferSize,
&nInBufferSize, &nDefaultTimeOut,
&lpSecurityAttributes))
return NULL;
Py_BEGIN_ALLOW_THREADS
- handle = CreateNamedPipe(lpName, dwOpenMode, dwPipeMode,
- nMaxInstances, nOutBufferSize,
+ handle = CreateNamedPipe(lpName, dwOpenMode, dwPipeMode,
+ nMaxInstances, nOutBufferSize,
nInBufferSize, nDefaultTimeOut,
lpSecurityAttributes);
Py_END_ALLOW_THREADS
@@ -155,11 +155,11 @@
DWORD dwProcessId;
HANDLE handle;
- if (!PyArg_ParseTuple(args, F_DWORD "i" F_DWORD,
+ if (!PyArg_ParseTuple(args, F_DWORD "i" F_DWORD,
&dwDesiredAccess, &bInheritHandle, &dwProcessId))
return NULL;
- handle = OpenProcess(dwDesiredAccess, bInheritHandle, dwProcessId);
+ handle = OpenProcess(dwDesiredAccess, bInheritHandle, dwProcessId);
if (handle == NULL)
return PyErr_SetFromWindowsErr(0);
@@ -174,7 +174,7 @@
DWORD dwArgs[3], *pArgs[3] = {NULL, NULL, NULL};
int i;
- if (!PyArg_ParseTuple(args, F_HANDLE "OOO",
+ if (!PyArg_ParseTuple(args, F_HANDLE "OOO",
&hNamedPipe, &oArgs[0], &oArgs[1], &oArgs[2]))
return NULL;
More information about the Python-checkins
mailing list