mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
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
This commit is contained in:
parent
029e8401b7
commit
e6be9b59a9
11 changed files with 39 additions and 39 deletions
|
@ -204,7 +204,7 @@ PySys_Audit(const char *event, const char *argFormat, ...)
|
|||
|
||||
/* Dtrace USDT point */
|
||||
if (dtrace) {
|
||||
PyDTrace_AUDIT((char *)event, (void *)eventArgs);
|
||||
PyDTrace_AUDIT(event, (void *)eventArgs);
|
||||
}
|
||||
|
||||
/* Call interpreter hooks */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue