1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-30 19:53:09 +00:00
emacs/admin/coccinelle/vector_contents.cocci
Paul Eggert e56096dbb9 Minor quoting fixes in scripts and doc
Prefer straight quotes in random script files, as they are not converted.
Prefer grave quotes in a couple of places in the manual that were missed
earlier, as these quotes are converted.
2015-09-16 16:07:15 -07:00

17 lines
320 B
Plaintext

// Avoid direct access to 'contents' member of
// Lisp_Vector, use AREF and ASET where possible.
@expression@
identifier I1, I2;
expression E1, E2;
@@
(
- XVECTOR (I1)->contents[I2++] = E1
+ ASET (I1, I2, E1), I2++
|
- XVECTOR (I1)->contents[E1] = E2
+ ASET (I1, E1, E2)
|
- XVECTOR (I1)->contents[E1]
+ AREF (I1, E1)
)