emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110766: Remove pad from struct input


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110766: Remove pad from struct input_event.
Date: Fri, 02 Nov 2012 13:44:08 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110766
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Fri 2012-11-02 13:44:08 +0400
message:
  Remove pad from struct input_event.
  * termhooks.h (struct input_event): Remove padding field.
  Adjust comment.
  * keyboard.c (event_to_kboard): Simplify because frame_or_window
  member is never cons for a long time.  Adjust comment.
  (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
  SELECTION_CLEAR_EVENT has no Lisp_Objects to mark.  Add comment.
  * xterm.c (handle_one_xevent): Do not initialize frame_or_window
  field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
modified:
  src/ChangeLog
  src/keyboard.c
  src/termhooks.h
  src/xterm.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-11-01 14:21:45 +0000
+++ b/src/ChangeLog     2012-11-02 09:44:08 +0000
@@ -1,3 +1,15 @@
+2012-11-02  Dmitry Antipov  <address@hidden>
+
+       Remove pad from struct input_event.
+       * termhooks.h (struct input_event): Remove padding field.
+       Adjust comment.
+       * keyboard.c (event_to_kboard): Simplify because frame_or_window
+       member is never cons for a long time.  Adjust comment.
+       (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
+       SELECTION_CLEAR_EVENT has no Lisp_Objects to mark.  Add comment.
+       * xterm.c (handle_one_xevent): Do not initialize frame_or_window
+       field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
+
 2012-11-01  Eli Zaretskii  <address@hidden>
 
        * w32proc.c (getpgrp, setpgid): New functions.  (Bug#12776)

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2012-10-20 21:30:51 +0000
+++ b/src/keyboard.c    2012-11-02 09:44:08 +0000
@@ -3416,20 +3416,13 @@
 static KBOARD *
 event_to_kboard (struct input_event *event)
 {
-  Lisp_Object frame;
-  frame = event->frame_or_window;
-  if (CONSP (frame))
-    frame = XCAR (frame);
-  else if (WINDOWP (frame))
-    frame = WINDOW_FRAME (XWINDOW (frame));
-
-  /* There are still some events that don't set this field.
-     For now, just ignore the problem.
-     Also ignore dead frames here.  */
-  if (!FRAMEP (frame) || !FRAME_LIVE_P (XFRAME (frame)))
-    return 0;
-  else
-    return FRAME_KBOARD (XFRAME (frame));
+  Lisp_Object obj = event->frame_or_window;
+  /* There are some events that set this field to nil or string.  */
+  if (WINDOWP (obj))
+    obj = WINDOW_FRAME (XWINDOW (obj));
+  /* Also ignore dead frames here.  */
+  return ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj)))
+         ? FRAME_KBOARD (XFRAME (obj)) : NULL);
 }
 
 #ifdef subprocesses
@@ -12173,14 +12166,15 @@
       {
        if (event == kbd_buffer + KBD_BUFFER_SIZE)
          event = kbd_buffer;
+       /* These two special event types has no Lisp_Objects to mark.  */
        if (event->kind != SELECTION_REQUEST_EVENT
            && event->kind != SELECTION_CLEAR_EVENT)
          {
            mark_object (event->x);
            mark_object (event->y);
+           mark_object (event->frame_or_window);
+           mark_object (event->arg);
          }
-       mark_object (event->frame_or_window);
-       mark_object (event->arg);
       }
   }
 }

=== modified file 'src/termhooks.h'
--- a/src/termhooks.h   2012-10-08 22:14:39 +0000
+++ b/src/termhooks.h   2012-11-02 09:44:08 +0000
@@ -242,16 +242,8 @@
   Lisp_Object x, y;
   Time timestamp;
 
-  /* This is padding just to put the frame_or_window field
-     past the size of struct selection_input_event.  */
-  int *padding[2];
-
-  /* This field is copied into a vector while the event is in the queue,
-     so that garbage collections won't kill it.  */
-  /* In a menu_bar_event, this is a cons cell whose car is the frame
-     and whose cdr is the Lisp object that is the event's value.  */
-  /* This field is last so that struct selection_input_event
-     does not overlap with it.  */
+  /* This field is copied into a vector while the event is in
+     the queue, so that garbage collections won't kill it.  */
   Lisp_Object frame_or_window;
 
   /* Additional event argument.  This is used for TOOL_BAR_EVENTs and

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2012-10-31 19:23:06 +0000
+++ b/src/xterm.c       2012-11-02 09:44:08 +0000
@@ -6108,7 +6108,6 @@
         SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
         SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection;
         SELECTION_EVENT_TIME (&inev.sie) = eventp->time;
-        inev.ie.frame_or_window = Qnil;
       }
       break;
 
@@ -6128,7 +6127,6 @@
           SELECTION_EVENT_TARGET (&inev.sie) = eventp->target;
           SELECTION_EVENT_PROPERTY (&inev.sie) = eventp->property;
           SELECTION_EVENT_TIME (&inev.sie) = eventp->time;
-          inev.ie.frame_or_window = Qnil;
       }
       break;
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]