blob: 01242e0d9c2b1f0eeb61c757e2374825bc713caa [file] [log] [blame] [edit]
#!/bin/sh
sed -i 's/nil/NULL/g' $1
sed -i 's/KERN_WAIT/KMALLOC_WAIT/g' $1
sed -i 's/nelem/ARRAY_SIZE/g' $1
# stuff I'm not smart enough to do with spatch
sed -i '/strcpy.*(\(.*\),\(.*\));/s//strncpy(\1, \2, sizeof(\1));/' $1
sed -i '/snprint(/s//snprintf(/' $1
sed -i '/seprint(/s//seprintf(/' $1
sed -i 's/[ \t][ \t]*QLock;/ qlock_t qlock;/' $1
# spatch can't do this yet -- we've talked to them.
sed -i 's/struct ipifc\*,/struct ipifc *unused_ipifc,/' $1
sed -i 's/(struct ipifc\*)/(struct ipifc *unused_ipifc)/' $1
sed -i 's/ *uint8_t,/ uint8_t unused_uint8_t,/' $1
sed -i 's/ *uint8_t\*,/ uint8_t *unused_uint8_p_t,/' $1
sed -i 's/ *uint8_t)/ uint8_t unused_uint8_t)/' $1
sed -i 's/ *uint8_t\*)/ uint8_t *unused_uint8_p_t)/' $1
sed -i 's/ *char\*\([,)]\)/ char *unused_char_p_t\1/' $1
sed -i 's/ *char\*\*\([,)]\)/ char **unused_char_pp_t\1/' $1
sed -i 's/ *int,/ int unused_int,/' $1
sed -i '/USED(.*);/d' $1