Bug 1765474 - Fix deprecated-non-prototype warnings in editline. r=jandem

js/src/editline/editline.c:147:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
TTYput(c)
^
js/src/editline/editline.c:158:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
TTYputs(p)
^
js/src/editline/editline.c:166:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
TTYshow(c)
^
js/src/editline/editline.c:187:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
TTYstring(p)
^
js/src/editline/editline.c:212:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
TTYbackn(n)
^
js/src/editline/editline.c:288:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
left(Change)
^
js/src/editline/editline.c:305:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
right(Change)
^
js/src/editline/editline.c:322:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
do_macro(c)
^
js/src/editline/editline.c:340:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
do_forward(move)
^
js/src/editline/editline.c:365:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
do_case(type)
^
js/src/editline/editline.c:441:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
insert_string(p)
^
js/src/editline/editline.c:502:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
do_insert_hist(p)
^
js/src/editline/editline.c:515:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
do_hist(move)
^
js/src/editline/editline.c:557:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
substrcmp(text, pat, len)
^
js/src/editline/editline.c:607:14: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
        if ((*match)((char *)H.Lines[H.Pos], pat, len) == 0)
                    ^
js/src/editline/editline.c:573:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
search_hist(search, move)
^
js/src/editline/editline.c:663:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
save_yank(begin, i)
^
js/src/editline/editline.c:682:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
delete_string(count)
^
js/src/editline/editline.c:781:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
insert_char(c)
^
js/src/editline/editline.h:81:13: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
extern void     rl_add_slash();
                ^
js/src/editline/sysunix.c:36:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
rl_ttyset(Reset)
^
js/src/editline/sysunix.c:139:1: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
rl_add_slash(path, p)
^

Differential Revision: https://phabricator.services.mozilla.com/D144145
This commit is contained in:
Mike Hommey 2022-04-22 01:25:07 +00:00
Родитель b225d730f0
Коммит f0ff0bc3aa
3 изменённых файлов: 32 добавлений и 67 удалений

Просмотреть файл

