aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorDmitry Antipov2012-06-24 20:18:41 +0400
committerDmitry Antipov2012-06-24 20:18:41 +0400
commit3c9359dfe479a7fa1b161ad86afe571f66b23617 (patch)
tree7fe79b5ff729775cbf3b68dba90fffbb94b743af /admin
parent772b2e2ce207fd747583aa51e3495aa37b1eede1 (diff)
downloademacs-3c9359dfe479a7fa1b161ad86afe571f66b23617.tar.gz
emacs-3c9359dfe479a7fa1b161ad86afe571f66b23617.zip
First Coccinelle semantic patch.
* coccinelle: New subdirectory * coccinelle/README: Documentation stub. * coccinelle/vector_contents.cocci: Semantic patch to replace direct access to `contents' member of Lisp_Vector objects with AREF and ASET where appropriate.
Diffstat (limited to 'admin')
-rw-r--r--admin/ChangeLog9
-rw-r--r--admin/coccinelle/README3
-rw-r--r--admin/coccinelle/vector_contents.cocci16
3 files changed, 28 insertions, 0 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index ec6448dbeee..44856f4b449 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,12 @@
12012-06-24 Dmitry Antipov <dmantipov@yandex.ru>
2
3 First Coccinelle semantic patch.
4 * coccinelle: New subdirectory
5 * coccinelle/README: Documentation stub.
6 * coccinelle/vector_contents.cocci: Semantic patch to replace direct
7 access to `contents' member of Lisp_Vector objects with AREF and ASET
8 where appropriate.
9
12012-06-22 Paul Eggert <eggert@cs.ucla.edu> 102012-06-22 Paul Eggert <eggert@cs.ucla.edu>
2 11
3 Support higher-resolution time stamps (Bug#9000). 12 Support higher-resolution time stamps (Bug#9000).
diff --git a/admin/coccinelle/README b/admin/coccinelle/README
new file mode 100644
index 00000000000..48a88dbc8d8
--- /dev/null
+++ b/admin/coccinelle/README
@@ -0,0 +1,3 @@
1This directory contains semantic patches for Coccinelle, a program matching
2and transformation tool for programs written in C. For more details, see
3http://coccinelle.lip6.fr.
diff --git a/admin/coccinelle/vector_contents.cocci b/admin/coccinelle/vector_contents.cocci
new file mode 100644
index 00000000000..beebc2d2089
--- /dev/null
+++ b/admin/coccinelle/vector_contents.cocci
@@ -0,0 +1,16 @@
1// Avoid direct access to `contents' member of
2// Lisp_Vector, use AREF and ASET where possible.
3@expression@
4identifier I1, I2;
5expression E1, E2;
6@@
7(
8- XVECTOR (I1)->contents[I2++] = E1
9+ ASET (I1, I2, E1), I2++
10|
11- XVECTOR (I1)->contents[E1] = E2
12+ ASET (I1, E1, E2)
13|
14-XVECTOR (I1)->contents[E1]
15+AREF (I1, E1)
16)