Converted C++ comments to C comments.

This commit is contained in:
skarg
2008-01-08 21:30:50 +00:00
parent a8dffb5a12
commit e17cb0559e
10 changed files with 2289 additions and 2286 deletions
+9 -6
View File
@@ -1,22 +1,25 @@
#!/bin/sh
#!/bin/bash
# This script converts any C++ comments to C comments
# using the ccmtcnvt tool from the liwc package
CONVERTER=/usr/bin/ccmtcnvt
# silent fail if the tool is not installed
[ -x /usr/bin/ccmtcnvt ] || exit 0
[ -x ${CONVERTER} ] || exit 0
directory=${1-`pwd`}
for filename in $( find ${directory} -name '*.c' )
do
echo Converting ${filename}
/usr/bin/ccmtcnvt ${filename} > /tmp/ccmtcnvt.karg
mv /tmp/ccmtcnvt.karg ${filename}
TEMPFILE="/tmp/ccmtcnvt.$RANDOM.txt"
${CONVERTER} ${filename} > ${TEMPFILE}
mv ${TEMPFILE} ${filename}
done
for filename in $( find ${directory} -name '*.h' )
do
echo Converting ${filename}
/usr/bin/ccmtcnvt ${filename} > /tmp/ccmtcnvt.karg
mv /tmp/ccmtcnvt.karg ${filename}
TEMPFILE="/tmp/ccmtcnvt.$RANDOM.txt"
${CONVERTER} ${filename} > ${TEMPFILE}
mv ${TEMPFILE} ${filename}
done