Skip to content

Commit 8272660

Browse files
authored
gh-135379: fix MSVC warning: conversion from 'stwodigits' to 'digit' (GH-135714)
fix warning C4244: 'initializing': conversion from 'stwodigits' to 'digit', possible loss of data
1 parent 2dbada1 commit 8272660

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/longobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ medium_from_stwodigits(stwodigits x)
337337
}
338338
_PyObject_Init((PyObject*)v, &PyLong_Type);
339339
}
340-
digit abs_x = x < 0 ? -x : x;
340+
digit abs_x = x < 0 ? (digit)(-x) : (digit)x;
341341
_PyLong_SetSignAndDigitCount(v, x<0?-1:1, 1);
342342
v->long_value.ob_digit[0] = abs_x;
343343
return PyStackRef_FromPyObjectStealMortal((PyObject *)v);

0 commit comments

Comments
 (0)