all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 10b01f2bbd458f8ac9c9997b90d06d9c4ac43744 320 bytes (raw)
name: admin/coccinelle/vector_contents.cocci 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 
// 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)
)

debug log:

solving 10b01f2bbd458f8ac9c9997b90d06d9c4ac43744 ...
found 10b01f2bbd458f8ac9c9997b90d06d9c4ac43744 in https://git.savannah.gnu.org/cgit/emacs.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.