[Python-checkins] bpo-8677: use PY_SSIZE_T_CLEAN in sqlite (GH-12434)

Inada Naoki webhook-mailer at python.org
Tue Mar 19 09:10:25 EDT 2019


https://github.com/python/cpython/commit/29198ea1c6d58f87389136b0ac0b8b2318dbac24
commit: 29198ea1c6d58f87389136b0ac0b8b2318dbac24
branch: master
author: Inada Naoki <songofacandy at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019-03-19T22:10:18+09:00
summary:

bpo-8677: use PY_SSIZE_T_CLEAN in sqlite (GH-12434)

Modules/_sqlite/cursor.c uses "y#" format.
It didn't declare PY_SSIZE_T_CLEAN, but the argument is Py_ssize_t already.

files:
M Modules/_sqlite/cache.h
M Modules/_sqlite/connection.h
M Modules/_sqlite/cursor.h
M Modules/_sqlite/microprotocols.h
M Modules/_sqlite/module.h
M Modules/_sqlite/prepare_protocol.h
M Modules/_sqlite/row.h
M Modules/_sqlite/statement.h
M Modules/_sqlite/util.h

diff --git a/Modules/_sqlite/cache.h b/Modules/_sqlite/cache.h
index a133903961da..529010967c4f 100644
--- a/Modules/_sqlite/cache.h
+++ b/Modules/_sqlite/cache.h
@@ -23,6 +23,7 @@
 
 #ifndef PYSQLITE_CACHE_H
 #define PYSQLITE_CACHE_H
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
 /* The LRU cache is implemented as a combination of a doubly-linked with a
diff --git a/Modules/_sqlite/connection.h b/Modules/_sqlite/connection.h
index 5fb410a62e53..4e9d94c5f308 100644
--- a/Modules/_sqlite/connection.h
+++ b/Modules/_sqlite/connection.h
@@ -23,6 +23,7 @@
 
 #ifndef PYSQLITE_CONNECTION_H
 #define PYSQLITE_CONNECTION_H
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "pythread.h"
 #include "structmember.h"
diff --git a/Modules/_sqlite/cursor.h b/Modules/_sqlite/cursor.h
index 28bbd5f91175..4a20e756f782 100644
--- a/Modules/_sqlite/cursor.h
+++ b/Modules/_sqlite/cursor.h
@@ -23,6 +23,7 @@
 
 #ifndef PYSQLITE_CURSOR_H
 #define PYSQLITE_CURSOR_H
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
 #include "statement.h"
diff --git a/Modules/_sqlite/microprotocols.h b/Modules/_sqlite/microprotocols.h
index 99ff6f642b25..5418c2b98fd7 100644
--- a/Modules/_sqlite/microprotocols.h
+++ b/Modules/_sqlite/microprotocols.h
@@ -26,6 +26,7 @@
 #ifndef PSYCOPG_MICROPROTOCOLS_H
 #define PSYCOPG_MICROPROTOCOLS_H 1
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 /** the names of the three mandatory methods **/
diff --git a/Modules/_sqlite/module.h b/Modules/_sqlite/module.h
index 6f90934b325d..3185ec978885 100644
--- a/Modules/_sqlite/module.h
+++ b/Modules/_sqlite/module.h
@@ -23,6 +23,7 @@
 
 #ifndef PYSQLITE_MODULE_H
 #define PYSQLITE_MODULE_H
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
 #define PYSQLITE_VERSION "2.6.0"
diff --git a/Modules/_sqlite/prepare_protocol.h b/Modules/_sqlite/prepare_protocol.h
index 924e16223acf..3998a55e51ca 100644
--- a/Modules/_sqlite/prepare_protocol.h
+++ b/Modules/_sqlite/prepare_protocol.h
@@ -23,6 +23,7 @@
 
 #ifndef PYSQLITE_PREPARE_PROTOCOL_H
 #define PYSQLITE_PREPARE_PROTOCOL_H
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
 typedef struct
diff --git a/Modules/_sqlite/row.h b/Modules/_sqlite/row.h
index d014109032ad..4ad506f8dd96 100644
--- a/Modules/_sqlite/row.h
+++ b/Modules/_sqlite/row.h
@@ -23,6 +23,7 @@
 
 #ifndef PYSQLITE_ROW_H
 #define PYSQLITE_ROW_H
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
 typedef struct _Row
diff --git a/Modules/_sqlite/statement.h b/Modules/_sqlite/statement.h
index fd88d7d6622c..5002f02dc5b3 100644
--- a/Modules/_sqlite/statement.h
+++ b/Modules/_sqlite/statement.h
@@ -23,6 +23,7 @@
 
 #ifndef PYSQLITE_STATEMENT_H
 #define PYSQLITE_STATEMENT_H
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
 #include "connection.h"
diff --git a/Modules/_sqlite/util.h b/Modules/_sqlite/util.h
index abaefd8b87b8..626191118f92 100644
--- a/Modules/_sqlite/util.h
+++ b/Modules/_sqlite/util.h
@@ -23,6 +23,7 @@
 
 #ifndef PYSQLITE_UTIL_H
 #define PYSQLITE_UTIL_H
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "pythread.h"
 #include "sqlite3.h"



More information about the Python-checkins mailing list