Message362441
The function PyTokenizer_FromUTF8 from Parser/tokenizer.c had a comment:
/* XXX: constify members. */
This patch addresses that.
In the tok_state struct:
* end and start were non-const but could be made const
* str and input were const but should have been non-const
Changes to support this include:
* decode_str() now returns a char * since it is allocated.
* PyTokenizer_FromString() and PyTokenizer_FromUTF8() each creates a
new char * for an allocate string instead of reusing the input
const char *.
* PyTokenizer_Get() and tok_get() now take const char ** arguments.
* Various local vars are const or non-const accordingly.
I was able to remove five casts that cast away constness. |
|
Date |
User |
Action |
Args |
2020-02-22 00:25:34 | petdance | set | recipients:
+ petdance |
2020-02-22 00:25:34 | petdance | set | messageid: <1582331134.81.0.179748951937.issue39721@roundup.psfhosted.org> |
2020-02-22 00:25:34 | petdance | link | issue39721 messages |
2020-02-22 00:25:34 | petdance | create | |
|