emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109669: * termhooks.h (TSET): Remove


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109669: * termhooks.h (TSET): Remove.
Date: Fri, 17 Aug 2012 17:07:52 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109669
fixes bug: http://debbugs.gnu.org/12215
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Fri 2012-08-17 17:07:52 -0700
message:
  * termhooks.h (TSET): Remove.
  
  Replace all uses with calls to new setter functions.
  Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
  (TERMHOOKS_INLINE): New macro.
  (tset_charset_list, tset_selection_alist): New setter functions.
  * terminal.c (TERMHOOKS_INLINE):
  Define to EXTERN_INLINE, so that the corresponding functions
  are compiled into code.
  (tset_param_alist): New setter function.
modified:
  src/ChangeLog
  src/coding.c
  src/termhooks.h
  src/terminal.c
  src/xselect.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-17 23:38:43 +0000
+++ b/src/ChangeLog     2012-08-18 00:07:52 +0000
@@ -1,3 +1,15 @@
+2012-08-18  Paul Eggert  <address@hidden>
+
+       * termhooks.h (TSET): Remove (Bug#12215).
+       Replace all uses with calls to new setter functions.
+       Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
+       (TERMHOOKS_INLINE): New macro.
+       (tset_charset_list, tset_selection_alist): New setter functions.
+       * terminal.c (TERMHOOKS_INLINE):
+       Define to EXTERN_INLINE, so that the corresponding functions
+       are compiled into code.
+       (tset_param_alist): New setter function.
+
 2012-08-17  Paul Eggert  <address@hidden>
 
        * keyboard.h (KSET): Remove (Bug#12215).

=== modified file 'src/coding.c'
--- a/src/coding.c      2012-08-14 05:09:35 +0000
+++ b/src/coding.c      2012-08-18 00:07:52 +0000
@@ -9302,10 +9302,10 @@
   terminal_coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
   terminal_coding->src_multibyte = 1;
   terminal_coding->dst_multibyte = 0;
-  if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK)
-    TSET (term, charset_list, coding_charset_list (terminal_coding));
-  else
-    TSET (term, charset_list, Fcons (make_number (charset_ascii), Qnil));
+  tset_charset_list
+    (term, (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK
+           ? coding_charset_list (terminal_coding)
+           : Fcons (make_number (charset_ascii), Qnil)));
   return Qnil;
 }
 

=== modified file 'src/termhooks.h'
--- a/src/termhooks.h   2012-08-09 05:14:23 +0000
+++ b/src/termhooks.h   2012-08-18 00:07:52 +0000
@@ -22,6 +22,11 @@
 
 #include "systime.h" /* for Time */
 
+INLINE_HEADER_BEGIN
+#ifndef TERMHOOKS_INLINE
+# define TERMHOOKS_INLINE INLINE
+#endif
+
 struct glyph;
 struct frame;
 
@@ -321,10 +326,6 @@
 struct x_display_info;
 struct w32_display_info;
 
-/* Most code should use this macro to set Lisp field in struct terminal.  */
-
-#define TSET(f, field, value) ((f)->field = (value))
-
 /* Terminal-local parameters. */
 struct terminal
 {
@@ -631,6 +632,18 @@
   void (*delete_terminal_hook) (struct terminal *);
 };
 
+/* Most code should use these functions to set Lisp fields in struct
+   terminal.  */
+TERMHOOKS_INLINE void
+tset_charset_list (struct terminal *t, Lisp_Object val)
+{
+  t->charset_list = val;
+}
+TERMHOOKS_INLINE void
+tset_selection_alist (struct terminal *t, Lisp_Object val)
+{
+  t->Vselection_alist = val;
+}
 
 /* Chain of all terminal devices currently in use. */
 extern struct terminal *terminal_list;
@@ -669,3 +682,5 @@
 #ifdef HAVE_GPM
 extern void close_gpm (int gpm_fd);
 #endif
+
+INLINE_HEADER_END

=== modified file 'src/terminal.c'
--- a/src/terminal.c    2012-08-09 05:14:23 +0000
+++ b/src/terminal.c    2012-08-18 00:07:52 +0000
@@ -17,6 +17,9 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
+
+#define TERMHOOKS_INLINE EXTERN_INLINE
+
 #include <stdio.h>
 #include <setjmp.h>
 
@@ -39,6 +42,13 @@
 
 static void delete_initial_terminal (struct terminal *);
 
+/* This setter is used only in this file, so it can be private.  */
+static inline void
+tset_param_alist (struct terminal *t, Lisp_Object val)
+{
+  t->param_alist = val;
+}
+
 
 
 void
@@ -446,7 +456,7 @@
   Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
   if (EQ (old_alist_elt, Qnil))
     {
-      TSET (t, param_alist, Fcons (Fcons (parameter, value), t->param_alist));
+      tset_param_alist (t, Fcons (Fcons (parameter, value), t->param_alist));
       return Qnil;
     }
   else

=== modified file 'src/xselect.c'
--- a/src/xselect.c     2012-08-09 05:14:23 +0000
+++ b/src/xselect.c     2012-08-18 00:07:52 +0000
@@ -353,8 +353,9 @@
                            INTEGER_TO_CONS (timestamp), frame);
     prev_value = LOCAL_SELECTION (selection_name, dpyinfo);
 
-    TSET (dpyinfo->terminal, Vselection_alist,
-         Fcons (selection_data, dpyinfo->terminal->Vselection_alist));
+    tset_selection_alist
+      (dpyinfo->terminal,
+       Fcons (selection_data, dpyinfo->terminal->Vselection_alist));
 
     /* If we already owned the selection, remove the old selection
        data.  Don't use Fdelq as that may QUIT.  */
@@ -989,7 +990,7 @@
            break;
          }
     }
-  TSET (dpyinfo->terminal, Vselection_alist, Vselection_alist);
+  tset_selection_alist (dpyinfo->terminal, Vselection_alist);
 
   /* Run the `x-lost-selection-functions' abnormal hook.  */
   {
@@ -1039,7 +1040,7 @@
       args[1] = Fcar (Fcar (t->Vselection_alist));
       Frun_hook_with_args (2, args);
 
-      TSET (t, Vselection_alist, XCDR (t->Vselection_alist));
+      tset_selection_alist (t, XCDR (t->Vselection_alist));
     }
 
   /* Delete elements after the beginning of Vselection_alist.  */


reply via email to

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