emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109466: Separate read and write acce


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109466: Separate read and write access to Lisp_Object slots of Lisp_Process.
Date: Mon, 06 Aug 2012 15:16:07 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109466
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Mon 2012-08-06 15:16:07 +0400
message:
  Separate read and write access to Lisp_Object slots of Lisp_Process.
  * process.h (PGET, PSET): New macros similar to AREF and ASET.
  * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
modified:
  src/ChangeLog
  src/gnutls.c
  src/print.c
  src/process.c
  src/process.h
  src/sysdep.c
  src/w32.c
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-06 10:24:26 +0000
+++ b/src/ChangeLog     2012-08-06 11:16:07 +0000
@@ -1,5 +1,11 @@
 2012-08-06  Dmitry Antipov  <address@hidden>
 
+       Separate read and write access to Lisp_Object slots of Lisp_Process.
+       * process.h (PGET, PSET): New macros similar to AREF and ASET.
+       * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
+
+2012-08-06  Dmitry Antipov  <address@hidden>
+
        Separate read and write access to Lisp_Object slots of struct window.
        * window.h (WGET, WSET): New macros similar to AREF and ASET.
        * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:

=== modified file 'src/gnutls.c'
--- a/src/gnutls.c      2012-07-11 07:20:14 +0000
+++ b/src/gnutls.c      2012-08-06 11:16:07 +0000
@@ -830,7 +830,7 @@
   XPROCESS (proc)->gnutls_state = NULL;
   XPROCESS (proc)->gnutls_x509_cred = NULL;
   XPROCESS (proc)->gnutls_anon_cred = NULL;
-  XPROCESS (proc)->gnutls_cred_type = type;
+  PSET (XPROCESS (proc), gnutls_cred_type, type);
   GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_EMPTY;
 
   GNUTLS_LOG (1, max_log_level, "allocating credentials");

=== modified file 'src/print.c'
--- a/src/print.c       2012-08-06 10:24:26 +0000
+++ b/src/print.c       2012-08-06 11:16:07 +0000
@@ -1697,11 +1697,11 @@
          if (escapeflag)
            {
              strout ("#<process ", -1, -1, printcharfun);
-             print_string (PVAR (XPROCESS (obj), name), printcharfun);
+             print_string (PGET (XPROCESS (obj), name), printcharfun);
              PRINTCHAR ('>');
            }
          else
-           print_string (PVAR (XPROCESS (obj), name), printcharfun);
+           print_string (PGET (XPROCESS (obj), name), printcharfun);
        }
       else if (BOOL_VECTOR_P (obj))
        {

=== modified file 'src/process.c'
--- a/src/process.c     2012-08-02 04:14:48 +0000
+++ b/src/process.c     2012-08-06 11:16:07 +0000
@@ -172,10 +172,10 @@
 /* QCfilter is defined in keyboard.c.  */
 extern Lisp_Object QCfilter;
 
-#define NETCONN_P(p) (EQ (PVAR (XPROCESS (p), type), Qnetwork))
-#define NETCONN1_P(p) (EQ (PVAR (p, type), Qnetwork))
-#define SERIALCONN_P(p) (EQ (PVAR (XPROCESS (p), type), Qserial))
-#define SERIALCONN1_P(p) (EQ (PVAR (p, type), Qserial))
+#define NETCONN_P(p) (EQ (PGET (XPROCESS (p), type), Qnetwork))
+#define NETCONN1_P(p) (EQ (PGET (p, type), Qnetwork))
+#define SERIALCONN_P(p) (EQ (PGET (XPROCESS (p), type), Qserial))
+#define SERIALCONN1_P(p) (EQ (PGET (p, type), Qserial))
 
 #ifndef HAVE_H_ERRNO
 extern int h_errno;
@@ -428,7 +428,7 @@
 update_status (struct Lisp_Process *p)
 {
   eassert (p->raw_status_new);
-  PVAR (p, status) = status_convert (p->raw_status);
+  PSET (p, status, status_convert (p->raw_status));
   p->raw_status_new = 0;
 }
 
@@ -479,7 +479,7 @@
 static Lisp_Object
 status_message (struct Lisp_Process *p)
 {
-  Lisp_Object status = PVAR (p, status);
+  Lisp_Object status = PGET (p, status);
   Lisp_Object symbol;
   int code, coredump;
   Lisp_Object string, string2;
@@ -626,8 +626,8 @@
   p = allocate_process ();
   /* Initialize Lisp data.  Note that allocate_process initializes all
      Lisp data to nil, so do it only for slots which should not be nil.  */
-  PVAR (p, status) = Qrun;
-  PVAR (p, mark) = Fmake_marker ();
+  PSET (p, status, Qrun);
+  PSET (p, mark, Fmake_marker ());
 
   /* Initialize non-Lisp data.  Note that allocate_process zeroes out all
      non-Lisp data, so do it only for slots which should not be zero.  */
@@ -648,7 +648,7 @@
       name1 = concat2 (name, make_formatted_string (suffix, "<%"pMd">", i));
     }
   name = name1;
-  PVAR (p, name) = name;
+  PSET (p, name, name);
   XSETPROCESS (val, p);
   Vprocess_alist = Fcons (Fcons (name, val), Vprocess_alist);
   return val;
@@ -745,7 +745,7 @@
   p->raw_status_new = 0;
   if (NETCONN1_P (p) || SERIALCONN1_P (p))
     {
-      PVAR (p, status) = Fcons (Qexit, Fcons (make_number (0), Qnil));
+      PSET (p, status, Fcons (Qexit, Fcons (make_number (0), Qnil)));
       p->tick = ++process_tick;
       status_notify (p);
       redisplay_preserve_echo_area (13);
@@ -763,9 +763,9 @@
       /* If the process has already signaled, remove it from the list.  */
       if (p->raw_status_new)
        update_status (p);
-      symbol = PVAR (p, status);
-      if (CONSP (PVAR (p, status)))
-       symbol = XCAR (PVAR (p, status));
+      symbol = PGET (p, status);
+      if (CONSP (PGET (p, status)))
+       symbol = XCAR (PGET (p, status));
       if (EQ (symbol, Qsignal) || EQ (symbol, Qexit))
        deleted_pid_list
          = Fdelete (make_fixnum_or_float (pid), deleted_pid_list);
@@ -774,8 +774,7 @@
        {
          Fkill_process (process, Qnil);
          /* Do this now, since remove_process will make sigchld_handler do 
nothing.  */
-         PVAR (p, status)
-           = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
+         PSET (p, status, Fcons (Qsignal, Fcons (make_number (SIGKILL), 
Qnil)));
          p->tick = ++process_tick;
          status_notify (p);
          redisplay_preserve_echo_area (13);
@@ -816,14 +815,14 @@
   p = XPROCESS (process);
   if (p->raw_status_new)
     update_status (p);
-  status = PVAR (p, status);
+  status = PGET (p, status);
   if (CONSP (status))
     status = XCAR (status);
   if (NETCONN1_P (p) || SERIALCONN1_P (p))
     {
       if (EQ (status, Qexit))
        status = Qclosed;
-      else if (EQ (PVAR (p, command), Qt))
+      else if (EQ (PGET (p, command), Qt))
        status = Qstop;
       else if (EQ (status, Qrun))
        status = Qopen;
@@ -840,8 +839,8 @@
   CHECK_PROCESS (process);
   if (XPROCESS (process)->raw_status_new)
     update_status (XPROCESS (process));
-  if (CONSP (PVAR (XPROCESS (process), status)))
-    return XCAR (XCDR (PVAR (XPROCESS (process), status)));
+  if (CONSP (PGET (XPROCESS (process), status)))
+    return XCAR (XCDR (PGET (XPROCESS (process), status)));
   return make_number (0);
 }
 
@@ -865,7 +864,7 @@
   (register Lisp_Object process)
 {
   CHECK_PROCESS (process);
-  return PVAR (XPROCESS (process), name);
+  return PGET (XPROCESS (process), name);
 }
 
 DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0,
@@ -877,7 +876,7 @@
   (register Lisp_Object process)
 {
   CHECK_PROCESS (process);
-  return PVAR (XPROCESS (process), command);
+  return PGET (XPROCESS (process), command);
 }
 
 DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0,
@@ -887,7 +886,7 @@
   (register Lisp_Object process)
 {
   CHECK_PROCESS (process);
-  return PVAR (XPROCESS (process), tty_name);
+  return PGET (XPROCESS (process), tty_name);
 }
 
 DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer,
@@ -902,9 +901,9 @@
   if (!NILP (buffer))
     CHECK_BUFFER (buffer);
   p = XPROCESS (process);
-  PVAR (p, buffer) = buffer;
+  PSET (p, buffer, buffer);
   if (NETCONN1_P (p) || SERIALCONN1_P (p))
-    PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCbuffer, buffer);
+    PSET (p, childp, Fplist_put (PGET (p, childp), QCbuffer, buffer));
   setup_process_coding_systems (process);
   return buffer;
 }
@@ -916,7 +915,7 @@
   (register Lisp_Object process)
 {
   CHECK_PROCESS (process);
-  return PVAR (XPROCESS (process), buffer);
+  return PGET (XPROCESS (process), buffer);
 }
 
 DEFUN ("process-mark", Fprocess_mark, Sprocess_mark,
@@ -925,7 +924,7 @@
   (register Lisp_Object process)
 {
   CHECK_PROCESS (process);
-  return PVAR (XPROCESS (process), mark);
+  return PGET (XPROCESS (process), mark);
 }
 
 DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter,
@@ -961,23 +960,23 @@
 
   if (p->infd >= 0)
     {
-      if (EQ (filter, Qt) && !EQ (PVAR (p, status), Qlisten))
+      if (EQ (filter, Qt) && !EQ (PGET (p, status), Qlisten))
        {
          FD_CLR (p->infd, &input_wait_mask);
          FD_CLR (p->infd, &non_keyboard_wait_mask);
        }
-      else if (EQ (PVAR (p, filter), Qt)
+      else if (EQ (PGET (p, filter), Qt)
               /* Network or serial process not stopped:  */
-              && !EQ (PVAR (p, command), Qt))
+              && !EQ (PGET (p, command), Qt))
        {
          FD_SET (p->infd, &input_wait_mask);
          FD_SET (p->infd, &non_keyboard_wait_mask);
        }
     }
 
-  PVAR (p, filter) = filter;
+  PSET (p, filter, filter);
   if (NETCONN1_P (p) || SERIALCONN1_P (p))
-    PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCfilter, filter);
+    PSET (p, childp, Fplist_put (PGET (p, childp), QCfilter, filter));
   setup_process_coding_systems (process);
   return filter;
 }
