cpython/Modules/_io
Miss Islington (bot) 190433d815
closes bpo-39605: Fix some casts to not cast away const. (GH-18453)
gcc -Wcast-qual turns up a number of instances of casting away constness of pointers. Some of these can be safely modified, by either:

Adding the const to the type cast, as in:

-    return _PyUnicode_FromUCS1((unsigned char*)s, size);
+    return _PyUnicode_FromUCS1((const unsigned char*)s, size);

or, Removing the cast entirely, because it's not necessary (but probably was at one time), as in:

-    PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno);
+    PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno);

These changes will not change code, but they will make it much easier to check for errors in consts
(cherry picked from commit e6be9b59a9)

Co-authored-by: Andy Lester <andy@petdance.com>
2020-02-11 18:47:20 -08:00
..
clinic [3.8] bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933) (GH-16141) 2019-09-14 13:31:50 +03:00
_iomodule.c [3.8] bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933) (GH-16141) 2019-09-14 13:31:50 +03:00
_iomodule.h
bufferedio.c closes bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18295) 2020-02-04 13:41:55 -08:00
bytesio.c Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 13:42:54 -07:00
fileio.c [3.8] closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode files. (GH-17136) 2019-11-12 15:54:19 -08:00
iobase.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
stringio.c Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 13:42:54 -07:00
textio.c closes bpo-39605: Fix some casts to not cast away const. (GH-18453) 2020-02-11 18:47:20 -08:00
winconsoleio.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00