Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c46eaf

Browse files
committed
ANSIfication of function-pointers and declarations. Also, make sure to
return something if RETSIGTYPE is not void, in functions that are defined as returning RETSIGTYPE.
1 parent 0796b00 commit 2c46eaf

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Modules/readline.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extern Function *rl_event_hook;
3838
#endif
3939

4040
/* Pointers needed from outside (but not declared in a header file). */
41-
extern int (*PyOS_InputHook)();
41+
extern int (*PyOS_InputHook)(void);
4242
extern char *(*PyOS_ReadlineFunctionPointer)(char *);
4343

4444

@@ -431,6 +431,9 @@ static RETSIGTYPE
431431
onintr(int sig)
432432
{
433433
longjmp(jbuf, 1);
434+
#if RETSIGTYPE != void
435+
return 0;
436+
#endif
434437
}
435438

436439

@@ -441,7 +444,7 @@ call_readline(char *prompt)
441444
{
442445
size_t n;
443446
char *p, *q;
444-
RETSIGTYPE (*old_inthandler)();
447+
RETSIGTYPE (*old_inthandler)(int);
445448
old_inthandler = signal(SIGINT, onintr);
446449
if (setjmp(jbuf)) {
447450
#ifdef HAVE_SIGRELSE

0 commit comments

Comments
 (0)