Mercurial > pidgin.yaz
view fix-casts.sh @ 31595:28b328da7269
Pidgin 2.7.9 does not compile on FreeBSD 9-CURRENT because this does not
have utmp.h anymore; see http://wiki.freebsd.org/PortsBrokenOnCurrent
for more details about the change from utmp.h to utmpx.h;
in our case it is enough to delete the line 33 in file
pidgin-2.7.9/libpurple/protocols/zephyr/Zinternal.c
committer: Richard Laager <rlaager@wiktel.com>
author | guru@unixarea.de |
---|---|
date | Mon, 17 Jan 2011 20:21:22 +0000 |
parents | c3ca613ab550 |
children |
line wrap: on
line source
#!/bin/sh if [ $# -eq 0 ]; then echo "Usage: `basename "$0"` PurpleFoo..." echo echo "This script searches the *current working directory* and replaces casts" echo "with GObject-style type checking and casting macros." echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".' exit 0 fi for struct in $* ; do cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"` for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file done done