~vish/ubuntu/maverick/pidgin/bug25979

« back to all changes in this revision

Viewing changes to fix-casts.sh

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-10-09 19:40:26 UTC
  • mfrom: (1.4.1 upstream) (46.1.10 karmic)
  • Revision ID: james.westby@ubuntu.com-20091009194026-wbqqh0bsbz19nx5q
Tags: 1:2.6.2-1ubuntu7
* Don't stick the buddy list window to all desktops as some
  window managers have trouble to properly unstick it (LP: #346840)
  - debian/patches/11_buddy_list_really_show.patch
* Always use default tray icon size on KDE (LP: #209440)
  - debian/patches/62_tray_icon_size_kde.patch
* Use scrollbars in the preferences dialog if the screen height is
  below 700 px instead of 600 px
  - debian/patches/60_1024x600_gtkprefs.c.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
if [ $# -eq 0 ]; then
 
4
        echo "Usage: `basename "$0"` PurpleFoo..."
 
5
        echo
 
6
        echo "This script searches the *current working directory* and replaces casts"
 
7
        echo "with GObject-style type checking and casting macros."
 
8
        echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".'
 
9
        exit 0
 
10
fi
 
11
 
 
12
for struct in $* ; do
 
13
        cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"`
 
14
        for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do
 
15
                sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file
 
16
                sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file
 
17
        done
 
18
done