1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-01 13:21:11 -08: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

16 lines
320 B
Text

// 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)
)