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

Skip to content

Commit 50b2b6e

Browse files
committed
Issue 4497: silence compiler warnings on Windows.
1 parent 4836781 commit 50b2b6e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Objects/longobject.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ get_small_int(int ival)
4444
}
4545
#define CHECK_SMALL_INT(ival) \
4646
do if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { \
47-
return get_small_int(ival); \
47+
return get_small_int((int)ival); \
4848
} while(0)
4949

5050
static PyLongObject *
@@ -198,7 +198,7 @@ PyLong_FromLong(long ival)
198198
v = _PyLong_New(1);
199199
if (v) {
200200
Py_SIZE(v) = sign;
201-
v->ob_digit[0] = ival;
201+
v->ob_digit[0] = (digit)ival;
202202
}
203203
return (PyObject*)v;
204204
}
@@ -209,7 +209,7 @@ PyLong_FromLong(long ival)
209209
if (v) {
210210
Py_SIZE(v) = 2*sign;
211211
v->ob_digit[0] = (digit)ival & PyLong_MASK;
212-
v->ob_digit[1] = ival >> PyLong_SHIFT;
212+
v->ob_digit[1] = (digit)(ival >> PyLong_SHIFT);
213213
}
214214
return (PyObject*)v;
215215
}
@@ -1103,7 +1103,7 @@ PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG ival)
11031103
int ndigits = 0;
11041104

11051105
if (ival < PyLong_BASE)
1106-
return PyLong_FromLong(ival);
1106+
return PyLong_FromLong((long)ival);
11071107
/* Count the number of Python digits. */
11081108
t = (unsigned PY_LONG_LONG)ival;
11091109
while (t) {

0 commit comments

Comments
 (0)