@ -144,8 +144,7 @@ TTYflush()
} }
STATIC void STATIC void
TTYput(c) TTYput(CHAR c)
CHAR c;
{ {
Screen[ScreenCount] = c; Screen[ScreenCount] = c;
if (++ScreenCount >= ScreenSize - 1) { if (++ScreenCount >= ScreenSize - 1) {
@ -155,16 +154,14 @@ TTYput(c)
} }
STATIC void STATIC void
TTYputs(p) TTYputs(CONST CHAR *p)
CONST CHAR *p;
{ {
while (*p) while (*p)
TTYput(*p++); TTYput(*p++);
} }
STATIC void STATIC void
TTYshow(c) TTYshow(CHAR c)
CHAR c;
{ {
if (c == DEL) { if (c == DEL) {
TTYput('^'); TTYput('^');
@ -184,8 +181,7 @@ TTYshow(c)
} }
STATIC void STATIC void
TTYstring(p) TTYstring(CHAR *p)
CHAR *p;
{ {
while (*p) while (*p)
TTYshow(*p++); TTYshow(*p++);
@ -209,8 +205,7 @@ TTYget()
#define TTYback() (backspace ? TTYputs((CHAR *)backspace) : TTYput('\b')) #define TTYback() (backspace ? TTYputs((CHAR *)backspace) : TTYput('\b'))
STATIC void STATIC void
TTYbackn(n) TTYbackn(int n)
int n;
{ {
while (--n >= 0) while (--n >= 0)
TTYback(); TTYback();
@ -285,8 +280,7 @@ reposition()
} }
STATIC void STATIC void
left(Change) left(STATUS Change)
STATUS Change;
{ {
TTYback(); TTYback();
if (Point) { if (Point) {
@ -302,8 +296,7 @@ left(Change)
} }
STATIC void STATIC void
right(Change) right(STATUS Change)
STATUS Change;
{ {
TTYshow(Line[Point]); TTYshow(Line[Point]);
if (Change == CSmove) if (Change == CSmove)
@ -319,8 +312,7 @@ ring_bell()
} }
STATIC STATUS STATIC STATUS
do_macro(c) do_macro(unsigned int c)
unsigned int c;
{ {
CHAR name[4]; CHAR name[4];
@ -337,8 +329,7 @@ do_macro(c)
} }
STATIC STATUS STATIC STATUS
do_forward(move) do_forward(STATUS move)
STATUS move;
{ {
int i; int i;
CHAR *p; CHAR *p;
@ -362,8 +353,7 @@ do_forward(move)
} }
STATIC STATUS STATIC STATUS
do_case(type) do_case(CASE type)
CASE type;
{ {
int i; int i;
int end; int end;
@ -438,8 +428,7 @@ clear_line()
} }
STATIC STATUS STATIC STATUS
insert_string(p) insert_string(CHAR *p)
CHAR *p;
{ {
SIZE_T len; SIZE_T len;
int i; int i;
@ -499,8 +488,7 @@ prev_hist()
} }
STATIC STATUS STATIC STATUS
do_insert_hist(p) do_insert_hist(CHAR *p)
CHAR *p;
{ {
if (p == NULL) if (p == NULL)
return ring_bell(); return ring_bell();
@ -512,8 +500,7 @@ do_insert_hist(p)
} }
STATIC STATUS STATIC STATUS
do_hist(move) do_hist(CHAR *(*move)())
CHAR *(*move)();
{ {
CHAR *p; CHAR *p;
int i; int i;
@ -554,10 +541,7 @@ h_last()
** Return zero if pat appears as a substring in text. ** Return zero if pat appears as a substring in text.
*/ */
STATIC int STATIC int
substrcmp(text, pat, len) substrcmp(char *text, char *pat, size_t len)
char *text;
char *pat;
int len;
{ {
char c; char c;
@ -570,14 +554,12 @@ substrcmp(text, pat, len)
} }
STATIC CHAR * STATIC CHAR *
search_hist(search, move) search_hist(CHAR *search, CHAR *(*move)())
CHAR *search;
CHAR *(*move)();
{ {
static CHAR *old_search; static CHAR *old_search;
int len; int len;
int pos; int pos;
int (*match)(); int (*match)(char *, char *, size_t);
char *pat; char *pat;
/* Save or get remembered search pattern. */ /* Save or get remembered search pattern. */
@ -594,7 +576,7 @@ search_hist(search, move)
/* Set up pattern-finder. */ /* Set up pattern-finder. */
if (*search == '^') { if (*search == '^') {
match = strncmp; match = (int(*)(char *, char *, size_t))strncmp;
pat = (char *)(search + 1); pat = (char *)(search + 1);
} }
else { else {
@ -660,9 +642,7 @@ fd_char()
} }
STATIC void STATIC void
save_yank(begin, i) save_yank(int begin, int i)
int begin;
int i;
{ {
if (Yanked) { if (Yanked) {
DISPOSE(Yanked); DISPOSE(Yanked);
@ -679,8 +659,7 @@ save_yank(begin, i)
} }
STATIC STATUS STATIC STATUS
delete_string(count) delete_string(int count)
int count;
{ {
int i; int i;
CHAR *p; CHAR *p;
@ -778,8 +757,7 @@ kill_line()
} }
STATIC STATUS STATIC STATUS
insert_char(c) insert_char(int c)
int c;
{ {
STATUS s; STATUS s;
CHAR buff[2]; CHAR buff[2];
@ -843,8 +821,7 @@ meta()
} }
STATIC STATUS STATIC STATUS
emacs(c) emacs(unsigned int c)
unsigned int c;
{ {
STATUS s; STATUS s;
const KEYMAP *kp; const KEYMAP *kp;
@ -865,8 +842,7 @@ emacs(c)
} }
STATIC STATUS STATIC STATUS
TTYspecial(c) TTYspecial(unsigned int c)
unsigned int c;
{ {
if (ISMETA(c)) if (ISMETA(c))
return CSdispatch; return CSdispatch;
@ -942,8 +918,7 @@ editinput()
} }
STATIC void STATIC void
hist_add(p) hist_add(CHAR *p)
CHAR *p;
{ {
int i; int i;
@ -965,8 +940,7 @@ hist_add(p)
*/ */
/* ARGSUSED0 */ /* ARGSUSED0 */
void void
rl_reset_terminal(p) rl_reset_terminal(char *p)
char *p;
{ {
(void)p; (void)p;
} }
@ -977,8 +951,7 @@ rl_initialize()
} }
char * char *
readline(prompt) readline(CONST char *prompt)
CONST char *prompt;
{ {
CHAR *line; CHAR *line;
int s; int s;
@ -1013,8 +986,7 @@ readline(prompt)
} }
void void
add_history(p) add_history(char *p)
char *p;
{ {
if (p == NULL || *p == '\0') if (p == NULL || *p == '\0')
return; return;
@ -1217,9 +1189,7 @@ bk_kill_word()
} }
STATIC int STATIC int
argify(line, avp) argify(CHAR *line, CHAR ***avp)
CHAR *line;
CHAR ***avp;
{ {
CHAR *c; CHAR *c;
CHAR **p; CHAR **p;

Просмотреть файл

@ -78,7 +78,7 @@ extern unsigned rl_quit;
extern char *rl_complete(); extern char *rl_complete();
extern int rl_list_possib(); extern int rl_list_possib();
extern void rl_ttyset(int); extern void rl_ttyset(int);
extern void rl_add_slash(); extern void rl_add_slash(char *, char *);
#if !defined(HAVE_STDLIB) #if !defined(HAVE_STDLIB)
extern char *getenv(); extern char *getenv();

Просмотреть файл

@ -33,8 +33,7 @@
#include <termios.h> #include <termios.h>
void void
rl_ttyset(Reset) rl_ttyset(int Reset)
int Reset;
{ {
static struct termios old; static struct termios old;
struct termios new; struct termios new;
@ -65,8 +64,7 @@ rl_ttyset(Reset)
#include <termio.h> #include <termio.h>
void void
rl_ttyset(Reset) rl_ttyset(int Reset)
int Reset;
{ {
static struct termio old; static struct termio old;
struct termio new; struct termio new;
@ -96,8 +94,7 @@ rl_ttyset(Reset)
#include <sgtty.h> #include <sgtty.h>
void void
rl_ttyset(Reset) rl_ttyset(int Reset)
int Reset;
{ {
static struct sgttyb old_sgttyb; static struct sgttyb old_sgttyb;
static struct tchars old_tchars; static struct tchars old_tchars;
@ -136,9 +133,7 @@ rl_ttyset(Reset)
#endif /* defined(HAVE_TCGETATTR) */ #endif /* defined(HAVE_TCGETATTR) */
void void
rl_add_slash(path, p) rl_add_slash(char *path, char *p)
char *path;
char *p;
{ {
struct stat Sb; struct stat Sb;