You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
remove unnecessary operation in long_compare() #79877
I reopen the issue. The win32 job of Azure Pipelines now logs a compiler warning:
Objects\longobject.c(412,5): warning C4244: 'function': conversion from 'unsigned long' to 'sdigit', possible loss of data
Objects\longobject.c(420,5): warning C4244: 'function': conversion from 'unsigned __int64' to 'sdigit', possible loss of data
I looked at Git history and it seems like I fixed the compiler warning with commit 6314abc:
commit 6314abcc08f5d0f3d3a915dc9455ea223fa65517
Author: Victor Stinner <[email protected]>
Date: Tue Oct 1 13:29:53 2019 +0200
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
Thanks for the reminder @iritkatriel, I closed the issue.
Activity
animalize commentedon Jan 9, 2019
This function in /Objects/longobject.c is used to compare two PyLongObject's value.
We only need the sign, converting to -1 or +1 is not necessary.
methane commentedon Sep 18, 2019
New changeset 42acb7b by Inada Naoki (HongWeipeng) in branch 'master':
bpo-35696: Simplify long_compare() (GH-16146)
42acb7b
vstinner commentedon Sep 20, 2019
I reopen the issue. The win32 job of Azure Pipelines now logs a compiler warning:
Objects\longobject.c(412,5): warning C4244: 'function': conversion from 'unsigned long' to 'sdigit', possible loss of data
Objects\longobject.c(420,5): warning C4244: 'function': conversion from 'unsigned __int64' to 'sdigit', possible loss of data
See also discussion on PR 16146:
#16146 (comment)
sir-sigurd commentedon Sep 20, 2019
These warnings are caused by c6734ee.
I'd fix them, but I'm not sure if we are going to restore CHECK_SMALL_INT() ¯\(ツ)/¯
animalize commentedon Sep 20, 2019
I suggest we slow down, carefully sort out the recent commits for longobject.c:
https://bugs.python.org/issue37812#msg352837
Make the code has consistent style, better readability...
iritkatriel commentedon Nov 27, 2023
Is there anything left to do here?
vstinner commentedon Nov 27, 2023
I looked at Git history and it seems like I fixed the compiler warning with commit 6314abc:
Thanks for the reminder @iritkatriel, I closed the issue.