Skip to content

gh-123961: add curses prefix to global variable names in _cursesmodule.c - #124047

Merged
vstinner merged 4 commits into
python:mainfrom
picnixz:curses/rename-global-variables-124046
Sep 13, 2024
Merged

gh-123961: add curses prefix to global variable names in _cursesmodule.c#124047
vstinner merged 4 commits into
python:mainfrom
picnixz:curses/rename-global-variables-124046

Conversation

@picnixz

@picnixzpicnixz commented Sep 13, 2024

Copy link
Copy Markdown
Member

@picnixz
picnixz requested review from vstinner and removed request for ericsnowcurrentlySeptember 13, 2024 11:57
@picnixzpicnixz changed the title gh-124046: add curses prefix to global variable names in _cursesmodule.cgh-123961: add curses prefix to global variable names in _cursesmodule.cSep 13, 2024

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

In general, I prefer having a prefix, it avoids name conflicts when I debug in gdb.

static int curses_start_color_called = FALSE;

static char *screen_encoding = NULL;
static const char *curses_screen_encoding = NULL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no new compiler warning, so changing type from char* to const char* looks safe.

Comment threadTools/c-analyzer/cpython/globals-to-fix.tsv Outdated
@vstinner
vstinner enabled auto-merge (squash) September 13, 2024 12:19
@vstinner
vstinner merged commit acb3f87 into python:mainSep 13, 2024
@picnixz
picnixz deleted the curses/rename-global-variables-124046 branch September 13, 2024 12:44
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@picnixz@vstinner