@@ -989,7 +988,7 @@
   (register Lisp_Object process)
 {
   CHECK_PROCESS (process);
-  return PVAR (XPROCESS (process), filter);
+  return PGET (XPROCESS (process), filter);
 }
 
 DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel,
@@ -1004,9 +1003,9 @@
   CHECK_PROCESS (process);
   p = XPROCESS (process);
 
-  PVAR (p, sentinel) = sentinel;
+  PSET (p, sentinel, sentinel);
   if (NETCONN1_P (p) || SERIALCONN1_P (p))
-    PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCsentinel, sentinel);
+    PSET (p, childp, Fplist_put (PGET (p, childp), QCsentinel, sentinel));
   return sentinel;
 }
 
@@ -1017,7 +1016,7 @@
   (register Lisp_Object process)
 {
   CHECK_PROCESS (process);
-  return PVAR (XPROCESS (process), sentinel);
+  return PGET (XPROCESS (process), sentinel);
 }
 
 DEFUN ("set-process-window-size", Fset_process_window_size,
@@ -1102,7 +1101,7 @@
   Lisp_Object contact;
 
   CHECK_PROCESS (process);
-  contact = PVAR (XPROCESS (process), childp);
+  contact = PGET (XPROCESS (process), childp);
 
 #ifdef DATAGRAM_SOCKETS
   if (DATAGRAM_CONN_P (process)
@@ -1128,7 +1127,7 @@
   (register Lisp_Object process)
 {
   CHECK_PROCESS (process);
-  return PVAR (XPROCESS (process), plist);
+  return PGET (XPROCESS (process), plist);
 }
 
 DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist,
@@ -1139,7 +1138,7 @@
   CHECK_PROCESS (process);
   CHECK_LIST (plist);
 
-  PVAR (XPROCESS (process), plist) = plist;
+  PSET (XPROCESS (process), plist, plist);
   return plist;
 }
 
@@ -1151,7 +1150,7 @@
 a socket connection.  */)
   (Lisp_Object process)
 {
-  return PVAR (XPROCESS (process), type);
+  return PGET (XPROCESS (process), type);
 }
 #endif
 
@@ -1164,7 +1163,7 @@
 {
   Lisp_Object proc;
   proc = get_process (process);
-  return PVAR (XPROCESS (proc), type);
+  return PGET (XPROCESS (proc), type);
 }
 
 DEFUN ("format-network-address", Fformat_network_address, 
Sformat_network_address,
@@ -1325,18 +1324,18 @@
      itself; it's all taken care of here.  */
   record_unwind_protect (start_process_unwind, proc);
 
-  PVAR (XPROCESS (proc), childp) = Qt;
-  PVAR (XPROCESS (proc), plist) = Qnil;
-  PVAR (XPROCESS (proc), type) = Qreal;
-  PVAR (XPROCESS (proc), buffer) = buffer;
-  PVAR (XPROCESS (proc), sentinel) = Qnil;
-  PVAR (XPROCESS (proc), filter) = Qnil;
-  PVAR (XPROCESS (proc), command) = Flist (nargs - 2, args + 2);
+  PSET (XPROCESS (proc), childp, Qt);
+  PSET (XPROCESS (proc), plist, Qnil);
+  PSET (XPROCESS (proc), type, Qreal);
+  PSET (XPROCESS (proc), buffer, buffer);
+  PSET (XPROCESS (proc), sentinel, Qnil);
+  PSET (XPROCESS (proc), filter, Qnil);
+  PSET (XPROCESS (proc), command, Flist (nargs - 2, args + 2));
 
 #ifdef HAVE_GNUTLS
   /* AKA GNUTLS_INITSTAGE(proc).  */
   XPROCESS (proc)->gnutls_initstage = GNUTLS_STAGE_EMPTY;
-  XPROCESS (proc)->gnutls_cred_type = Qnil;
+  PSET (XPROCESS (proc), gnutls_cred_type, Qnil);
 #endif
 
 #ifdef ADAPTIVE_READ_BUFFERING
@@ -1347,7 +1346,7 @@
 
   /* Make the process marker point into the process buffer (if any).  */
   if (BUFFERP (buffer))
-    set_marker_both (PVAR (XPROCESS (proc), mark), buffer,
+    set_marker_both (PGET (XPROCESS (proc), mark), buffer,
                     BUF_ZV (XBUFFER (buffer)),
                     BUF_ZV_BYTE (XBUFFER (buffer)));
 
@@ -1376,7 +1375,7 @@
        else if (CONSP (Vdefault_process_coding_system))
          val = XCAR (Vdefault_process_coding_system);
       }
-    PVAR (XPROCESS (proc), decode_coding_system) = val;
+    PSET (XPROCESS (proc), decode_coding_system, val);
 
     val = Vcoding_system_for_write;
     if (NILP (val))
@@ -1396,7 +1395,7 @@
        else if (CONSP (Vdefault_process_coding_system))
          val = XCDR (Vdefault_process_coding_system);
       }
-    PVAR (XPROCESS (proc), encode_coding_system) = val;
+    PSET (XPROCESS (proc), encode_coding_system, val);
     /* Note: At this moment, the above coding system may leave
        text-conversion or eol-conversion unspecified.  They will be
        decided after we read output from the process and decode it by
@@ -1405,9 +1404,9 @@
   }
 
 
-  PVAR (XPROCESS (proc), decoding_buf) = empty_unibyte_string;
+  PSET (XPROCESS (proc), decoding_buf, empty_unibyte_string);
   XPROCESS (proc)->decoding_carryover = 0;
-  PVAR (XPROCESS (proc), encoding_buf) = empty_unibyte_string;
+  PSET (XPROCESS (proc), encoding_buf, empty_unibyte_string);
 
   XPROCESS (proc)->inherit_coding_system_flag
     = !(NILP (buffer) || !inherit_process_coding_system);
@@ -1465,7 +1464,7 @@
              {
                if (NILP (arg_encoding))
                  arg_encoding = (complement_process_encoding_system
-                                 (PVAR (XPROCESS (proc), 
encode_coding_system)));
+                                 (PGET (XPROCESS (proc), 
encode_coding_system)));
                XSETCAR (tem,
                         code_convert_string_norecord
                         (XCAR (tem), arg_encoding, 1));
@@ -1629,7 +1628,7 @@
      more portable (see USG_SUBTTY_WORKS above).  */
 
   XPROCESS (process)->pty_flag = pty_flag;
