akaros/scripts/plan9
<<
>>
Prefs
   1#!/bin/sh
   2sed -i 's/nil/NULL/g' $1
   3sed -i 's/KERN_WAIT/MEM_WAIT/g' $1
   4sed -i 's/nelem/ARRAY_SIZE/g' $1
   5
   6# stuff I'm not smart enough to do with spatch
   7sed -i '/strcpy.*(\(.*\),\(.*\));/s//strlcpy(\1, \2, sizeof(\1));/' $1
   8sed -i '/snprint(/s//snprintf(/' $1
   9sed -i '/seprint(/s//seprintf(/' $1
  10sed -i 's/[ \t][ \t]*QLock;/    qlock_t qlock;/' $1
  11
  12# spatch can't do this yet -- we've talked to them.
  13sed -i 's/struct ipifc\*,/struct ipifc *unused_ipifc,/' $1
  14sed -i 's/(struct ipifc\*)/(struct ipifc *unused_ipifc)/' $1
  15sed -i 's/ *uint8_t,/ uint8_t unused_uint8_t,/' $1
  16sed -i 's/ *uint8_t\*,/ uint8_t *unused_uint8_p_t,/' $1
  17sed -i 's/ *uint8_t)/ uint8_t unused_uint8_t)/' $1
  18sed -i 's/ *uint8_t\*)/ uint8_t *unused_uint8_p_t)/' $1
  19sed -i 's/ *char\*\([,)]\)/ char *unused_char_p_t\1/' $1
  20sed -i 's/ *char\*\*\([,)]\)/ char **unused_char_pp_t\1/' $1
  21sed -i 's/ *int,/ int unused_int,/' $1
  22sed -i '/USED(.*);/d' $1
  23
  24