Skip to content

Commit 5addb78

Browse files
committed
remove un-necessary prototypes and rearrange code
1 parent 6bc9c3e commit 5addb78

File tree

1 file changed

+21
-31
lines changed

1 file changed

+21
-31
lines changed

Modules/_cursesmodule.c

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,12 @@ _PyCursesSetError(cursesmodule_state *state,
249249
}
250250

251251
static void
252-
PyCursesSetError_From(PyObject *, const char *, const char *);
253-
254-
/*
255-
* Format a curses error using 'funcname' as the displayed
256-
* function name and underlying curses function name.
257-
*/
258-
static inline void
259-
PyCursesSetError(PyObject *module, const char *funcname)
252+
PyCursesSetError_ForWin_From(PyCursesWindowObject *win,
253+
const char *python_funcname,
254+
const char *curses_funcname)
260255
{
261-
PyCursesSetError_From(module, funcname, NULL);
256+
cursesmodule_state *state = get_cursesmodule_state_by_win(win);
257+
_PyCursesSetError(state, python_funcname, curses_funcname);
262258
}
263259

264260
static void
@@ -270,13 +266,14 @@ PyCursesSetError_From(PyObject *module,
270266
_PyCursesSetError(state, python_funcname, curses_funcname);
271267
}
272268

273-
static void
274-
PyCursesSetError_ForWin_From(PyCursesWindowObject *win,
275-
const char *python_funcname,
276-
const char *curses_funcname)
269+
/*
270+
* Format a curses error using 'funcname' as the displayed
271+
* function name and underlying curses function name.
272+
*/
273+
static inline void
274+
PyCursesSetError(PyObject *module, const char *funcname)
277275
{
278-
cursesmodule_state *state = get_cursesmodule_state_by_win(win);
279-
_PyCursesSetError(state, python_funcname, curses_funcname);
276+
PyCursesSetError_From(module, funcname, NULL);
280277
}
281278

282279
/* Utility Checking Procedures */
@@ -361,15 +358,6 @@ _PyCursesStatefulCheckFunction(PyObject *module,
361358
* on success and setting an exception on error.
362359
*/
363360

364-
static PyObject *
365-
PyCursesCheckERR_From(PyObject *, int, const char *, const char *);
366-
367-
static inline PyObject *
368-
PyCursesCheckERR(PyObject *module, int code, const char *funcname)
369-
{
370-
return PyCursesCheckERR_From(module, code, funcname, NULL);
371-
}
372-
373361
static PyObject *
374362
PyCursesCheckERR_From(PyObject *module, int code,
375363
const char *python_funcname,
@@ -382,15 +370,10 @@ PyCursesCheckERR_From(PyObject *module, int code,
382370
return NULL;
383371
}
384372

385-
static PyObject *
386-
PyCursesCheckERR_ForWin_From(PyCursesWindowObject *, int,
387-
const char *, const char *);
388-
389373
static inline PyObject *
390-
PyCursesCheckERR_ForWin(PyCursesWindowObject *win, int code,
391-
const char *funcname)
374+
PyCursesCheckERR(PyObject *module, int code, const char *funcname)
392375
{
393-
return PyCursesCheckERR_ForWin_From(win, code, funcname, NULL);
376+
return PyCursesCheckERR_From(module, code, funcname, NULL);
394377
}
395378

396379
static PyObject *
@@ -405,6 +388,13 @@ PyCursesCheckERR_ForWin_From(PyCursesWindowObject *win, int code,
405388
return NULL;
406389
}
407390

391+
static inline PyObject *
392+
PyCursesCheckERR_ForWin(PyCursesWindowObject *win, int code,
393+
const char *funcname)
394+
{
395+
return PyCursesCheckERR_ForWin_From(win, code, funcname, NULL);
396+
}
397+
408398
/* Convert an object to a byte (an integer of type chtype):
409399
410400
- int

0 commit comments

Comments
 (0)