-  PVAR (XPROCESS (process), status) = Qrun;
+  PSET (XPROCESS (process), status, Qrun);
 
   /* Delay interrupts until we have a chance to store
      the new fork's pid in its process structure */
@@ -1868,10 +1867,10 @@
 
 #ifdef HAVE_PTYS
       if (pty_flag)
-       PVAR (XPROCESS (process), tty_name) = build_string (pty_name);
+       PSET (XPROCESS (process), tty_name, build_string (pty_name));
       else
 #endif
-       PVAR (XPROCESS (process), tty_name) = Qnil;
+       PSET (XPROCESS (process), tty_name, Qnil);
 
 #if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
       /* Wait for child_setup to complete in case that vfork is
@@ -1966,7 +1965,7 @@
      more portable (see USG_SUBTTY_WORKS above).  */
 
   XPROCESS (process)->pty_flag = pty_flag;
-  PVAR (XPROCESS (process), status) = Qrun;
+  PSET (XPROCESS (process), status, Qrun);
   setup_process_coding_systems (process);
 
   FD_SET (inchannel, &input_wait_mask);
@@ -1977,10 +1976,10 @@
   XPROCESS (process)->pid = -2;
 #ifdef HAVE_PTYS
   if (pty_flag)
-    PVAR (XPROCESS (process), tty_name) = build_string (pty_name);
+    PSET (XPROCESS (process), tty_name, build_string (pty_name));
   else
 #endif
-    PVAR (XPROCESS (process), tty_name) = Qnil;
+    PSET (XPROCESS (process), tty_name, Qnil);
 }
 
 
@@ -2369,7 +2368,7 @@
 
   if (set_socket_option (s, option, value))
     {
-      PVAR (p, childp) = Fplist_put (PVAR (p, childp), option, value);
+      PSET (p, childp, Fplist_put (PGET (p, childp), option, value));
       return Qt;
     }
 
@@ -2458,10 +2457,10 @@
     proc = Fplist_get (contact, QCport);
   proc = get_process (proc);
   p = XPROCESS (proc);
-  if (!EQ (PVAR (p, type), Qserial))
+  if (!EQ (PGET (p, type), Qserial))
     error ("Not a serial process");
 
-  if (NILP (Fplist_get (PVAR (p, childp), QCspeed)))
+  if (NILP (Fplist_get (PGET (p, childp), QCspeed)))
     {
       UNGCPRO;
       return Qnil;
@@ -2602,21 +2601,21 @@
   if (NILP (buffer))
     buffer = name;
   buffer = Fget_buffer_create (buffer);
-  PVAR (p, buffer) = buffer;
+  PSET (p, buffer, buffer);
 
-  PVAR (p, childp) = contact;
-  PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist));
-  PVAR (p, type) = Qserial;
-  PVAR (p, sentinel) = Fplist_get (contact, QCsentinel);
-  PVAR (p, filter) = Fplist_get (contact, QCfilter);
-  PVAR (p, log) = Qnil;
+  PSET (p, childp, contact);
+  PSET (p, plist, Fcopy_sequence (Fplist_get (contact, QCplist)));
+  PSET (p, type, Qserial);
+  PSET (p, sentinel, Fplist_get (contact, QCsentinel));
+  PSET (p, filter, Fplist_get (contact, QCfilter));
+  PSET (p, log, Qnil);
   if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
     p->kill_without_query = 1;
   if (tem = Fplist_get (contact, QCstop), !NILP (tem))
-    PVAR (p, command) = Qt;
+    PSET (p, command, Qt);
   p->pty_flag = 0;
 
-  if (!EQ (PVAR (p, command), Qt))
+  if (!EQ (PGET (p, command), Qt))
     {
       FD_SET (fd, &input_wait_mask);
       FD_SET (fd, &non_keyboard_wait_mask);
@@ -2624,7 +2623,7 @@
 
   if (BUFFERP (buffer))
     {
-      set_marker_both (PVAR (p, mark), buffer,
+      set_marker_both (PGET (p, mark), buffer,
                       BUF_ZV (XBUFFER (buffer)),
                       BUF_ZV_BYTE (XBUFFER (buffer)));
     }
@@ -2645,7 +2644,7 @@
   else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), 
enable_multibyte_characters)))
           || (NILP (buffer) && NILP (BVAR (&buffer_defaults, 
enable_multibyte_characters))))
     val = Qnil;
-  PVAR (p, decode_coding_system) = val;
+  PSET (p, decode_coding_system, val);
 
   val = Qnil;
   if (!NILP (tem))
@@ -2659,12 +2658,12 @@
   else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), 
enable_multibyte_characters)))
           || (NILP (buffer) && NILP (BVAR (&buffer_defaults, 
enable_multibyte_characters))))
     val = Qnil;
-  PVAR (p, encode_coding_system) = val;
+  PSET (p, encode_coding_system, val);
 
   setup_process_coding_systems (proc);
-  PVAR (p, decoding_buf) = empty_unibyte_string;
+  PSET (p, decoding_buf, empty_unibyte_string);
   p->decoding_carryover = 0;
-  PVAR (p, encoding_buf) = empty_unibyte_string;
+  PSET (p, encoding_buf, empty_unibyte_string);
   p->inherit_coding_system_flag
     = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
 
@@ -3401,27 +3400,27 @@
 
   p = XPROCESS (proc);
 
-  PVAR (p, childp) = contact;
-  PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist));
-  PVAR (p, type) = Qnetwork;
+  PSET (p, childp, contact);
+  PSET (p, plist, Fcopy_sequence (Fplist_get (contact, QCplist)));
+  PSET (p, type, Qnetwork);
 
-  PVAR (p, buffer) = buffer;
-  PVAR (p, sentinel) = sentinel;
-  PVAR (p, filter) = filter;
-  PVAR (p, log) = Fplist_get (contact, QClog);
+  PSET (p, buffer, buffer);
+  PSET (p, sentinel, sentinel);
+  PSET (p, filter, filter);
+  PSET (p, log, Fplist_get (contact, QClog));
   if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
     p->kill_without_query = 1;
   if ((tem = Fplist_get (contact, QCstop), !NILP (tem)))
-    PVAR (p, command) = Qt;
+    PSET (p, command, Qt);
   p->pid = 0;
   p->infd  = inch;
   p->outfd = outch;
   if (is_server && socktype != SOCK_DGRAM)
-    PVAR (p, status) = Qlisten;
+    PSET (p, status, Qlisten);
 
   /* Make the process marker point into the process buffer (if any).  */
   if (BUFFERP (buffer))
