mirror of
https://github.com/python/cpython.git
synced 2025-09-29 11:45:57 +00:00
bpo-29619: Do not use HAVE_LARGEFILE_SUPPORT for type conversions (GH-1666) (#3102)
Use only the LongLong form for the conversions
(cherry picked from commit 50e86033de
)
This commit is contained in:
parent
78c66a641a
commit
ffbb6f7334
1 changed files with 5 additions and 18 deletions
|
@ -1934,14 +1934,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long)st->st_mode));
|
PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long)st->st_mode));
|
||||||
#if defined(HAVE_LARGEFILE_SUPPORT) || defined(MS_WINDOWS)
|
|
||||||
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(st->st_ino));
|
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(st->st_ino));
|
||||||
PyStructSequence_SET_ITEM(v, 1,
|
PyStructSequence_SET_ITEM(v, 1, PyLong_FromUnsignedLongLong(st->st_ino));
|
||||||
PyLong_FromUnsignedLongLong(st->st_ino));
|
|
||||||
#else
|
|
||||||
Py_BUILD_ASSERT(sizeof(unsigned long) >= sizeof(st->st_ino));
|
|
||||||
PyStructSequence_SET_ITEM(v, 1, PyLong_FromUnsignedLong(st->st_ino));
|
|
||||||
#endif
|
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev));
|
PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev));
|
||||||
#else
|
#else
|
||||||
|
@ -1955,12 +1949,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
|
||||||
PyStructSequence_SET_ITEM(v, 4, _PyLong_FromUid(st->st_uid));
|
PyStructSequence_SET_ITEM(v, 4, _PyLong_FromUid(st->st_uid));
|
||||||
PyStructSequence_SET_ITEM(v, 5, _PyLong_FromGid(st->st_gid));
|
PyStructSequence_SET_ITEM(v, 5, _PyLong_FromGid(st->st_gid));
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LARGEFILE_SUPPORT
|
Py_BUILD_ASSERT(sizeof(long long) >= sizeof(st->st_size));
|
||||||
PyStructSequence_SET_ITEM(v, 6,
|
PyStructSequence_SET_ITEM(v, 6, PyLong_FromLongLong(st->st_size));
|
||||||
PyLong_FromLongLong((long long)st->st_size));
|
|
||||||
#else
|
|
||||||
PyStructSequence_SET_ITEM(v, 6, PyLong_FromLong(st->st_size));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_STAT_TV_NSEC)
|
#if defined(HAVE_STAT_TV_NSEC)
|
||||||
ansec = st->st_atim.tv_nsec;
|
ansec = st->st_atim.tv_nsec;
|
||||||
|
@ -11484,11 +11474,8 @@ DirEntry_inode(DirEntry *self)
|
||||||
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(self->win32_file_index));
|
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(self->win32_file_index));
|
||||||
return PyLong_FromUnsignedLongLong(self->win32_file_index);
|
return PyLong_FromUnsignedLongLong(self->win32_file_index);
|
||||||
#else /* POSIX */
|
#else /* POSIX */
|
||||||
#ifdef HAVE_LARGEFILE_SUPPORT
|
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(self->d_ino));
|
||||||
return PyLong_FromLongLong((long long)self->d_ino);
|
return PyLong_FromUnsignedLongLong(self->d_ino);
|
||||||
#else
|
|
||||||
return PyLong_FromLong((long)self->d_ino);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue