mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-32150: Expand tabs to spaces in C files. (#4583)
This commit is contained in:
parent
08d2b86a10
commit
598ceae876
27 changed files with 213 additions and 213 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -8,5 +8,5 @@
|
|||
const char *
|
||||
Py_GetPlatform(void)
|
||||
{
|
||||
return PLATFORM;
|
||||
return PLATFORM;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -19,5 +19,5 @@ int PyFPE_counter = 0;
|
|||
double
|
||||
PyFPE_dummy(void *dummy)
|
||||
{
|
||||
return 1.0;
|
||||
return 1.0;
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue