@@ -170,20 +170,20 @@ class _curses.window "PyCursesWindowObject *" "&PyCursesWindow_Type"
170170static PyObject * PyCursesError ;
171171
172172/* Tells whether setupterm() has been called to initialise terminfo. */
173- static int initialised_setupterm = FALSE;
173+ static int curses_setupterm_called = FALSE;
174174
175175/* Tells whether initscr() has been called to initialise curses. */
176- static int initialised = FALSE;
176+ static int curses_initscr_called = FALSE;
177177
178178/* Tells whether start_color() has been called to initialise color usage. */
179- static int initialisedcolors = FALSE;
179+ static int curses_start_color_called = FALSE;
180180
181- static char * screen_encoding = NULL ;
181+ static const char * curses_screen_encoding = NULL ;
182182
183183/* Utility Macros */
184184#define PyCursesSetupTermCalled \
185185 do { \
186- if (initialised_setupterm != TRUE) { \
186+ if (curses_setupterm_called != TRUE) { \
187187 PyErr_SetString(PyCursesError, \
188188 "must call (at least) setupterm() first"); \
189189 return 0; \
@@ -192,7 +192,7 @@ static char *screen_encoding = NULL;
192192
193193#define PyCursesInitialised \
194194 do { \
195- if (initialised != TRUE) { \
195+ if (curses_initscr_called != TRUE) { \
196196 PyErr_SetString(PyCursesError, \
197197 "must call initscr() first"); \
198198 return 0; \
@@ -201,7 +201,7 @@ static char *screen_encoding = NULL;
201201
202202#define PyCursesInitialisedColor \
203203 do { \
204- if (initialisedcolors != TRUE) { \
204+ if (curses_start_color_called != TRUE) { \
205205 PyErr_SetString(PyCursesError, \
206206 "must call start_color() first"); \
207207 return 0; \
@@ -267,7 +267,7 @@ PyCurses_ConvertToChtype(PyCursesWindowObject *win, PyObject *obj, chtype *ch)
267267 if (win )
268268 encoding = win -> encoding ;
269269 else
270- encoding = screen_encoding ;
270+ encoding = curses_screen_encoding ;
271271 bytes = PyUnicode_AsEncodedString (obj , encoding , NULL );
272272 if (bytes == NULL )
273273 return 0 ;
@@ -3278,7 +3278,7 @@ _curses_initscr_impl(PyObject *module)
32783278{
32793279 WINDOW * win ;
32803280
3281- if (initialised ) {
3281+ if (curses_initscr_called ) {
32823282 wrefresh (stdscr );
32833283 return (PyObject * )PyCursesWindow_New (stdscr , NULL );
32843284 }
@@ -3290,7 +3290,7 @@ _curses_initscr_impl(PyObject *module)
32903290 return NULL ;
32913291 }
32923292
3293- initialised = initialised_setupterm = TRUE;
3293+ curses_initscr_called = curses_setupterm_called = TRUE;
32943294
32953295 PyObject * module_dict = PyModule_GetDict (module ); // borrowed
32963296 if (module_dict == NULL ) {
@@ -3386,7 +3386,7 @@ _curses_initscr_impl(PyObject *module)
33863386 if (winobj == NULL ) {
33873387 return NULL ;
33883388 }
3389- screen_encoding = winobj -> encoding ;
3389+ curses_screen_encoding = winobj -> encoding ;
33903390 return (PyObject * )winobj ;
33913391}
33923392
@@ -3428,7 +3428,7 @@ _curses_setupterm_impl(PyObject *module, const char *term, int fd)
34283428 }
34293429 }
34303430
3431- if (!initialised_setupterm && setupterm ((char * )term , fd , & err ) == ERR ) {
3431+ if (!curses_setupterm_called && setupterm ((char * )term , fd , & err ) == ERR ) {
34323432 const char * s = "setupterm: unknown error" ;
34333433
34343434 if (err == 0 ) {
@@ -3441,7 +3441,7 @@ _curses_setupterm_impl(PyObject *module, const char *term, int fd)
34413441 return NULL ;
34423442 }
34433443
3444- initialised_setupterm = TRUE;
3444+ curses_setupterm_called = TRUE;
34453445
34463446 Py_RETURN_NONE ;
34473447}
@@ -4245,7 +4245,7 @@ _curses_start_color_impl(PyObject *module)
42454245 return NULL ;
42464246 }
42474247
4248- initialisedcolors = TRUE;
4248+ curses_start_color_called = TRUE;
42494249
42504250 PyObject * module_dict = PyModule_GetDict (module ); // borrowed
42514251 if (module_dict == NULL ) {
0 commit comments