Uh oh!
There was an error while loading. Please reload this page.
bpo-36876: Make some static string literal arrays constant. - #15760
bpo-36876: Make some static string literal arrays constant.#15760ericsnowcurrently wants to merge 7 commits into
Conversation
pganssle
left a comment
There was a problem hiding this comment.
Looks good overall, a few formatting nits around whitespace I found.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \ | ||
| { \ | ||
| static char *kwlist[] = {"other", "context", NULL}; \ | ||
| static const char *kwlist[] = {"other", "context", NULL}; \ |
There was a problem hiding this comment.
Few other alignment issues like the ones above - probably best to align the newline escapes as above.
bedevere-bot
commented
Sep 9, 2019
When you're done making the requested changes, leave the comment: |
Uh oh!
There was an error while loading. Please reload this page.
pganssle
left a comment
There was a problem hiding this comment.
Here are all the alignment issues I found. Hopefully the "suggestions" are the right number of spaces.
| int access = (access_mode)ACCESS_DEFAULT; | ||
| DWORD flProtect, dwDesiredAccess; | ||
| static char *keywords[] = { "fileno", "length", | ||
| static const char *keywords[] = { "fileno", "length", |
There was a problem hiding this comment.
Next two lines are also misaligned.
| /* Beware that "in" clashes with Python's own "in" operator keyword */ | ||
| static char *keywords[] = {"out", "in", | ||
| static const char *keywords[] = {"out", "in", | ||
| "offset", "count", |
| Py_ssize_t count; | ||
| PyObject *offobj; | ||
| static char *keywords[] = {"out", "in", | ||
| static const char *keywords[] = {"out", "in", |
Uh oh!
There was an error while loading. Please reload this page.
| { | ||
| static char *kwd_list[] = {"message", "category", "filename", "lineno", | ||
| static const char *kwd_list[] = {"message", "category", "filename", "lineno", | ||
| "module", "registry", "module_globals", |
serhiy-storchaka
commented
Sep 10, 2019
Changing It is possible to change the API, but it is long a complex process. It is a separate issue. Adding consts in |
serhiy-storchaka
commented
Sep 10, 2019
Note also that you can add two See #15824 for changes in |
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
ericsnowcurrently
commented
Sep 10, 2019
Hmm, this won't work out. |
georgthegreat
commented
Feb 24, 2021
georgthegreat
commented
Feb 25, 2021
@serhiy-storchaka, could you, please, elaborate on
At the time the lack of const causes problems i. e. when compiling in MSVC standard conformance mode (which is default for |
This gives us guarantees about immutability.
https://bugs.python.org/issue36876