diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2012-06-19 20:56:28 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2012-06-19 20:56:28 +0400 |
commit | 28be1ada0fb9a4b51cf361dc45208e764bd34143 (patch) | |
tree | 30a21470e485d1d9f397d97dcb9a386c578ab746 /src/xselect.c | |
parent | 68f12411893785de1cfc2c24ec36059e49af5d55 (diff) | |
download | emacs-28be1ada0fb9a4b51cf361dc45208e764bd34143.tar.gz |
* alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
* font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
* print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.
Diffstat (limited to 'src/xselect.c')
-rw-r--r-- | src/xselect.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/xselect.c b/src/xselect.c index f1eda5d7c85..49a491d4163 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1816,12 +1816,12 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj, ptrdiff_t i; ptrdiff_t size = ASIZE (obj); - if (SYMBOLP (XVECTOR (obj)->contents [0])) + if (SYMBOLP (AREF (obj, 0))) /* This vector is an ATOM set */ { if (NILP (type)) type = QATOM; for (i = 0; i < size; i++) - if (!SYMBOLP (XVECTOR (obj)->contents [i])) + if (!SYMBOLP (AREF (obj, i))) signal_error ("All elements of selection vector must have same type", obj); *data_ret = xnmalloc (size, sizeof (Atom)); @@ -1829,7 +1829,7 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj, *size_ret = size; for (i = 0; i < size; i++) (*(Atom **) data_ret) [i] - = symbol_to_x_atom (dpyinfo, XVECTOR (obj)->contents [i]); + = symbol_to_x_atom (dpyinfo, AREF (obj, i)); } else /* This vector is an INTEGER set, or something like it */ @@ -1839,7 +1839,7 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj, if (NILP (type)) type = QINTEGER; for (i = 0; i < size; i++) { - if (! RANGED_INTEGERP (X_SHRT_MIN, XVECTOR (obj)->contents[i], + if (! RANGED_INTEGERP (X_SHRT_MIN, AREF (obj, i), X_SHRT_MAX)) { /* Use sizeof (long) even if it is more than 32 bits. @@ -1857,10 +1857,10 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj, { if (format == 32) (*((unsigned long **) data_ret)) [i] = - cons_to_x_long (XVECTOR (obj)->contents[i]); + cons_to_x_long (AREF (obj, i)); else (*((short **) data_ret)) [i] = - XINT (XVECTOR (obj)->contents[i]); + XINT (AREF (obj, i)); } } } @@ -1895,11 +1895,10 @@ clean_local_selection_data (Lisp_Object obj) ptrdiff_t size = ASIZE (obj); Lisp_Object copy; if (size == 1) - return clean_local_selection_data (XVECTOR (obj)->contents [0]); + return clean_local_selection_data (AREF (obj, 0)); copy = Fmake_vector (make_number (size), Qnil); for (i = 0; i < size; i++) - XVECTOR (copy)->contents [i] - = clean_local_selection_data (XVECTOR (obj)->contents [i]); + ASET (copy, i, clean_local_selection_data (AREF (obj, i))); return copy; } return obj; |