akaros/scripts/plan9user/plan9.cocci
<<
>>
Prefs
   1@ seek@
   2@@
   3-Bseek(
   4+fseek(
   5...)
   6
   7@ Boffset@
   8@@
   9-Boffset(
  10+ftell(
  11...)
  12
  13@ print@
  14@@
  15-print(
  16+printf(
  17...)
  18
  19@ sprint@
  20@@
  21-sprint(
  22+sprintf(
  23...)
  24
  25@ fprint@
  26expression E;
  27@@
  28-fprint(E,
  29+fprintf(stderr,
  30...)
  31
  32@ mallocz@
  33expression E;
  34expression yes;
  35@@
  36-mallocz(
  37+calloc(1, 
  38E
  39-, yes
  40 )
  41
  42@USED@
  43@@
  44-USED(...);
  45
  46@NOTED@
  47expression E;
  48@@
  49-noted(E);
  50+ignore(E);fprintf(stderr, "noted\n"); exit(1);
  51
  52@exits@
  53expression E;
  54@@
  55-exits(E);
  56+fprintf(stderr, E); exit(1);
  57
  58@ channel @
  59identifier d;
  60@@
  61-Chan
  62+struct chan
  63d;
  64
  65@ channelstar @
  66identifier d;
  67@@
  68-Chan *
  69+struct chan *
  70d;
  71
  72@mount@
  73identifier d;
  74@@
  75-Mount
  76+struct mount
  77d;
  78
  79@ mountstar @
  80identifier d;
  81@@
  82-Chan *
  83+struct mount *
  84d;
  85
  86@uvlong@
  87identifier d;
  88@@
  89-uvlong
  90+uint64_t
  91d;
  92@vlong@
  93identifier d;
  94@@
  95-vlong
  96+int64_t
  97d;
  98@ulong@
  99identifier d;
 100@@
 101-ulong
 102+uint32_t
 103d;
 104@ushort@
 105identifier d;
 106@@
 107-ushort
 108+uint16_t
 109d;
 110
 111@ rulesm @
 112identifier t;
 113identifier f;
 114expression E1;
 115type T;
 116@@
 117T f(...){<...
 118t = smalloc(E1);
 119...>}
 120@@
 121identifier rulesm.f;
 122expression E1;
 123@@
 124
 125- smalloc(E1
 126+ calloc(E1, 1
 127   )
 128
 129@ rulem @
 130identifier t;
 131identifier f;
 132expression E1;
 133type T;
 134@@
 135T f(...){<...
 136t = malloc(E1);
 137...>}
 138@@
 139identifier rulem.f;
 140expression E1;
 141@@
 142
 143- malloc(E1
 144+ calloc(E1, 1
 145   )
 146
 147@@
 148@@
 149-getcallerpc(...);
 150@@
 151@@
 152-setmalloctag(...);
 153
 154@@
 155type T;
 156@@
 157-T validname0(...){...}
 158
 159@@
 160type T;
 161@@
 162-T kstrcpy(...){...}
 163
 164@@
 165@@
 166-if (up){
 167+if (current){
 168...  } else {...}
 169
 170@@
 171@@
 172-snprint(
 173+snprintf(
 174...)
 175
 176@@
 177@@
 178-seek(
 179+lseek(
 180...)
 181
 182@@
 183expression E;
 184@@
 185-strcpy(up->errstr,
 186+set_errstr(
 187E)
 188@@
 189@@
 190-saveregisters(...);
 191@@
 192@@
 193-saveregisters(...){...}
 194@@
 195@@
 196+//
 197muxclose(...);
 198
 199@@
 200@@
 201-sysfatal(
 202+error(1, 0, 
 203...)
 204
 205