-    set_marker_both (PVAR (p, mark), buffer,
+    set_marker_both (PGET (p, mark), buffer,
                     BUF_ZV (XBUFFER (buffer)),
                     BUF_ZV_BYTE (XBUFFER (buffer)));
 
@@ -3431,7 +3430,7 @@
       /* We may get here if connect did succeed immediately.  However,
         in that case, we still need to signal this like a non-blocking
         connection.  */
-      PVAR (p, status) = Qconnect;
+      PSET (p, status, Qconnect);
       if (!FD_ISSET (inch, &connect_wait_mask))
        {
          FD_SET (inch, &connect_wait_mask);
@@ -3443,8 +3442,8 @@
 #endif
     /* A server may have a client filter setting of Qt, but it must
        still listen for incoming connects unless it is stopped.  */
-    if ((!EQ (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt))
-       || (EQ (PVAR (p, status), Qlisten) && NILP (PVAR (p, command))))
+    if ((!EQ (PGET (p, filter), Qt) && !EQ (PGET (p, command), Qt))
+       || (EQ (PGET (p, status), Qlisten) && NILP (PGET (p, command))))
       {
        FD_SET (inch, &input_wait_mask);
        FD_SET (inch, &non_keyboard_wait_mask);
@@ -3498,7 +3497,7 @@
        else
          val = Qnil;
       }
-    PVAR (p, decode_coding_system) = val;
+    PSET (p, decode_coding_system, val);
 
     if (!NILP (tem))
       {
@@ -3532,13 +3531,13 @@
        else
          val = Qnil;
       }
-    PVAR (p, encode_coding_system) = val;
+    PSET (p, encode_coding_system, val);
   }
   setup_process_coding_systems (proc);
 
-  PVAR (p, decoding_buf) = empty_unibyte_string;
+  PSET (p, decoding_buf, empty_unibyte_string);
   p->decoding_carryover = 0;
-  PVAR (p, encoding_buf) = empty_unibyte_string;
+  PSET (p, encoding_buf, empty_unibyte_string);
 
   p->inherit_coding_system_flag
     = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
@@ -4031,8 +4030,8 @@
        return;
 #endif
 
-      if (!NILP (PVAR (ps, log)))
-       call3 (PVAR (ps, log), server, Qnil,
+      if (!NILP (PGET (ps, log)))
+       call3 (PGET (ps, log), server, Qnil,
               concat3 (build_string ("accept failed with code"),
                        Fnumber_to_string (make_number (code)),
                        build_string ("\n")));
@@ -4102,15 +4101,15 @@
      process name of the server process concatenated with the caller
      identification.  */
 
-  if (!NILP (PVAR (ps, filter)) && !EQ (PVAR (ps, filter), Qt))
+  if (!NILP (PGET (ps, filter)) && !EQ (PGET (ps, filter), Qt))
     buffer = Qnil;
   else
     {
-      buffer = PVAR (ps, buffer);
+      buffer = PGET (ps, buffer);
       if (!NILP (buffer))
        buffer = Fbuffer_name (buffer);
       else
-       buffer = PVAR (ps, name);
+       buffer = PGET (ps, name);
       if (!NILP (buffer))
        {
          buffer = concat2 (buffer, caller);
@@ -4121,7 +4120,7 @@
   /* Generate a unique name for the new server process.  Combine the
      server process name with the caller identification.  */
 
-  name = concat2 (PVAR (ps, name), caller);
+  name = concat2 (PGET (ps, name), caller);
   proc = make_process (name);
 
   chan_process[s] = proc;
@@ -4137,7 +4136,7 @@
   p = XPROCESS (proc);
 
   /* Build new contact information for this setup.  */
-  contact = Fcopy_sequence (PVAR (ps, childp));
+  contact = Fcopy_sequence (PGET (ps, childp));
   contact = Fplist_put (contact, QCserver, Qnil);
   contact = Fplist_put (contact, QChost, host);
   if (!NILP (service))
@@ -4151,21 +4150,21 @@
                          conv_sockaddr_to_lisp (&saddr.sa, len));
 #endif
 
-  PVAR (p, childp) = contact;
-  PVAR (p, plist) = Fcopy_sequence (PVAR (ps, plist));
-  PVAR (p, type) = Qnetwork;
+  PSET (p, childp, contact);
+  PSET (p, plist, Fcopy_sequence (PGET (ps, plist)));
+  PSET (p, type, Qnetwork);
 
-  PVAR (p, buffer) = buffer;
-  PVAR (p, sentinel) = PVAR (ps, sentinel);
-  PVAR (p, filter) = PVAR (ps, filter);
-  PVAR (p, command) = Qnil;
+  PSET (p, buffer, buffer);
+  PSET (p, sentinel, PGET (ps, sentinel));
+  PSET (p, filter, PGET (ps, filter));
+  PSET (p, command, Qnil);
   p->pid = 0;
   p->infd  = s;
   p->outfd = s;
-  PVAR (p, status) = Qrun;
+  PSET (p, status, Qrun);
 
   /* Client processes for accepted connections are not stopped initially.  */
-  if (!EQ (PVAR (p, filter), Qt))
+  if (!EQ (PGET (p, filter), Qt))
     {
       FD_SET (s, &input_wait_mask);
       FD_SET (s, &non_keyboard_wait_mask);
@@ -4179,24 +4178,24 @@
      of the new process should reflect the settings at the time the
      server socket was opened; not the current settings. */
 
-  PVAR (p, decode_coding_system) = PVAR (ps, decode_coding_system);
-  PVAR (p, encode_coding_system) = PVAR (ps, encode_coding_system);
+  PSET (p, decode_coding_system, PGET (ps, decode_coding_system));
+  PSET (p, encode_coding_system, PGET (ps, encode_coding_system));
   setup_process_coding_systems (proc);
 
-  PVAR (p, decoding_buf) = empty_unibyte_string;
+  PSET (p, decoding_buf, empty_unibyte_string);
   p->decoding_carryover = 0;
-  PVAR (p, encoding_buf) = empty_unibyte_string;
+  PSET (p, encoding_buf, empty_unibyte_string);
 
   p->inherit_coding_system_flag
     = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
 
-  if (!NILP (PVAR (ps, log)))
-      call3 (PVAR (ps, log), server, proc,
+  if (!NILP (PGET (ps, log)))
+      call3 (PGET (ps, log), server, proc,
             concat3 (build_string ("accept from "),
                      (STRINGP (host) ? host : build_string ("-")),
                      build_string ("\n")));
 
-  if (!NILP (PVAR (p, sentinel)))
+  if (!NILP (PGET (p, sentinel)))
     exec_sentinel (proc,
                   concat3 (build_string ("open from "),
                            (STRINGP (host) ? host : build_string ("-")),
@@ -4287,8 +4286,8 @@
   FD_ZERO (&Writeok);
 
   if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit)
-      && !(CONSP (PVAR (wait_proc, status))
-          && EQ (XCAR (PVAR (wait_proc, status)), Qexit)))
+      && !(CONSP (PGET (wait_proc, status))
+          && EQ (XCAR (PGET (wait_proc, status)), Qexit)))
     message ("Blocking call to accept-process-output with quit inhibited!!");
 
   /* If wait_proc is a process to watch, set wait_channel accordingly.  */
@@ -4461,8 +4460,8 @@
       if (wait_proc && wait_proc->raw_status_new)
        update_status (wait_proc);
       if (wait_proc
-         && ! EQ (PVAR (wait_proc, status), Qrun)
-         && ! EQ (PVAR (wait_proc, status), Qconnect))
+         && ! EQ (PGET (wait_proc, status), Qrun)
+         && ! EQ (PGET (wait_proc, status), Qconnect))
        {
          int nread, total_nread = 0;
 
@@ -4821,7 +4820,7 @@
                continue;
 
              /* If this is a server stream socket, accept connection.  */
-             if (EQ (PVAR (XPROCESS (proc), status), Qlisten))
+             if (EQ (PGET (XPROCESS (proc), status), Qlisten))
                {
                  server_accept_connection (proc, channel);
                  continue;
@@ -4890,7 +4889,7 @@
                         waitpid() will not find the process object to
                         delete.  Do it here.  */
                      p->tick = ++process_tick;
-                     PVAR (p, status) = Qfailed;
+                     PSET (p, status, Qfailed);
                    }
                   else
                    kill (getpid (), SIGCHLD);
@@ -4909,9 +4908,9 @@
                  deactivate_process (proc);
                  if (XPROCESS (proc)->raw_status_new)
                    update_status (XPROCESS (proc));
-                 if (EQ (PVAR (XPROCESS (proc), status), Qrun))
-                   PVAR (XPROCESS (proc), status)
-                     = Fcons (Qexit, Fcons (make_number (256), Qnil));
+                 if (EQ (PGET (XPROCESS (proc), status), Qrun))
+                   PSET (XPROCESS (proc), status,
+                         Fcons (Qexit, Fcons (make_number (256), Qnil)));
                }
            }
 #ifdef NON_BLOCKING_CONNECT
@@ -4959,18 +4958,18 @@
              if (xerrno)
                {
                  p->tick = ++process_tick;
-                 PVAR (p, status)
-                   = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil));
+                 PSET (p, status,
+                       Fcons (Qfailed, Fcons (make_number (xerrno), Qnil)));
                  deactivate_process (proc);
                }
              else
                {
-                 PVAR (p, status) = Qrun;
+                 PSET (p, status, Qrun);
                  /* Execute the sentinel here.  If we had relied on
                     status_notify to do it later, it will read input
                     from the process before calling the sentinel.  */
                  exec_sentinel (proc, build_string ("open\n"));
-                 if (!EQ (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt))
+                 if (!EQ (PGET (p, filter), Qt) && !EQ (PGET (p, command), Qt))
                    {
                      FD_SET (p->infd, &input_wait_mask);
                      FD_SET (p->infd, &non_keyboard_wait_mask);
@@ -5042,7 +5041,7 @@
   chars = alloca (carryover + readmax);
   if (carryover)
     /* See the comment above.  */
-    memcpy (chars, SDATA (PVAR (p, decoding_buf)), carryover);
+    memcpy (chars, SDATA (PGET (p, decoding_buf)), carryover);
 
 #ifdef DATAGRAM_SOCKETS
   /* We have a working select, so proc_buffered_char is always -1.  */
@@ -5121,7 +5120,7 @@
   record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
 
   /* Read and dispose of the process output.  */
-  outstream = PVAR (p, filter);
+  outstream = PGET (p, filter);
   if (!NILP (outstream))
     {
       Lisp_Object text;
@@ -5163,9 +5162,9 @@
       text = coding->dst_object;
       Vlast_coding_system_used = CODING_ID_NAME (coding->id);
       /* A new coding system might be found.  */
-      if (!EQ (PVAR (p, decode_coding_system), Vlast_coding_system_used))
+      if (!EQ (PGET (p, decode_coding_system), Vlast_coding_system_used))
        {
-         PVAR (p, decode_coding_system) = Vlast_coding_system_used;
+         PSET (p, decode_coding_system, Vlast_coding_system_used);
 
          /* Don't call setup_coding_system for
             proc_decode_coding_system[channel] here.  It is done in
@@ -5178,21 +5177,21 @@
             proc_encode_coding_system[p->outfd] surely points to a
             valid memory because p->outfd will be changed once EOF is
             sent to the process.  */
-         if (NILP (PVAR (p, encode_coding_system))
+         if (NILP (PGET (p, encode_coding_system))
              && proc_encode_coding_system[p->outfd])
            {
-             PVAR (p, encode_coding_system)
-               = coding_inherit_eol_type (Vlast_coding_system_used, Qnil);
-             setup_coding_system (PVAR (p, encode_coding_system),
+             PSET (p, encode_coding_system,
+                   coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
+             setup_coding_system (PGET (p, encode_coding_system),
                                   proc_encode_coding_system[p->outfd]);
            }
        }
 
       if (coding->carryover_bytes > 0)
        {
-         if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes)
-           PVAR (p, decoding_buf) = make_uninit_string 
(coding->carryover_bytes);
-         memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover,
+         if (SCHARS (PGET (p, decoding_buf)) < coding->carryover_bytes)
+           PSET (p, decoding_buf, make_uninit_string 
(coding->carryover_bytes));
+         memcpy (SDATA (PGET (p, decoding_buf)), coding->carryover,
                  coding->carryover_bytes);
          p->decoding_carryover = coding->carryover_bytes;
        }
@@ -5228,7 +5227,7 @@
     }
 
   /* If no filter, write into buffer if it isn't dead.  */
-  else if (!NILP (PVAR (p, buffer)) && !NILP (BVAR (XBUFFER (PVAR (p, 
buffer)), name)))
+  else if (!NILP (PGET (p, buffer)) && !NILP (BVAR (XBUFFER (PGET (p, 
buffer)), name)))
     {
       Lisp_Object old_read_only;
       ptrdiff_t old_begv, old_zv;
@@ -5238,7 +5237,7 @@
       Lisp_Object text;
       struct buffer *b;
 
-      Fset_buffer (PVAR (p, buffer));
+      Fset_buffer (PGET (p, buffer));
       opoint = PT;
       opoint_byte = PT_BYTE;
       old_read_only = BVAR (current_buffer, read_only);
@@ -5252,11 +5251,11 @@
       /* Insert new output into buffer
         at the current end-of-output marker,
         thus preserving logical ordering of input and output.  */
-      if (XMARKER (PVAR (p, mark))->buffer)
+      if (XMARKER (PGET (p, mark))->buffer)
        SET_PT_BOTH (clip_to_bounds (BEGV,
-                                    marker_position (PVAR (p, mark)), ZV),
+                                    marker_position (PGET (p, mark)), ZV),
                     clip_to_bounds (BEGV_BYTE,
-                                    marker_byte_position (PVAR (p, mark)),
+                                    marker_byte_position (PGET (p, mark)),
                                     ZV_BYTE));
       else
        SET_PT_BOTH (ZV, ZV_BYTE);
@@ -5273,23 +5272,23 @@
       Vlast_coding_system_used = CODING_ID_NAME (coding->id);
       /* A new coding system might be found.  See the comment in the
         similar code in the previous `if' block.  */
-      if (!EQ (PVAR (p, decode_coding_system), Vlast_coding_system_used))
+      if (!EQ (PGET (p, decode_coding_system), Vlast_coding_system_used))
        {
-         PVAR (p, decode_coding_system) = Vlast_coding_system_used;
-         if (NILP (PVAR (p, encode_coding_system))
+         PSET (p, decode_coding_system, Vlast_coding_system_used);
+         if (NILP (PGET (p, encode_coding_system))
              && proc_encode_coding_system[p->outfd])
            {
-             PVAR (p, encode_coding_system)
-               = coding_inherit_eol_type (Vlast_coding_system_used, Qnil);
-             setup_coding_system (PVAR (p, encode_coding_system),
+             PSET (p, encode_coding_system,
+                   coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
+             setup_coding_system (PGET (p, encode_coding_system),
                                   proc_encode_coding_system[p->outfd]);
            }
        }
       if (coding->carryover_bytes > 0)
        {
-         if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes)
-           PVAR (p, decoding_buf) = make_uninit_string 
(coding->carryover_bytes);
-         memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover,
+         if (SCHARS (PGET (p, decoding_buf)) < coding->carryover_bytes)
+           PSET (p, decoding_buf, make_uninit_string 
(coding->carryover_bytes));
+         memcpy (SDATA (PGET (p, decoding_buf)), coding->carryover,
                  coding->carryover_bytes);
          p->decoding_carryover = coding->carryover_bytes;
        }
@@ -5307,11 +5306,11 @@
       /* Make sure the process marker's position is valid when the
         process buffer is changed in the signal_after_change above.
         W3 is known to do that.  */
-      if (BUFFERP (PVAR (p, buffer))
-         && (b = XBUFFER (PVAR (p, buffer)), b != current_buffer))
-       set_marker_both (PVAR (p, mark), PVAR (p, buffer), BUF_PT (b), 
BUF_PT_BYTE (b));
+      if (BUFFERP (PGET (p, buffer))
+         && (b = XBUFFER (PGET (p, buffer)), b != current_buffer))
+       set_marker_both (PGET (p, mark), PGET (p, buffer), BUF_PT (b), 
BUF_PT_BYTE (b));
       else
-       set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE);
+       set_marker_both (PGET (p, mark), PGET (p, buffer), PT, PT_BYTE);
 
       update_mode_lines++;
 
@@ -5405,9 +5404,9 @@
   entry = Fcons (obj, Fcons (make_number (offset), make_number (len)));
 
   if (front)
-    PVAR (p, write_queue) = Fcons (entry, PVAR (p, write_queue));
+    PSET (p, write_queue, Fcons (entry, PGET (p, write_queue)));
   else
-    PVAR (p, write_queue) = nconc2 (PVAR (p, write_queue), Fcons (entry, 
Qnil));
+    PSET (p, write_queue, nconc2 (PGET (p, write_queue), Fcons (entry, Qnil)));
 }
 
 /* Remove the first element in the write_queue of process P, put its
@@ -5421,11 +5420,11 @@
   Lisp_Object entry, offset_length;
   ptrdiff_t offset;
 
-  if (NILP (PVAR (p, write_queue)))
+  if (NILP (PGET (p, write_queue)))
     return 0;
 
-  entry = XCAR (PVAR (p, write_queue));
-  PVAR (p, write_queue) = XCDR (PVAR (p, write_queue));
+  entry = XCAR (PGET (p, write_queue));
+  PSET (p, write_queue, XCDR (PGET (p, write_queue)));
 
   *obj = XCAR (entry);
   offset_length = XCDR (entry);
@@ -5459,10 +5458,10 @@
 
   if (p->raw_status_new)
     update_status (p);
-  if (! EQ (PVAR (p, status), Qrun))
-    error ("Process %s not running", SDATA (PVAR (p, name)));
+  if (! EQ (PGET (p, status), Qrun))
+    error ("Process %s not running", SDATA (PGET (p, name)));
   if (p->outfd < 0)
-    error ("Output file descriptor of %s is closed", SDATA (PVAR (p, name)));
+    error ("Output file descriptor of %s is closed", SDATA (PGET (p, name)));
 
   coding = proc_encode_coding_system[p->outfd];
   Vlast_coding_system_used = CODING_ID_NAME (coding->id);
@@ -5472,9 +5471,9 @@
          && !NILP (BVAR (XBUFFER (object), enable_multibyte_characters)))
       || EQ (object, Qt))
     {
-      PVAR (p, encode_coding_system)
-       = complement_process_encoding_system (PVAR (p, encode_coding_system));
-      if (!EQ (Vlast_coding_system_used, PVAR (p, encode_coding_system)))
+      PSET (p, encode_coding_system,
+           complement_process_encoding_system (PGET (p, 
encode_coding_system)));
+      if (!EQ (Vlast_coding_system_used, PGET (p, encode_coding_system)))
        {
          /* The coding system for encoding was changed to raw-text
             because we sent a unibyte text previously.  Now we are
@@ -5484,8 +5483,8 @@
             Another reason we come here is that the coding system
             was just complemented and a new one was returned by
             complement_process_encoding_system.  */
-         setup_coding_system (PVAR (p, encode_coding_system), coding);
-         Vlast_coding_system_used = PVAR (p, encode_coding_system);
+         setup_coding_system (PGET (p, encode_coding_system), coding);
+         Vlast_coding_system_used = PGET (p, encode_coding_system);
        }
       coding->src_multibyte = 1;
     }
@@ -5572,7 +5571,7 @@
 
       /* If there is already data in the write_queue, put the new data
          in the back of queue.  Otherwise, ignore it.  */
-      if (!NILP (PVAR (p, write_queue)))
+      if (!NILP (PGET (p, write_queue)))
         write_queue_push (p, object, buf, len, 0);
 
       do   /* while !NILP (p->write_queue) */
@@ -5686,7 +5685,7 @@
              cur_len -= written;
            }
        }
