bpo-32150: Expand tabs to spaces in C files. (#4583)

This commit is contained in:
Serhiy Storchaka 2017-11-28 17:56:10 +02:00 committed by GitHub
parent 08d2b86a10
commit 598ceae876
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 213 additions and 213 deletions

View file

@ -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;
}

View file

@ -8,5 +8,5 @@
const char *
Py_GetPlatform(void)
{
return PLATFORM;
return PLATFORM;
}

View file

@ -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;
}

View file

@ -19,5 +19,5 @@ int PyFPE_counter = 0;
double
PyFPE_dummy(void *dummy)
{
return 1.0;
return 1.0;
}

View file

@ -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 */

View file

@ -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;
}