Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b6f5b9dd
Commit
b6f5b9dd
authored
Oct 23, 2019
by
Sergey Fedoseev
Committed by
Serhiy Storchaka
Oct 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace _pysqlite_long_from_int64() with PyLong_FromLongLong() (GH-16882)
parent
ea6041cd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
20 deletions
+3
-20
Modules/_sqlite/connection.c
Modules/_sqlite/connection.c
+1
-1
Modules/_sqlite/cursor.c
Modules/_sqlite/cursor.c
+2
-2
Modules/_sqlite/util.c
Modules/_sqlite/util.c
+0
-16
Modules/_sqlite/util.h
Modules/_sqlite/util.h
+0
-1
No files found.
Modules/_sqlite/connection.c
View file @
b6f5b9dd
...
...
@@ -550,7 +550,7 @@ PyObject* _pysqlite_build_py_params(sqlite3_context *context, int argc, sqlite3_
cur_value
=
argv
[
i
];
switch
(
sqlite3_value_type
(
argv
[
i
]))
{
case
SQLITE_INTEGER
:
cur_py_value
=
_pysqlite_long_from_int64
(
sqlite3_value_int64
(
cur_value
));
cur_py_value
=
PyLong_FromLongLong
(
sqlite3_value_int64
(
cur_value
));
break
;
case
SQLITE_FLOAT
:
cur_py_value
=
PyFloat_FromDouble
(
sqlite3_value_double
(
cur_value
));
...
...
Modules/_sqlite/cursor.c
View file @
b6f5b9dd
...
...
@@ -277,7 +277,7 @@ _pysqlite_fetch_one_row(pysqlite_Cursor* self)
Py_INCREF
(
Py_None
);
converted
=
Py_None
;
}
else
if
(
coltype
==
SQLITE_INTEGER
)
{
converted
=
_pysqlite_long_from_int64
(
sqlite3_column_int64
(
self
->
statement
->
st
,
i
));
converted
=
PyLong_FromLongLong
(
sqlite3_column_int64
(
self
->
statement
->
st
,
i
));
}
else
if
(
coltype
==
SQLITE_FLOAT
)
{
converted
=
PyFloat_FromDouble
(
sqlite3_column_double
(
self
->
statement
->
st
,
i
));
}
else
if
(
coltype
==
SQLITE_TEXT
)
{
...
...
@@ -558,7 +558,7 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* args)
Py_BEGIN_ALLOW_THREADS
lastrowid
=
sqlite3_last_insert_rowid
(
self
->
connection
->
db
);
Py_END_ALLOW_THREADS
self
->
lastrowid
=
_pysqlite_long_from_int64
(
lastrowid
);
self
->
lastrowid
=
PyLong_FromLongLong
(
lastrowid
);
}
if
(
rc
==
SQLITE_ROW
)
{
...
...
Modules/_sqlite/util.c
View file @
b6f5b9dd
...
...
@@ -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
)
{
...
...
Modules/_sqlite/util.h
View file @
b6f5b9dd
...
...
@@ -37,7 +37,6 @@ int pysqlite_step(sqlite3_stmt* statement, pysqlite_Connection* connection);
*/
int
_pysqlite_seterror
(
sqlite3
*
db
,
sqlite3_stmt
*
st
);
PyObject
*
_pysqlite_long_from_int64
(
sqlite_int64
value
);
sqlite_int64
_pysqlite_long_as_int64
(
PyObject
*
value
);
#if SQLITE_VERSION_NUMBER >= 3007014
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment