comparison src/keyboard.c @ 1654:fe6f6e55182f

* 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.
author Jim Blandy <jimb@redhat.com>
date Sun, 06 Dec 1992 22:18:02 +0000
parents 11cd7c23f538
children 4cd44b41f1e3
comparison
equal deleted inserted replaced
1653:fd573317f468 1654:fe6f6e55182f
248 static struct input_event *kbd_fetch_ptr; 248 static struct input_event *kbd_fetch_ptr;
249 249
250 /* Pointer to next place to store character in kbd_buffer. This 250 /* Pointer to next place to store character in kbd_buffer. This
251 may be kbd_buffer + KBD_BUFFER_SIZE, meaning that the next 251 may be kbd_buffer + KBD_BUFFER_SIZE, meaning that the next
252 character should go in kbd_buffer[0]. */ 252 character should go in kbd_buffer[0]. */
253 #ifdef __STDC__
254 volatile
255 #endif
253 static struct input_event *kbd_store_ptr; 256 static struct input_event *kbd_store_ptr;
254 257
255 /* The above pair of variables forms a "queue empty" flag. When we 258 /* The above pair of variables forms a "queue empty" flag. When we
256 enqueue a non-hook event, we increment kbd_write_count. When we 259 enqueue a non-hook event, we increment kbd_write_count. When we
257 dequeue a non-hook event, we increment kbd_read_count. We say that 260 dequeue a non-hook event, we increment kbd_read_count. We say that
3575 3578
3576 unread_command_event = Qnil; 3579 unread_command_event = Qnil;
3577 3580
3578 discard_tty_input (); 3581 discard_tty_input ();
3579 3582
3580 kbd_fetch_ptr = kbd_store_ptr; 3583 /* Without the cast, GCC complains that this assignment loses the
3584 volatile qualifier of kbd_store_ptr. Is there anything wrong
3585 with that? */
3586 kbd_fetch_ptr = (struct input_event *) kbd_store_ptr;
3581 input_pending = 0; 3587 input_pending = 0;
3582 3588
3583 return Qnil; 3589 return Qnil;
3584 } 3590 }
3585 3591