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 (11 years, 3 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)

    1: This page lists various [coccinelle](http://coccinelle.lip6.fr/) scripts used for NetBSD:
    2: 
    3: * [*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:
    4:  :
    5: 
    6: [[!template  id=programlisting text="""
    7: # This will show possible aprint_debug to aprint_debug_dev replacements
    8: $ spatch -sp_file aprint2aprint_dev.cocci -D aprint=aprint_debug -D aprint_dev=aprint_debug_dev -dir /path_to_directory/
    9: ...
   10: # This will show possible aprint_normal to aprint_normal_dev replacements
   11: $ spatch -sp_file aprint2aprint_dev.cocci -D aprint=aprint_normal -D aprint_dev=aprint_normal_dev -dir /path_to_directory/
   12: """]]
   13: 
   14: ... and so forth.
   15: 
   16: * [use __arraycount() where possible](http://www.netbsd.org/~jym/cocci/arraycount.cocci)

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