summaryrefslogtreecommitdiff
path: root/src/process.h
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2012-08-06 15:16:07 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2012-08-06 15:16:07 +0400
commit21238f117336d2a3f1e7970832ba05da14d44a03 (patch)
tree4510c0e3375f14f1e92960896fe24b5fcfe39baf /src/process.h
parent077288cf3f654776ee44bc9b56954c4e26b10d96 (diff)
downloademacs-21238f117336d2a3f1e7970832ba05da14d44a03.tar.gz
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.
Diffstat (limited to 'src/process.h')
-rw-r--r--src/process.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/process.h b/src/process.h
index dafa870b620..2bcb0c4bff6 100644
--- a/src/process.h
+++ b/src/process.h
@@ -26,10 +26,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "gnutls.h"
#endif
-/* Most code should use this macro to access
- Lisp fields in struct Lisp_Process. */
+/* Most code should use these macros to access Lisp fields in
+ struct Lisp_Process. PGET should not be used as lvalue. */
-#define PVAR(w, field) ((w)->INTERNAL_FIELD (field))
+#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 @@ struct Lisp_Process
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. */