File:  [NetBSD Developer Wiki] / wikisrc / users / jym / coccinelle.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Sun Aug 22 00:56:36 2010 UTC (3 years, 7 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by jym: With coccinelle, use virtual identifiers for aprint work (code reuse is better... right)

This page lists various [coccinelle](http://coccinelle.lip6.fr/) scripts used for NetBSD:

* [*aprint_\*()* to *aprint_\*_dev()* possible replacements](http://www.netbsd.org/~jym/cocci/aprint2aprint_dev.cocci). Note that the script uses virtual identifiers, so pass the appropriate functions as argument to **spatch**. For example:
 :

[[!template  id=programlisting text="""
# This will show possible aprint_debug to aprint_debug_dev replacements
$ spatch -sp_file aprint2aprint_dev.cocci -D aprint=aprint_debug -D aprint_dev=aprint_debug_dev -dir /path_to_directory/
...
# This will show possible aprint_normal to aprint_normal_dev replacements
$ spatch -sp_file aprint2aprint_dev.cocci -D aprint=aprint_normal -D aprint_dev=aprint_normal_dev -dir /path_to_directory/
"""]]

... and so forth.

* [use __arraycount() where possible](http://www.netbsd.org/~jym/cocci/arraycount.cocci)

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb