Change all Booleans to bool.
c99 provides bool. Declaring Boolean adds some obscurity to the code,
and could also miss out on some machine-specific optimisations.
This patch removes the definition of Boolean, and changes all
instances of it to bool.
If you've come across this commit because it's causing you issues when
rebasing on mainline pcb, then you should find the following script
useful. You can use it to rewrite all of your local commits to use
bool instead of Boolean like so:
git filter-branch --tree-filter rename-bool.sh HEAD...${HASH}
Replacing ${HASH} with the latest commit that's in mainline.
if [ ! -f src/autoplace.c ]
then
echo "This doesn't look like the PCB source directory."
echo "Cowardly exiting to avoid causing misery!"
exit
fi
chg_bool ()
{
FNAME=$1
ADDR=$2
sed -i -e "${ADDR}s/\bBoolean\b/bool/g" "$FNAME"
sed -i -e "${ADDR}s/\bTrue\b/true/g" "$FNAME"
sed -i -e "${ADDR}s/\bFalse\b/false/g" "$FNAME"
}
find -name '*.[ch]' | while read f
do
chg_bool "$f"
done
find -name '*.[yl]' | while read f
do
# Replace first '%%' line with __TMP_MARKER_
sed -i -e '0,/^%%/s/^%%/__TMP_MARKER_/' "$f"
# Replace in section before the first '%%'
chg_bool "$f" "0,/^__TMP_MARKER_/"
# Replace in section after the last '%%'
chg_bool "$f" "/^%%/,$"
# Remove the temporary marker:
sed -i -e 's/^__TMP_MARKER_/%%/' "$f"
done