bpo-37802: Fix a compiler warning in longobject.c (GH-16517)

bpo-37802, bpo-38321: Fix the following warnings:

    longobject.c(420): warning C4244: 'function': conversion from
    'unsigned __int64' to 'sdigit', possible loss of data

    longobject.c(428): warning C4267: 'function': conversion from
    'size_t' to 'sdigit', possible loss of data
This commit is contained in:
Victor Stinner 2019-10-01 13:29:53 +02:00 committed by GitHub
parent 5e0ea7540f
commit 6314abcc08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -383,7 +383,7 @@ PyLong_FromLong(long ival)
#define PYLONG_FROM_UINT(INT_TYPE, ival) \ #define PYLONG_FROM_UINT(INT_TYPE, ival) \
do { \ do { \
if (IS_SMALL_UINT(ival)) { \ if (IS_SMALL_UINT(ival)) { \
return get_small_int((ival)); \ return get_small_int((sdigit)(ival)); \
} \ } \
/* Count the number of Python digits. */ \ /* Count the number of Python digits. */ \
Py_ssize_t ndigits = 0; \ Py_ssize_t ndigits = 0; \