diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-09-17 07:54:55 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-09-17 07:54:55 (GMT) |
commit | ca56dd4767617a2f5e946130de4beb06442a5cd5 (patch) | |
tree | 8697f0e83d6b4f3758eaf4b89abc944b6e6db71f /Python | |
parent | fd2f85d6e4e8abc9c943cf56cf45527d522c7882 (diff) | |
download | cpython-ca56dd4767617a2f5e946130de4beb06442a5cd5.zip cpython-ca56dd4767617a2f5e946130de4beb06442a5cd5.tar.gz cpython-ca56dd4767617a2f5e946130de4beb06442a5cd5.tar.bz2 |
Issue #28139: Fix messed up indentation
Also update the classmethod and staticmethod doc strings and comments to
match the RST documentation.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bltinmodule.c | 66 | ||||
-rw-r--r-- | Python/mactoolboxglue.c | 20 | ||||
-rw-r--r-- | Python/thread_wince.h | 10 |
3 files changed, 47 insertions, 49 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 2977bcd..f03e488 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2923,20 +2923,20 @@ filterstring(PyObject *func, PyObject *strobj) if (need<2*outlen) { need = 2*outlen; - } - if (_PyString_Resize(&result, need)) { - Py_DECREF(item); - return NULL; - } - outlen = need; - } - memcpy( - PyString_AS_STRING(result) + j, - PyString_AS_STRING(item), - reslen - ); - j += reslen; } + if (_PyString_Resize(&result, need)) { + Py_DECREF(item); + return NULL; + } + outlen = need; + } + memcpy( + PyString_AS_STRING(result) + j, + PyString_AS_STRING(item), + reslen + ); + j += reslen; + } } Py_DECREF(item); if (ok < 0) @@ -3031,29 +3031,27 @@ filterunicode(PyObject *func, PyObject *strobj) assert(outlen >= 0); if (need > outlen) { - /* overallocate, - to avoid reallocations */ + /* overallocate, to avoid reallocations */ if (need < 2 * outlen) { - if (outlen > PY_SSIZE_T_MAX / 2) { - Py_DECREF(item); - return NULL; - } else { - need = 2 * outlen; - } - } - - if (PyUnicode_Resize( - &result, need) < 0) { - Py_DECREF(item); - goto Fail_1; - } - outlen = need; - } - memcpy(PyUnicode_AS_UNICODE(result) + j, - PyUnicode_AS_UNICODE(item), - reslen*sizeof(Py_UNICODE)); - j += reslen; + if (outlen > PY_SSIZE_T_MAX / 2) { + Py_DECREF(item); + return NULL; + } else { + need = 2 * outlen; + } } + + if (PyUnicode_Resize(&result, need) < 0) { + Py_DECREF(item); + goto Fail_1; + } + outlen = need; + } + memcpy(PyUnicode_AS_UNICODE(result) + j, + PyUnicode_AS_UNICODE(item), + reslen*sizeof(Py_UNICODE)); + j += reslen; + } } Py_DECREF(item); if (ok < 0) diff --git a/Python/mactoolboxglue.c b/Python/mactoolboxglue.c index a38c09a..b91be3b 100644 --- a/Python/mactoolboxglue.c +++ b/Python/mactoolboxglue.c @@ -356,11 +356,11 @@ PyObject *(*PyMacGluePtr_##routinename)(object); \ \ PyObject *routinename(object cobj) { \ if (!PyMacGluePtr_##routinename) { \ - if (!PyImport_ImportModule(module)) return NULL; \ - if (!PyMacGluePtr_##routinename) { \ - PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ - return NULL; \ - } \ + if (!PyImport_ImportModule(module)) return NULL; \ + if (!PyMacGluePtr_##routinename) { \ + PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ + return NULL; \ + } \ } \ return (*PyMacGluePtr_##routinename)(cobj); \ } @@ -370,11 +370,11 @@ int (*PyMacGluePtr_##routinename)(PyObject *, object *); \ \ int routinename(PyObject *pyobj, object *cobj) { \ if (!PyMacGluePtr_##routinename) { \ - if (!PyImport_ImportModule(module)) return 0; \ - if (!PyMacGluePtr_##routinename) { \ - PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ - return 0; \ - } \ + if (!PyImport_ImportModule(module)) return 0; \ + if (!PyMacGluePtr_##routinename) { \ + PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ + return 0; \ + } \ } \ return (*PyMacGluePtr_##routinename)(pyobj, cobj); \ } diff --git a/Python/thread_wince.h b/Python/thread_wince.h index b9c10da..25634b8 100644 --- a/Python/thread_wince.h +++ b/Python/thread_wince.h @@ -72,12 +72,12 @@ PyThread_type_lock PyThread_allocate_lock(void) dprintf(("PyThread_allocate_lock called\n")); if (!initialized) - PyThread_init_thread(); + PyThread_init_thread(); aLock = CreateEvent(NULL, /* Security attributes */ - 0, /* Manual-Reset */ + 0, /* Manual-Reset */ 1, /* Is initially signalled */ - NULL); /* Name of event */ + NULL); /* Name of event */ dprintf(("%ld: PyThread_allocate_lock() -> %p\n", PyThread_get_thread_ident(), aLock)); @@ -117,7 +117,7 @@ int PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag) #endif if (waitResult != WAIT_OBJECT_0) { - success = 0; /* We failed */ + success = 0; /* We failed */ } dprintf(("%ld: PyThread_acquire_lock(%p, %d) -> %d\n", PyThread_get_thread_ident(),aLock, waitflag, success)); @@ -130,7 +130,7 @@ void PyThread_release_lock(PyThread_type_lock aLock) dprintf(("%ld: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock)); if (!SetEvent(aLock)) - dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n", PyThread_get_thread_ident(), aLock, GetLastError())); + dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n", PyThread_get_thread_ident(), aLock, GetLastError())); } |