From ff0b5f4c678edf11ba88814089f336e8bdb75e3e Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sun, 6 Dec 1992 22:18:02 +0000 Subject: [PATCH] * keyboard.c (kbd_store_ptr): Declare this to be volatile, if __STDC__ is #defined. (Fdiscard_input): Use cast to keep GCC from complaining about the assignment of kbd_store_ptr to kbd_fetch_ptr. --- src/keyboard.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/keyboard.c b/src/keyboard.c index a9e73d2995..c0d8bfa5a9 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -250,6 +250,9 @@ static struct input_event *kbd_fetch_ptr; /* Pointer to next place to store character in kbd_buffer. This may be kbd_buffer + KBD_BUFFER_SIZE, meaning that the next character should go in kbd_buffer[0]. */ +#ifdef __STDC__ +volatile +#endif static struct input_event *kbd_store_ptr; /* The above pair of variables forms a "queue empty" flag. When we @@ -3577,7 +3580,10 @@ Also cancel any kbd macro being defined.") discard_tty_input (); - kbd_fetch_ptr = kbd_store_ptr; + /* Without the cast, GCC complains that this assignment loses the + volatile qualifier of kbd_store_ptr. Is there anything wrong + with that? */ + kbd_fetch_ptr = (struct input_event *) kbd_store_ptr; input_pending = 0; return Qnil; -- 2.39.2