-      while (!NILP (PVAR (p, write_queue)));
+      while (!NILP (PGET (p, write_queue)));
     }
   else
     {
@@ -5694,10 +5693,10 @@
       proc = process_sent_to;
       p = XPROCESS (proc);
       p->raw_status_new = 0;
-      PVAR (p, status) = Fcons (Qexit, Fcons (make_number (256), Qnil));
+      PSET (p, status, Fcons (Qexit, Fcons (make_number (256), Qnil)));
       p->tick = ++process_tick;
       deactivate_process (proc);
-      error ("SIGPIPE raised on process %s; closed it", SDATA (PVAR (p, 
name)));
+      error ("SIGPIPE raised on process %s; closed it", SDATA (PGET (p, 
name)));
     }
 }
 
@@ -5755,12 +5754,12 @@
   pid_t gid = -1;
 
 #ifdef TIOCGPGRP
-  if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (PVAR (p, tty_name)))
+  if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (PGET (p, tty_name)))
     {
       int fd;
       /* Some OS:es (Solaris 8/9) does not allow TIOCGPGRP from the
         master side.  Try the slave side.  */
-      fd = emacs_open (SSDATA (PVAR (p, tty_name)), O_RDONLY, 0);
+      fd = emacs_open (SSDATA (PGET (p, tty_name)), O_RDONLY, 0);
 
       if (fd != -1)
        {
@@ -5789,12 +5788,12 @@
   proc = get_process (process);
   p = XPROCESS (proc);
 
-  if (!EQ (PVAR (p, type), Qreal))
+  if (!EQ (PGET (p, type), Qreal))
     error ("Process %s is not a subprocess",
-          SDATA (PVAR (p, name)));
+          SDATA (PGET (p, name)));
   if (p->infd < 0)
     error ("Process %s is not active",
-          SDATA (PVAR (p, name)));
+          SDATA (PGET (p, name)));
 
   gid = emacs_get_tty_pgrp (p);
 
