2013-07-05 22:42:06 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-07-19 12:46:11 +02:00
|
|
|
SED=sed
|
|
|
|
UNAME=`uname`
|
|
|
|
|
|
|
|
if [ "$UNAME" = Darwin ] || [ "$UNAME" = FreeBSD ]; then
|
|
|
|
SED=gsed
|
|
|
|
fi
|
|
|
|
|
2013-07-05 22:42:06 +02:00
|
|
|
cd `dirname "$0"`/../
|
|
|
|
|
|
|
|
for FILE in src/*.cc; do
|
2013-07-19 12:46:11 +02:00
|
|
|
$SED -rne 's/^using (\w+::\w+);$/\1/p' $FILE | sort -c || echo "in $FILE"
|
2013-07-05 22:42:06 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
for FILE in src/*.cc; do
|
2013-07-19 12:46:11 +02:00
|
|
|
for IMPORT in `$SED -rne 's/^using (\w+)::(\w+);$/\2/p' $FILE`; do
|
|
|
|
if ! $SED -re '/^using (\w+)::(\w+);$/d' $FILE | grep -q "$IMPORT"; then
|
2013-07-05 22:42:06 +02:00
|
|
|
echo "$IMPORT unused in $FILE"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|