Browse Source
closes bpo-39605: Fix some casts to not cast away const. (GH-18453)
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 constspull/18473/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 39 additions and 39 deletions
-
4Modules/_io/textio.c
-
16Objects/bytes_methods.c
-
8Objects/memoryobject.c
-
2Objects/stringlib/asciilib.h
-
4Objects/stringlib/codecs.h
-
2Objects/stringlib/find_max_char.h
-
30Objects/unicodeobject.c
-
6Python/ceval.c
-
2Python/marshal.c
-
2Python/pyhash.c
-
2Python/sysmodule.c
Write
Preview
Loading…
Cancel
Save
Reference in new issue