@@ -5829,12 +5828,12 @@
   proc = get_process (process);
   p = XPROCESS (proc);
 
-  if (!EQ (PVAR (p, type), Qreal))
+  if (!EQ (PGET (p, type), Qreal))
     error ("Process %s is not a subprocess",
-          SDATA (PVAR (p, name)));
+          SDATA (PGET (p, name)));
   if (p->infd < 0)
     error ("Process %s is not active",
-          SDATA (PVAR (p, name)));
+          SDATA (PGET (p, name)));
 
   if (!p->pty_flag)
     current_group = Qnil;
@@ -5923,7 +5922,7 @@
 #ifdef SIGCONT
     case SIGCONT:
       p->raw_status_new = 0;
-      PVAR (p, status) = Qrun;
+      PSET (p, status, Qrun);
       p->tick = ++process_tick;
       if (!nomsg)
        {
@@ -6013,13 +6012,13 @@
       struct Lisp_Process *p;
 
       p = XPROCESS (process);
-      if (NILP (PVAR (p, command))
+      if (NILP (PGET (p, command))
          && p->infd >= 0)
        {
          FD_CLR (p->infd, &input_wait_mask);
          FD_CLR (p->infd, &non_keyboard_wait_mask);
        }
-      PVAR (p, command) = Qt;
+      PSET (p, command, Qt);
       return process;
     }
 #ifndef SIGTSTP
@@ -6042,9 +6041,9 @@
       struct Lisp_Process *p;
 
       p = XPROCESS (process);
-      if (EQ (PVAR (p, command), Qt)
+      if (EQ (PGET (p, command), Qt)
          && p->infd >= 0
-         && (!EQ (PVAR (p, filter), Qt) || EQ (PVAR (p, status), Qlisten)))
+         && (!EQ (PGET (p, filter), Qt) || EQ (PGET (p, status), Qlisten)))
        {
          FD_SET (p->infd, &input_wait_mask);
          FD_SET (p->infd, &non_keyboard_wait_mask);
@@ -6055,7 +6054,7 @@
          tcflush (p->infd, TCIFLUSH);
 #endif /* not WINDOWSNT */
        }
-      PVAR (p, command) = Qnil;
+      PSET (p, command, Qnil);
       return process;
     }
 #ifdef SIGCONT
@@ -6103,7 +6102,7 @@
       pid = XPROCESS (process)->pid;
       if (pid <= 0)
        error ("Cannot signal process %s",
-              SDATA (PVAR (XPROCESS (process), name)));
+              SDATA (PGET (XPROCESS (process), name)));
     }
 
 #define parse_signal(NAME, VALUE)              \
@@ -6247,8 +6246,8 @@
   /* Make sure the process is really alive.  */
   if (XPROCESS (proc)->raw_status_new)
     update_status (XPROCESS (proc));
