mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
Replace _pysqlite_long_from_int64() with PyLong_FromLongLong() (GH-16882)
This commit is contained in:
parent
ea6041cd7f
commit
b6f5b9dd21
4 changed files with 3 additions and 20 deletions
|
|
@ -103,22 +103,6 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st)
|
|||
# define IS_LITTLE_ENDIAN 1
|
||||
#endif
|
||||
|
||||
PyObject *
|
||||
_pysqlite_long_from_int64(sqlite_int64 value)
|
||||
{
|
||||
# if SIZEOF_LONG_LONG < 8
|
||||
if (value > PY_LLONG_MAX || value < PY_LLONG_MIN) {
|
||||
return _PyLong_FromByteArray(&value, sizeof(value),
|
||||
IS_LITTLE_ENDIAN, 1 /* signed */);
|
||||
}
|
||||
# endif
|
||||
# if SIZEOF_LONG < SIZEOF_LONG_LONG
|
||||
if (value > LONG_MAX || value < LONG_MIN)
|
||||
return PyLong_FromLongLong(value);
|
||||
# endif
|
||||
return PyLong_FromLong(Py_SAFE_DOWNCAST(value, sqlite_int64, long));
|
||||
}
|
||||
|
||||
sqlite_int64
|
||||
_pysqlite_long_as_int64(PyObject * py_val)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue