diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-11-28 17:56:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-28 17:56:10 +0200 |
commit | 598ceae876ff4a23072e59945597e945583de4ab (patch) | |
tree | a7c0c1380c40bda01c70b8bd40ba47d1b2f6d54a /Python | |
parent | 08d2b86a1058b733bb7f1ae2b55818dd9687d21c (diff) | |
download | cpython-git-598ceae876ff4a23072e59945597e945583de4ab.tar.gz |
bpo-32150: Expand tabs to spaces in C files. (#4583)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/dup2.c | 18 | ||||
-rw-r--r-- | Python/getplatform.c | 2 | ||||
-rw-r--r-- | Python/getversion.c | 8 | ||||
-rw-r--r-- | Python/pyfpe.c | 2 | ||||
-rw-r--r-- | Python/pystrhex.c | 12 | ||||
-rw-r--r-- | Python/strdup.c | 12 |
6 files changed, 27 insertions, 27 deletions
diff --git a/Python/dup2.c b/Python/dup2.c index 2579afd443..7c6bbfce11 100644 --- a/Python/dup2.c +++ b/Python/dup2.c @@ -19,13 +19,13 @@ int dup2(int fd1, int fd2) { - if (fd1 != fd2) { - if (fcntl(fd1, F_GETFL) < 0) - return BADEXIT; - if (fcntl(fd2, F_GETFL) >= 0) - close(fd2); - if (fcntl(fd1, F_DUPFD, fd2) < 0) - return BADEXIT; - } - return fd2; + if (fd1 != fd2) { + if (fcntl(fd1, F_GETFL) < 0) + return BADEXIT; + if (fcntl(fd2, F_GETFL) >= 0) + close(fd2); + if (fcntl(fd1, F_DUPFD, fd2) < 0) + return BADEXIT; + } + return fd2; } diff --git a/Python/getplatform.c b/Python/getplatform.c index 68991402b5..81a0f7ac53 100644 --- a/Python/getplatform.c +++ b/Python/getplatform.c @@ -8,5 +8,5 @@ const char * Py_GetPlatform(void) { - return PLATFORM; + return PLATFORM; } diff --git a/Python/getversion.c b/Python/getversion.c index 7bd6efd0a0..c32b6f9d60 100644 --- a/Python/getversion.c +++ b/Python/getversion.c @@ -8,8 +8,8 @@ const char * Py_GetVersion(void) { - static char version[250]; - PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s", - PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler()); - return version; + static char version[250]; + PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s", + PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler()); + return version; } diff --git a/Python/pyfpe.c b/Python/pyfpe.c index ab0ef83ead..925fa4654d 100644 --- a/Python/pyfpe.c +++ b/Python/pyfpe.c @@ -19,5 +19,5 @@ int PyFPE_counter = 0; double PyFPE_dummy(void *dummy) { - return 1.0; + return 1.0; } diff --git a/Python/pystrhex.c b/Python/pystrhex.c index 1259ed12df..6dbf32dcc4 100644 --- a/Python/pystrhex.c +++ b/Python/pystrhex.c @@ -16,14 +16,14 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, if (return_bytes) { /* If _PyBytes_FromSize() were public we could avoid malloc+copy. */ retbuf = (Py_UCS1*) PyMem_Malloc(arglen*2); - if (!retbuf) - return PyErr_NoMemory(); + if (!retbuf) + return PyErr_NoMemory(); retval = NULL; /* silence a compiler warning, assigned later. */ } else { - retval = PyUnicode_New(arglen*2, 127); - if (!retval) - return NULL; - retbuf = PyUnicode_1BYTE_DATA(retval); + retval = PyUnicode_New(arglen*2, 127); + if (!retval) + return NULL; + retbuf = PyUnicode_1BYTE_DATA(retval); } /* make hex version of string, taken from shamodule.c */ diff --git a/Python/strdup.c b/Python/strdup.c index 769d3db130..99dc77417b 100644 --- a/Python/strdup.c +++ b/Python/strdup.c @@ -5,10 +5,10 @@ char * strdup(const char *str) { - if (str != NULL) { - char *copy = malloc(strlen(str) + 1); - if (copy != NULL) - return strcpy(copy, str); - } - return NULL; + if (str != NULL) { + char *copy = malloc(strlen(str) + 1); + if (copy != NULL) + return strcpy(copy, str); + } + return NULL; } |