From 82726600be84773c9cca6febdead7a804f4a68bd Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Fri, 20 Jun 2025 11:05:33 +0200 Subject: [PATCH] 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 --- Objects/longobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/longobject.c b/Objects/longobject.c index 59b10355ad9..557bb6e1dd9 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -337,7 +337,7 @@ medium_from_stwodigits(stwodigits x) } _PyObject_Init((PyObject*)v, &PyLong_Type); } - digit abs_x = x < 0 ? -x : x; + digit abs_x = x < 0 ? (digit)(-x) : (digit)x; _PyLong_SetSignAndDigitCount(v, x<0?-1:1, 1); v->long_value.ob_digit[0] = abs_x; return PyStackRef_FromPyObjectStealMortal((PyObject *)v);