[pywin32-bugs] [ pywin32-Patches-3612555 ] Explicit conversion from PyLong to Variant
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2013-05-03 07:36:30
|
Patches item #3612555, was opened at 2013-05-03 00:36 Message generated for change (Tracker Item Submitted) made by sschukat You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=3612555&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Stefan Schukat (sschukat) Assigned to: Nobody/Anonymous (nobody) Summary: Explicit conversion from PyLong to Variant Initial Comment: Since Python an arbitrary length long it is not easy to determine which VARIANT type is suitable. This patch checks the sign and the size of the long value and converts the long in the following way x < LLONG_MIN --> VT_R8 LLONG_MIN <= x < LONG_MIN --> VT_I8 LONG_MIN <= x < LONG_MAX --> VT_I4 LONG_MAX < x <= ULONG_MAX --> VT_UI4 ULONG_MAX < x <= LLONG_MAX --> VT_I8 LLONG_MAX < x <= ULLONG_MAX --> VT_UI8 ULLONG_MAX < x --> VT_R8 which adds the conversion to VT_UI8 and is different from the current way: x < LLONG_MIN --> VT_R8 LLONG_MIN <= x < LONG_MIN --> VT_I8 LONG_MIN <= x < LONG_MAX --> VT_I4 LONG_MAX < x <= ULONG_MAX --> VT_UI4 ULONG_MAX < x <= LLONG_MAX --> VT_I8 LLONG_MAX < x --> VT_R8 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=3612555&group_id=78018 |