diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rwxr-xr-x | bin/ACE-casts-convert | 40 |
2 files changed, 51 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 24930b19884..154b7592cac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Thu Jan 20 01:16:21 2005 Ossama Othman <ossama@dre.vanderbilt.edu> + + * bin/ACE-casts-convert: + + New convenience script that converts all ACE cast macro calls + (e.g. ACE_static_cast (foo, bar)) to their standard C++ + counterparts (e.g. static_cast<foo> (bar)). It is meant as an + aid to help app developers that use the ACE cast macros upgrade + their apps to the standard C++ cast syntax since the ACE cast + macros were deprecated back in ACE 5.4.2. + Wed Jan 19 23:06:14 2005 J.T. Conklin <jtc@acorntoolworks.com> * bin/MakeProjectCreator/config/acelib.mpb: diff --git a/bin/ACE-casts-convert b/bin/ACE-casts-convert new file mode 100755 index 00000000000..09a623675c0 --- /dev/null +++ b/bin/ACE-casts-convert @@ -0,0 +1,40 @@ +#! /bin/sh + +# ============================================================================= +# +# @file ACE-casts-convert +# +# $Id$ +# +# Script to convert all ACE cast macro calls (e.g. +# ACE_static_cast (foo, bar)) to their standard C++ counterparts (e.g. +# static_cast<foo> (bar)). +# +# Use this script at your own risk. It appears to work correctly for +# all cases, but verify the results "just in case". +# +# @author Ossama Othman +# +# ============================================================================= + + +if test "$#" -eq 0; then + echo "Usage: $0 FILE [FILE2] ..." + echo "" + exit 1 +fi + +echo "" +echo "Converting ACE cast macro calls to standard C++ syntax in:" + +while test "$#" -gt 0 +do + arg="$1" + shift + + if grep "ACE_\(static\|dynamic\|const\|reinterpret\)_cast" $arg > /dev/null 2>&1; then + echo $arg + sed -e :a -e 's/ACE_\(const\|static\|reinterpret\|dynamic\)_cast[ \t]*([ \t]*\([^,]*\)[ \t]*,[ \t]*\([^ \t].*\)/\1_cast<\2> (\3/g; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast[ \t]*([ \t]*\([^,]*\)[ \t]*,[ \t]*$/{N;s/\n//;ba;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast[ \t]*(/ba' $arg > ${arg}.new + mv ${arg}.new $arg + fi +done |