From: Nathanael Nerode Date: Mon, 28 Jul 2003 02:15:25 +0000 (+0000) Subject: fixinc.svr4: Remove dead code. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=447673ded110ce946a3c46f363052a832b740fc8;p=gcc.git fixinc.svr4: Remove dead code. * fixinc/fixinc.svr4: Remove dead code. Remove now-unnecessary cleanup of junk after #else and #endif directives. Collapse repeated clauses into for statment. * fixinc/fixincl.sh: GNU C -> GCC. Add usage comment. From-SVN: r69870 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42fe2f85ade..cc7e60ae904 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-07-27 Nathanael Nerode + + * fixinc/fixinc.svr4: Remove dead code. Remove now-unnecessary + cleanup of junk after #else and #endif directives. Collapse repeated + clauses into for statment. + + * fixinc/fixincl.sh: GNU C -> GCC. Add usage comment. + 2003-07-27 Zack Weinberg * c-decl.c (struct c_scope): Remove keep_if_subblocks field. diff --git a/gcc/fixinc/fixinc.svr4 b/gcc/fixinc/fixinc.svr4 index 88972f01a13..759a08e58ab 100755 --- a/gcc/fixinc/fixinc.svr4 +++ b/gcc/fixinc/fixinc.svr4 @@ -167,28 +167,9 @@ while [ $# != 0 ]; do chmod +w $2/$file chmod a+r $2/$file -# The following have been removed from the sed command below -# because it is more useful to leave these things in. -# The only reason to remove them was for -pedantic, -# which isn't much of a reason. -- rms. -# /^[ ]*#[ ]*ident/d - -# This code makes Solaris SCSI fail, because it changes the -# alignment within some critical structures. See . -# s/u_char\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/ -# Disable these also, since they probably aren't safe either. -# s/u_short\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/ -# s/ushort\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/ -# s/evcm_t\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/ -# s/Pbyte\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*SEQSIZ\)/unsigned int\1/ - # The change of u_char, etc, to u_int # applies to bit fields. sed -e ' - s%^\([ ]*#[ ]*else\)[ ]*/[^*].*%\1% - s%^\([ ]*#[ ]*else\)[ ]*[^/ ].*%\1% - s%^\([ ]*#[ ]*endif\)[ ]*/[^*].*%\1% - s%^\([ ]*#[ ]*endif\)[ ]*[^/ ].*%\1% s/#lint(on)/defined(lint)/g s/#lint(off)/!defined(lint)/g s/#machine(\([^)]*\))/defined(__\1__)/g @@ -801,211 +782,17 @@ if [ \! -z "$file_to_fix" ]; then fi # Conditionalize all of on _KERNEL being defined. - -file=fs/rfs/rf_cache.h -base=`basename $file`.$$ -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - # Conditionalize all of on _KERNEL being defined. - -file=sys/erec.h -base=`basename $file`.$$ -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - # Conditionalize all of on _KERNEL being defined. - -file=sys/err.h -base=`basename $file`.$$ -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - # Conditionalize all of on _KERNEL being defined. - -file=sys/char.h -base=`basename $file`.$$ -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - # Conditionalize all of on _KERNEL being defined. - -file=sys/getpages.h -base=`basename $file`.$$ -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - # Conditionalize all of on _KERNEL being defined. - -file=sys/map.h -base=`basename $file`.$$ -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - # Conditionalize all of on _KERNEL being defined. - -file=sys/cmn_err.h -base=`basename $file`.$$ -if [ -r ${LIB}/$file ]; then - file_to_fix=${LIB}/$file -else - if [ -r ${INPUT}/$file ]; then - file_to_fix=${INPUT}/$file - else - file_to_fix="" - fi -fi -if [ \! -z "$file_to_fix" ]; then - echo Checking $file_to_fix - if grep _KERNEL $file_to_fix > /dev/null; then - true - else - echo '#ifdef _KERNEL' > /tmp/$base - cat $file_to_fix >> /tmp/$base - echo '#endif /* defined(_KERNEL) */' >> /tmp/$base - echo Fixed $file_to_fix - rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file - chmod a+r ${LIB}/$file - rm -f /tmp/$base - fi -fi - # Conditionalize all of on _KERNEL being defined. -file=sys/kdebugger.h +for file in fs/rfs/rf_cache.h sys/erec.h sys/err.h sys/char.h \ + sys/getpages.h sys/map.h sys/cmn_err.h sys/kdebugger.h ; do + base=`basename $file`.$$ if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$file @@ -1032,36 +819,7 @@ if [ \! -z "$file_to_fix" ]; then fi fi -# Conditionalize some of on _KERNEL being defined. -# This has been taken out because it breaks on some versions of -# DYNIX/ptx, and it does not seem to do much good on any system. -# file=netinet/in.h -# base=`basename $file`.$$ -# if [ -r ${LIB}/$file ]; then -# file_to_fix=${LIB}/$file -# else -# if [ -r ${INPUT}/$file ]; then -# file_to_fix=${INPUT}/$file -# else -# file_to_fix="" -# fi -# fi -# if [ \! -z "$file_to_fix" ]; then -# echo Checking $file_to_fix -# if grep _KERNEL $file_to_fix > /dev/null; then -# true -# else -# sed -e '/#ifdef INKERNEL/i\ -# #ifdef _KERNEL -# ' \ -# -e '/#endif[ ]*\/\* INKERNEL \*\//a\ -# #endif /* _KERNEL */ -# ' \ -# $file_to_fix > ${LIB}/${file}.sed -# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file -# echo Fixed $file_to_fix -# fi -# fi +done # Conditionalize some of on __GNUC__ and __GNUG__. @@ -1094,32 +852,6 @@ if [ \! -z "$file_to_fix" ]; then fi fi -# Commented out because tmcconne@sedona.intel.com says we don't clearly need it -# and the text in types.h is not erroneous. -## In sys/types.h, don't name the enum for booleans. -# -#file=sys/types.h -#base=`basename $file`.$$ -#if [ -r ${LIB}/$file ]; then -# file_to_fix=${LIB}/$file -#else -# if [ -r ${INPUT}/$file ]; then -# file_to_fix=${INPUT}/$file -# else -# file_to_fix="" -# fi -#fi -#if [ \! -z "$file_to_fix" ]; then -# echo Checking $file_to_fix -# if grep "enum boolean" $file_to_fix > /dev/null; then -# sed -e 's/enum boolean/enum/' ${LIB}/$file > ${LIB}/${file}.sed -# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file -# echo Fixed $file_to_fix -# else -# true -# fi -#fi - # Remove useless extern keyword from struct forward declarations in # and diff --git a/gcc/fixinc/fixincl.sh b/gcc/fixinc/fixincl.sh index de56e615e63..80a77971818 100755 --- a/gcc/fixinc/fixincl.sh +++ b/gcc/fixinc/fixincl.sh @@ -2,7 +2,7 @@ # # Install modified versions of certain ANSI-incompatible system header # files which are fixed to work correctly with ANSI C and placed in a -# directory that GNU C will search. +# directory that GCC will search. # # See README-fixinc for more information. # @@ -27,6 +27,8 @@ # Boston, MA 02111-1307, USA. # # # # # # # # # # # # # # # # # # # # # # + +# Usage: fixincl.sh output-dir input-dir # # Directory in which to store the results. # Fail if no arg to specify a directory for the output.