-  if (! EQ (PVAR (XPROCESS (proc), status), Qrun))
-    error ("Process %s not running", SDATA (PVAR (XPROCESS (proc), name)));
+  if (! EQ (PGET (XPROCESS (proc), status), Qrun))
+    error ("Process %s not running", SDATA (PGET (XPROCESS (proc), name)));
 
   if (CODING_REQUIRE_FLUSHING (coding))
     {
@@ -6258,7 +6257,7 @@
 
   if (XPROCESS (proc)->pty_flag)
     send_process (proc, "\004", 1, Qnil);
-  else if (EQ (PVAR (XPROCESS (proc), type), Qserial))
+  else if (EQ (PGET (XPROCESS (proc), type), Qserial))
     {
 #ifndef WINDOWSNT
       if (tcdrain (XPROCESS (proc)->outfd) != 0)
@@ -6275,7 +6274,7 @@
         for communication with the subprocess, call shutdown to cause EOF.
         (In some old system, shutdown to socketpair doesn't work.
         Then we just can't win.)  */
-      if (EQ (PVAR (XPROCESS (proc), type), Qnetwork)
+      if (EQ (PGET (XPROCESS (proc), type), Qnetwork)
          || XPROCESS (proc)->outfd == XPROCESS (proc)->infd)
        shutdown (XPROCESS (proc)->outfd, 1);
       /* In case of socketpair, outfd == infd, so don't close it.  */
@@ -6388,7 +6387,7 @@
        {
          proc = XCDR (XCAR (tail));
          p = XPROCESS (proc);
-         if (EQ (PVAR (p, type), Qreal) && p->pid == pid)
+         if (EQ (PGET (p, type), Qreal) && p->pid == pid)
            break;
          p = 0;
        }
@@ -6472,7 +6471,7 @@
 static Lisp_Object
 exec_sentinel_unwind (Lisp_Object data)
 {
-  PVAR (XPROCESS (XCAR (data)), sentinel) = XCDR (data);
+  PSET (XPROCESS (XCAR (data)), sentinel, XCDR (data));
   return Qnil;
 }
 
@@ -6512,13 +6511,13 @@
      friends don't expect current-buffer to be changed from under them.  */
   record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
 
-  sentinel = PVAR (p, sentinel);
+  sentinel = PGET (p, sentinel);
   if (NILP (sentinel))
     return;
 
   /* Zilch the sentinel while it's running, to avoid recursive invocations;
      assure that it gets restored no matter how the sentinel exits.  */
-  PVAR (p, sentinel) = Qnil;
+  PSET (p, sentinel, Qnil);
   record_unwind_protect (exec_sentinel_unwind, Fcons (proc, sentinel));
   /* Inhibit quit so that random quits don't screw up a running filter.  */
   specbind (Qinhibit_quit, Qt);
@@ -6606,16 +6605,16 @@
          p->update_tick = p->tick;
 
          /* If process is still active, read any output that remains.  */
-         while (! EQ (PVAR (p, filter), Qt)
-                && ! EQ (PVAR (p, status), Qconnect)
-                && ! EQ (PVAR (p, status), Qlisten)
+         while (! EQ (PGET (p, filter), Qt)
+                && ! EQ (PGET (p, status), Qconnect)
+                && ! EQ (PGET (p, status), Qlisten)
                 /* Network or serial process not stopped:  */
-                && ! EQ (PVAR (p, command), Qt)
+                && ! EQ (PGET (p, command), Qt)
                 && p->infd >= 0
                 && p != deleting_process
                 && read_process_output (proc, p->infd) > 0);
 
-         buffer = PVAR (p, buffer);
+         buffer = PGET (p, buffer);
 
          /* Get the text to use for the message.  */
          if (p->raw_status_new)
@@ -6623,9 +6622,9 @@
          msg = status_message (p);
 
          /* If process is terminated, deactivate it or delete it.  */
-         symbol = PVAR (p, status);
-         if (CONSP (PVAR (p, status)))
-           symbol = XCAR (PVAR (p, status));
+         symbol = PGET (p, status);
+         if (CONSP (PGET (p, status)))
+           symbol = XCAR (PGET (p, status));
 
          if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)
              || EQ (symbol, Qclosed))
@@ -6642,7 +6641,7 @@
             this code to be run again.  */
          p->update_tick = p->tick;
          /* Now output the message suitably.  */
-         if (!NILP (PVAR (p, sentinel)))
+         if (!NILP (PGET (p, sentinel)))
            exec_sentinel (proc, msg);
          /* Don't bother with a message in the buffer
             when a process becomes runnable.  */
@@ -6664,8 +6663,8 @@
              /* Insert new output into buffer
                 at the current end-of-output marker,
                 thus preserving logical ordering of input and output.  */
-             if (XMARKER (PVAR (p, mark))->buffer)
-               Fgoto_char (PVAR (p, mark));
+             if (XMARKER (PGET (p, mark))->buffer)
+               Fgoto_char (PGET (p, mark));
              else
                SET_PT_BOTH (ZV, ZV_BYTE);
 
@@ -6675,11 +6674,12 @@
              tem = BVAR (current_buffer, read_only);
              BVAR (current_buffer, read_only) = Qnil;
              insert_string ("\nProcess ");
-             Finsert (1, &PVAR (p, name));
+             { /* FIXME: temporary kludge */
+               Lisp_Object tem2 = PGET (p, name); Finsert (1, &tem2); }
              insert_string (" ");
              Finsert (1, &msg);
              BVAR (current_buffer, read_only) = tem;
-             set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE);
+             set_marker_both (PGET (p, mark), PGET (p, buffer), PT, PT_BYTE);
 
              if (opoint >= before)
                SET_PT_BOTH (opoint + (PT - before),
@@ -6709,14 +6709,14 @@
   CHECK_PROCESS (process);
   p = XPROCESS (process);
   if (p->infd < 0)
-    error ("Input file descriptor of %s closed", SDATA (PVAR (p, name)));
+    error ("Input file descriptor of %s closed", SDATA (PGET (p, name)));
   if (p->outfd < 0)
-    error ("Output file descriptor of %s closed", SDATA (PVAR (p, name)));
+    error ("Output file descriptor of %s closed", SDATA (PGET (p, name)));
   Fcheck_coding_system (decoding);
   Fcheck_coding_system (encoding);
   encoding = coding_inherit_eol_type (encoding, Qnil);
-  PVAR (p, decode_coding_system) = decoding;
-  PVAR (p, encode_coding_system) = encoding;
+  PSET (p, decode_coding_system, decoding);
+  PSET (p, encode_coding_system, encoding);
   setup_process_coding_systems (process);
 
   return Qnil;
@@ -6728,8 +6728,8 @@
   (register Lisp_Object process)
 {
   CHECK_PROCESS (process);
-  return Fcons (PVAR (XPROCESS (process), decode_coding_system),
-               PVAR (XPROCESS (process), encode_coding_system));
+  return Fcons (PGET (XPROCESS (process), decode_coding_system),
+               PGET (XPROCESS (process), encode_coding_system));
 }
 
 DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte,
@@ -6746,8 +6746,8 @@
   CHECK_PROCESS (process);
   p = XPROCESS (process);
   if (NILP (flag))
-    PVAR (p, decode_coding_system)
-      = raw_text_coding_system (PVAR (p, decode_coding_system));
+    PSET (p, decode_coding_system,
+         raw_text_coding_system (PGET (p, decode_coding_system)));
   setup_process_coding_systems (process);
 
   return Qnil;
@@ -7085,19 +7085,19 @@
 
   if (!proc_decode_coding_system[inch])
     proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system));
-  coding_system = PVAR (p, decode_coding_system);
-  if (! NILP (PVAR (p, filter)))
+  coding_system = PGET (p, decode_coding_system);
+  if (! NILP (PGET (p, filter)))
     ;
-  else if (BUFFERP (PVAR (p, buffer)))
+  else if (BUFFERP (PGET (p, buffer)))
     {
-      if (NILP (BVAR (XBUFFER (PVAR (p, buffer)), 
enable_multibyte_characters)))
+      if (NILP (BVAR (XBUFFER (PGET (p, buffer)), 
enable_multibyte_characters)))
        coding_system = raw_text_coding_system (coding_system);
     }
   setup_coding_system (coding_system, proc_decode_coding_system[inch]);
 
   if (!proc_encode_coding_system[outch])
     proc_encode_coding_system[outch] = xmalloc (sizeof (struct coding_system));
-  setup_coding_system (PVAR (p, encode_coding_system),
+  setup_coding_system (PGET (p, encode_coding_system),
                       proc_encode_coding_system[outch]);
 #endif
 }
@@ -7143,7 +7143,7 @@
   for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
     {
       proc = Fcdr (XCAR (tail));
-      if (PROCESSP (proc) && EQ (PVAR (XPROCESS (proc), buffer), buf))
+      if (PROCESSP (proc) && EQ (PGET (XPROCESS (proc), buffer), buf))
        return proc;
     }
 #endif /* subprocesses */
@@ -7182,7 +7182,7 @@
     {
       proc = XCDR (XCAR (tail));
       if (PROCESSP (proc)
-         && (NILP (buffer) || EQ (PVAR (XPROCESS (proc), buffer), buffer)))
+         && (NILP (buffer) || EQ (PGET (XPROCESS (proc), buffer), buffer)))
        {
          if (NETCONN_P (proc) || SERIALCONN_P (proc))
            Fdelete_process (proc);

=== modified file 'src/process.h'
--- a/src/process.h     2012-08-01 06:23:24 +0000
+++ b/src/process.h     2012-08-06 11:16:07 +0000
@@ -26,10 +26,15 @@
 #include "gnutls.h"
 #endif
 
-/* Most code should use this macro to access
-   Lisp fields in struct Lisp_Process.  */
-
-#define PVAR(w, field) ((w)->INTERNAL_FIELD (field))
+/* Most code should use these macros to access Lisp fields in
+   struct Lisp_Process.  PGET should not be used as lvalue.  */
+
+#define PGET(p, field)                                         \
+  (eassert (offsetof (struct Lisp_Process, field ## _)         \
+           < offsetof (struct Lisp_Process, pid)),             \
+   ((p)->INTERNAL_FIELD (field)))
+
+#define PSET(p, field, value) ((p)->INTERNAL_FIELD (field) = (value))
 
 /* This structure records information about a subprocess
    or network connection.  */
@@ -100,7 +105,7 @@
     Lisp_Object INTERNAL_FIELD (write_queue);
 
 #ifdef HAVE_GNUTLS
-    Lisp_Object gnutls_cred_type;
+    Lisp_Object INTERNAL_FIELD (gnutls_cred_type);
 #endif
 
     /* After this point, there are no Lisp_Objects any more.  */

=== modified file 'src/sysdep.c'
--- a/src/sysdep.c      2012-08-03 23:36:11 +0000
+++ b/src/sysdep.c      2012-08-06 11:16:07 +0000
@@ -2159,7 +2159,7 @@
   int err = -1;
   char summary[4] = "???"; /* This usually becomes "8N1".  */
 
-  childp2 = Fcopy_sequence (PVAR (p, childp));
+  childp2 = Fcopy_sequence (PGET (p, childp));
 
   /* Read port attributes and prepare default configuration.  */
   err = tcgetattr (p->outfd, &attr);
@@ -2177,7 +2177,7 @@
   if (!NILP (Fplist_member (contact, QCspeed)))
     tem = Fplist_get (contact, QCspeed);
   else
-    tem = Fplist_get (PVAR (p, childp), QCspeed);
+    tem = Fplist_get (PGET (p, childp), QCspeed);
   CHECK_NUMBER (tem);
   err = cfsetspeed (&attr, XINT (tem));
   if (err != 0)
@@ -2189,7 +2189,7 @@
   if (!NILP (Fplist_member (contact, QCbytesize)))
     tem = Fplist_get (contact, QCbytesize);
   else
-    tem = Fplist_get (PVAR (p, childp), QCbytesize);
+    tem = Fplist_get (PGET (p, childp), QCbytesize);
   if (NILP (tem))
     tem = make_number (8);
   CHECK_NUMBER (tem);
@@ -2210,7 +2210,7 @@
   if (!NILP (Fplist_member (contact, QCparity)))
     tem = Fplist_get (contact, QCparity);
   else
-    tem = Fplist_get (PVAR (p, childp), QCparity);
+    tem = Fplist_get (PGET (p, childp), QCparity);
   if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd))
     error (":parity must be nil (no parity), `even', or `odd'");
 #if defined (PARENB) && defined (PARODD) && defined (IGNPAR) && defined (INPCK)
@@ -2243,7 +2243,7 @@
   if (!NILP (Fplist_member (contact, QCstopbits)))
     tem = Fplist_get (contact, QCstopbits);
   else
-    tem = Fplist_get (PVAR (p, childp), QCstopbits);
+    tem = Fplist_get (PGET (p, childp), QCstopbits);
   if (NILP (tem))
     tem = make_number (1);
   CHECK_NUMBER (tem);
@@ -2265,7 +2265,7 @@
   if (!NILP (Fplist_member (contact, QCflowcontrol)))
     tem = Fplist_get (contact, QCflowcontrol);
   else
-    tem = Fplist_get (PVAR (p, childp), QCflowcontrol);
+    tem = Fplist_get (PGET (p, childp), QCflowcontrol);
   if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw))
     error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'");
 #if defined (CRTSCTS)
