Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 50e8603

Browse files
authored
bpo-29619: Do not use HAVE_LARGEFILE_SUPPORT for type conversions (GH-1666).
bpo-29619: Do not use HAVE_LARGEFILE_SUPPORT for type conversions (GH-1666). * Use only the LongLong form for the conversions.
1 parent 054e091 commit 50e8603

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

Modules/posixmodule.c

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,14 +1927,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
19271927
return NULL;
19281928

19291929
PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long)st->st_mode));
1930-
#if defined(HAVE_LARGEFILE_SUPPORT) || defined(MS_WINDOWS)
19311930
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(st->st_ino));
1932-
PyStructSequence_SET_ITEM(v, 1,
1933-
PyLong_FromUnsignedLongLong(st->st_ino));
1934-
#else
1935-
Py_BUILD_ASSERT(sizeof(unsigned long) >= sizeof(st->st_ino));
1936-
PyStructSequence_SET_ITEM(v, 1, PyLong_FromUnsignedLong(st->st_ino));
1937-
#endif
1931+
PyStructSequence_SET_ITEM(v, 1, PyLong_FromUnsignedLongLong(st->st_ino));
19381932
#ifdef MS_WINDOWS
19391933
PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev));
19401934
#else
@@ -1948,12 +1942,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
19481942
PyStructSequence_SET_ITEM(v, 4, _PyLong_FromUid(st->st_uid));
19491943
PyStructSequence_SET_ITEM(v, 5, _PyLong_FromGid(st->st_gid));
19501944
#endif
1951-
#ifdef HAVE_LARGEFILE_SUPPORT
1952-
PyStructSequence_SET_ITEM(v, 6,
1953-
PyLong_FromLongLong((long long)st->st_size));
1954-
#else
1955-
PyStructSequence_SET_ITEM(v, 6, PyLong_FromLong(st->st_size));
1956-
#endif
1945+
Py_BUILD_ASSERT(sizeof(long long) >= sizeof(st->st_size));
1946+
PyStructSequence_SET_ITEM(v, 6, PyLong_FromLongLong(st->st_size));
19571947

19581948
#if defined(HAVE_STAT_TV_NSEC)
19591949
ansec = st->st_atim.tv_nsec;
@@ -11451,11 +11441,8 @@ os_DirEntry_inode_impl(DirEntry *self)
1145111441
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(self->win32_file_index));
1145211442
return PyLong_FromUnsignedLongLong(self->win32_file_index);
1145311443
#else /* POSIX */
11454-
#ifdef HAVE_LARGEFILE_SUPPORT
11455-
return PyLong_FromLongLong((long long)self->d_ino);
11456-
#else
11457-
return PyLong_FromLong((long)self->d_ino);
11458-
#endif
11444+
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(self->d_ino));
11445+
return PyLong_FromUnsignedLongLong(self->d_ino);
1145911446
#endif
1146011447
}
1146111448

0 commit comments

Comments
 (0)