[Python-checkins] Fix compiler warnings regarding loss of data (GH-23983)

pablogsal webhook-mailer at python.org
Mon Dec 28 19:28:18 EST 2020


https://github.com/python/cpython/commit/a6d63a20df63b3fd33b5e1f629e7f96d00f6ae39
commit: a6d63a20df63b3fd33b5e1f629e7f96d00f6ae39
branch: master
author: Pablo Galindo <Pablogsal at gmail.com>
committer: pablogsal <Pablogsal at gmail.com>
date: 2020-12-29T00:28:09Z
summary:

Fix compiler warnings regarding loss of data (GH-23983)

files:
M Modules/_sqlite/connection.c
M Objects/unicodeobject.c

diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 5c7b4eeae6ae9..1e23daca44558 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1601,7 +1601,7 @@ pysqlite_connection_backup_impl(pysqlite_Connection *self,
 {
     int rc;
     int callback_error = 0;
-    int sleep_ms = sleep * 1000.0;
+    int sleep_ms = (int)(sleep * 1000.0);
     sqlite3 *bck_conn;
     sqlite3_backup *bck_handle;
 
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index ad32a062d4854..64fd408085d5e 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -2302,7 +2302,7 @@ _PyUnicode_FromId(_Py_Identifier *id)
     PyInterpreterState *interp = _PyInterpreterState_GET();
     struct _Py_unicode_ids *ids = &interp->unicode.ids;
 
-    int index = _Py_atomic_size_get(&id->index);
+    Py_ssize_t index = _Py_atomic_size_get(&id->index);
     if (index < 0) {
         struct _Py_unicode_runtime_ids *rt_ids = &interp->runtime->unicode_ids;
 



More information about the Python-checkins mailing list