@@ -170,20 +170,20 @@ class _curses.window "PyCursesWindowObject *" "&PyCursesWindow_Type"
170
170
static PyObject * PyCursesError ;
171
171
172
172
/* Tells whether setupterm() has been called to initialise terminfo. */
173
- static int initialised_setupterm = FALSE;
173
+ static int curses_setupterm_called = FALSE;
174
174
175
175
/* Tells whether initscr() has been called to initialise curses. */
176
- static int initialised = FALSE;
176
+ static int curses_initscr_called = FALSE;
177
177
178
178
/* Tells whether start_color() has been called to initialise color usage. */
179
- static int initialisedcolors = FALSE;
179
+ static int curses_start_color_called = FALSE;
180
180
181
- static char * screen_encoding = NULL ;
181
+ static const char * curses_screen_encoding = NULL ;
182
182
183
183
/* Utility Macros */
184
184
#define PyCursesSetupTermCalled \
185
185
do { \
186
- if (initialised_setupterm != TRUE) { \
186
+ if (curses_setupterm_called != TRUE) { \
187
187
PyErr_SetString(PyCursesError, \
188
188
"must call (at least) setupterm() first"); \
189
189
return 0; \
@@ -192,7 +192,7 @@ static char *screen_encoding = NULL;
192
192
193
193
#define PyCursesInitialised \
194
194
do { \
195
- if (initialised != TRUE) { \
195
+ if (curses_initscr_called != TRUE) { \
196
196
PyErr_SetString(PyCursesError, \
197
197
"must call initscr() first"); \
198
198
return 0; \
@@ -201,7 +201,7 @@ static char *screen_encoding = NULL;
201
201
202
202
#define PyCursesInitialisedColor \
203
203
do { \
204
- if (initialisedcolors != TRUE) { \
204
+ if (curses_start_color_called != TRUE) { \
205
205
PyErr_SetString(PyCursesError, \
206
206
"must call start_color() first"); \
207
207
return 0; \
@@ -267,7 +267,7 @@ PyCurses_ConvertToChtype(PyCursesWindowObject *win, PyObject *obj, chtype *ch)
267
267
if (win )
268
268
encoding = win -> encoding ;
269
269
else
270
- encoding = screen_encoding ;
270
+ encoding = curses_screen_encoding ;
271
271
bytes = PyUnicode_AsEncodedString (obj , encoding , NULL );
272
272
if (bytes == NULL )
273
273
return 0 ;
@@ -3278,7 +3278,7 @@ _curses_initscr_impl(PyObject *module)
3278
3278
{
3279
3279
WINDOW * win ;
3280
3280
3281
- if (initialised ) {
3281
+ if (curses_initscr_called ) {
3282
3282
wrefresh (stdscr );
3283
3283
return (PyObject * )PyCursesWindow_New (stdscr , NULL );
3284
3284
}
@@ -3290,7 +3290,7 @@ _curses_initscr_impl(PyObject *module)
3290
3290
return NULL ;
3291
3291
}
3292
3292
3293
- initialised = initialised_setupterm = TRUE;
3293
+ curses_initscr_called = curses_setupterm_called = TRUE;
3294
3294
3295
3295
PyObject * module_dict = PyModule_GetDict (module ); // borrowed
3296
3296
if (module_dict == NULL ) {
@@ -3386,7 +3386,7 @@ _curses_initscr_impl(PyObject *module)
3386
3386
if (winobj == NULL ) {
3387
3387
return NULL ;
3388
3388
}
3389
- screen_encoding = winobj -> encoding ;
3389
+ curses_screen_encoding = winobj -> encoding ;
3390
3390
return (PyObject * )winobj ;
3391
3391
}
3392
3392
@@ -3428,7 +3428,7 @@ _curses_setupterm_impl(PyObject *module, const char *term, int fd)
3428
3428
}
3429
3429
}
3430
3430
3431
- if (!initialised_setupterm && setupterm ((char * )term , fd , & err ) == ERR ) {
3431
+ if (!curses_setupterm_called && setupterm ((char * )term , fd , & err ) == ERR ) {
3432
3432
const char * s = "setupterm: unknown error" ;
3433
3433
3434
3434
if (err == 0 ) {
@@ -3441,7 +3441,7 @@ _curses_setupterm_impl(PyObject *module, const char *term, int fd)
3441
3441
return NULL ;
3442
3442
}
3443
3443
3444
- initialised_setupterm = TRUE;
3444
+ curses_setupterm_called = TRUE;
3445
3445
3446
3446
Py_RETURN_NONE ;
3447
3447
}
@@ -4245,7 +4245,7 @@ _curses_start_color_impl(PyObject *module)
4245
4245
return NULL ;
4246
4246
}
4247
4247
4248
- initialisedcolors = TRUE;
4248
+ curses_start_color_called = TRUE;
4249
4249
4250
4250
PyObject * module_dict = PyModule_GetDict (module ); // borrowed
4251
4251
if (module_dict == NULL ) {
0 commit comments