@@ -2307,7 +2307,7 @@
     error ("tcsetattr() failed: %s", emacs_strerror (errno));
 
   childp2 = Fplist_put (childp2, QCsummary, build_string (summary));
-  PVAR (p, childp) = childp2;
+  PSET (p, childp, childp2);
 
 }
 #endif /* not DOS_NT  */

=== modified file 'src/w32.c'
--- a/src/w32.c 2012-08-04 14:17:10 +0000
+++ b/src/w32.c 2012-08-06 11:16:07 +0000
@@ -6891,7 +6891,7 @@
     error ("Not a serial process");
   hnd = fd_info[ p->outfd ].hnd;
 
-  childp2 = Fcopy_sequence (PVAR (p, childp));
+  childp2 = Fcopy_sequence (PGET (p, childp));
 
   /* Initialize timeouts for blocking read and blocking write.  */
   if (!GetCommTimeouts (hnd, &ct))
@@ -6920,7 +6920,7 @@
   if (!NILP (Fplist_member (contact, QCspeed)))
     tem = Fplist_get (contact, QCspeed);
   else
-    tem = Fplist_get (PVAR (p, childp), QCspeed);
+    tem = Fplist_get (PGET (p, childp), QCspeed);
   CHECK_NUMBER (tem);
   dcb.BaudRate = XINT (tem);
   childp2 = Fplist_put (childp2, QCspeed, tem);
@@ -6929,7 +6929,7 @@
   if (!NILP (Fplist_member (contact, QCbytesize)))
     tem = Fplist_get (contact, QCbytesize);
   else
-    tem = Fplist_get (PVAR (p, childp), QCbytesize);
+    tem = Fplist_get (PGET (p, childp), QCbytesize);
   if (NILP (tem))
     tem = make_number (8);
   CHECK_NUMBER (tem);
@@ -6943,7 +6943,7 @@
   if (!NILP (Fplist_member (contact, QCparity)))
     tem = Fplist_get (contact, QCparity);
   else
-    tem = Fplist_get (PVAR (p, childp), QCparity);
+    tem = Fplist_get (PGET (p, childp), QCparity);
   if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd))
     error (":parity must be nil (no parity), `even', or `odd'");
   dcb.fParity = FALSE;
@@ -6973,7 +6973,7 @@
   if (!NILP (Fplist_member (contact, QCstopbits)))
     tem = Fplist_get (contact, QCstopbits);
   else
-    tem = Fplist_get (PVAR (p, childp), QCstopbits);
+    tem = Fplist_get (PGET (p, childp), QCstopbits);
   if (NILP (tem))
     tem = make_number (1);
   CHECK_NUMBER (tem);
@@ -6990,7 +6990,7 @@
   if (!NILP (Fplist_member (contact, QCflowcontrol)))
     tem = Fplist_get (contact, QCflowcontrol);
   else
-    tem = Fplist_get (PVAR (p, childp), QCflowcontrol);
+    tem = Fplist_get (PGET (p, childp), QCflowcontrol);
   if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw))
     error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'");
   dcb.fOutxCtsFlow     = FALSE;
@@ -7024,7 +7024,7 @@
     error ("SetCommState() failed");
 
   childp2 = Fplist_put (childp2, QCsummary, build_string (summary));
-  PVAR (p, childp) = childp2;
+  PSET (p, childp, childp2);
 }
 
 #ifdef HAVE_GNUTLS

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-08-06 10:24:26 +0000
+++ b/src/xdisp.c       2012-08-06 11:16:07 +0000
@@ -21677,9 +21677,9 @@
        if (PROCESSP (obj))
          {
            p = decode_mode_spec_coding
-             (PVAR (XPROCESS (obj), decode_coding_system), p, eol_flag);
+             (PGET (XPROCESS (obj), decode_coding_system), p, eol_flag);
            p = decode_mode_spec_coding
-             (PVAR (XPROCESS (obj), encode_coding_system), p, eol_flag);
+             (PGET (XPROCESS (obj), encode_coding_system), p, eol_flag);
          }
 #endif /* subprocesses */
 #endif /* 0 */


reply via email to

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