Skip to content

Instantly share code, notes, and snippets.

@mittorn
Created January 24, 2021 13:39
Show Gist options
  • Save mittorn/0fb91e4f604ec9830edbb4039126e531 to your computer and use it in GitHub Desktop.
Save mittorn/0fb91e4f604ec9830edbb4039126e531 to your computer and use it in GitHub Desktop.
Fix gcc2/msvc6 server code
f="effects.h *.cpp monsters/*.cpp"
for m in SetThink SetTouch SetUse SetBlocked SetMoveDone; do
m2=`echo $m|sed -e s/Set/Reset/`
sed -e s/$m[[:space:]]\*\([[:space:]]\*/$m\(/g -e s/$m\([[:space:]]\*\\\&/$m\(/g -e s/$m\([[:space:]]\*NULL[[:space:]]\)/$m2\(\)/g -e s/$m\([[:space:]]*/$m\(\ \\\&/g -e s/$m2\(\)/$m\(\ NULL\ \)/g -i $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment