annotate fix-casts.sh @ 29244:50256289be74

*** Plucked rev 1cd91846f484f7d7090d25b0e65d851a0dadcb90 (e894e488d2219b69664de488ee1af7f275f8817d): Improved handling of the 0x00d charset in AIM, which is sent by mobile devices speaking ISO-8859-1. Try UTF-8 first (the encoding sent by iChat in a Direct IM with non-ASCII characters), then fall back to ISO-8859-1. Fixes #a13544, a bug created with the fix for iChat DIM encoding new in libpurple 2.6.4 applied changes from 6f3a1b3c52803e11d4cda1e0537c1270599e8d8e through ed0a2a35c7e22519df27c50069c22b03e01c027a *** Plucked rev e8ba4281669ae86859fd4e29f5d8ea0286af3903 (f05c54b03e6bbfdbff38c01697fbd353a969e05e): Changelog the AIM/ICQ issue. Refs #10900.
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 07 Jan 2010 23:43:26 +0000
parents c3ca613ab550
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25317
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1 #!/bin/sh
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
2
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
3 if [ $# -eq 0 ]; then
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
4 echo "Usage: `basename "$0"` PurpleFoo..."
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
5 echo
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
6 echo "This script searches the *current working directory* and replaces casts"
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
7 echo "with GObject-style type checking and casting macros."
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
8 echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".'
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
9 exit 0
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
10 fi
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
11
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
12 for struct in $* ; do
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
13 cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"`
25319
c3ca613ab550 Minor fixes to the cast changing script.
Richard Laager <rlaager@wiktel.com>
parents: 25317
diff changeset
14 for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do
c3ca613ab550 Minor fixes to the cast changing script.
Richard Laager <rlaager@wiktel.com>
parents: 25317
diff changeset
15 sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file
c3ca613ab550 Minor fixes to the cast changing script.
Richard Laager <rlaager@wiktel.com>
parents: 25317
diff changeset
16 sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file
25317
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
17 done
d1a4088528ce Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
18 done