emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108719: First Coccinelle semantic pa


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108719: First Coccinelle semantic patch.
Date: Sun, 24 Jun 2012 20:18:41 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108719
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Sun 2012-06-24 20:18:41 +0400
message:
  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.
added:
  admin/coccinelle/
  admin/coccinelle/README
  admin/coccinelle/vector_contents.cocci
modified:
  admin/ChangeLog
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog   2012-06-22 21:17:42 +0000
+++ b/admin/ChangeLog   2012-06-24 16:18:41 +0000
@@ -1,3 +1,12 @@
+2012-06-24  Dmitry Antipov  <address@hidden>
+
+       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.
+
 2012-06-22  Paul Eggert  <address@hidden>
 
        Support higher-resolution time stamps (Bug#9000).

=== added directory 'admin/coccinelle'
=== added file 'admin/coccinelle/README'
--- a/admin/coccinelle/README   1970-01-01 00:00:00 +0000
+++ b/admin/coccinelle/README   2012-06-24 16:18:41 +0000
@@ -0,0 +1,3 @@
+This directory contains semantic patches for Coccinelle, a program matching
+and transformation tool for programs written in C.  For more details, see
+http://coccinelle.lip6.fr.

=== added file 'admin/coccinelle/vector_contents.cocci'
--- a/admin/coccinelle/vector_contents.cocci    1970-01-01 00:00:00 +0000
+++ b/admin/coccinelle/vector_contents.cocci    2012-06-24 16:18:41 +0000
@@ -0,0 +1,16 @@
+// Avoid direct access to `contents' member of
+// Lisp_Vector, use AREF and ASET where possible.
address@hidden@
+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)
+)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]