+
+1999-12-29 Bruce Korb <autogen@linuxbox.com>
+
+ * fixinc/fixincl.c(wait_for_pid): sometimes a WSTOPSIG of zero is OK
+ * fixinc/fixincl.tpl(<hack>TEST_CT): Just do the existence test once
+ (<hack>_RE_CT): not needed
+ * fixinc/fixlib.c(is_cxx_header): moved from fixtests.c
+ rewritten to scan the file text once only
+ "template<..." test added
+ * fixinc/fixlib.h(apply_fix_p_t): moved from fixtests.c
+ (is_cxx_header): declaration added
+ * fixinc/fixtests.c(is_cxx_header): removed
+ (apply_fix_p_t): removed
+ (double_slash_test): is_cxx_header is only called once now
+ * fixinc/hackshell.tpl: indexing the fixes is now done under DEBUG
+ * fixinc/inclhack.def(FIXINC_DEBUG): added for testing DEBUG state
+ within the templates.
+ The borken spelling of "broken" was fixed.
+ * fixinc/inclhack.tpl: The $VERBOSE level is used on various messages
+ The default level depends on FIXINC_DEBUG.
+
1999-12-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* crtstuff.c: If !inhibit_libc, include stdlib.h/unistd.h.
{
if (! WIFEXITED( status ))
{
- if (NOT_SILENT)
- fprintf (stderr, "child process %d is hung on signal %d\n",
- child, WSTOPSIG( status ));
+ if (WSTOPSIG( status ) == 0)
+ break;
+
+ fprintf (stderr, "child process %d is hung on signal %d\n",
+ child, WSTOPSIG( status ));
exit (EXIT_FAILURE);
}
if (WEXITSTATUS( status ) != 0)
{
- if (NOT_SILENT)
- fprintf (stderr, "child process %d exited with status %d\n",
- child, WEXITSTATUS( status ));
+ fprintf (stderr, "child process %d exited with status %d\n",
+ child, WEXITSTATUS( status ));
exit (EXIT_FAILURE);
}
break; /* normal child completion */
# Directory in which to store the results.
# Fail if no arg to specify a directory for the output.
if [ "x$1" = "x" ]
-then echo fixincludes: no output directory specified
-exit 1
+then
+ echo fixincludes: no output directory specified
+ exit 1
fi
LIB=${1}
}
fi
+if test -z "$VERBOSE"
+then
+ VERBOSE=2
+ export VERBOSE
+else
+ case "$VERBOSE" in
+ [0-9] ) : ;;
+ * ) VERBOSE=3 ;;
+ esac
+fi
+
# Define what target system we're fixing.
#
if test -r ./Makefile; then
;;
esac
-echo Fixing headers into ${LIB} for ${target_canonical} target
+if test $VERBOSE -gt 0
+then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi
# Determine whether this system has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
#
# # # # # # # # # # # # # # # # # # # # #
#
-echo Finding directories and links to directories
+if test $VERBOSE -gt 1
+then echo Finding directories and links to directories ; fi
# Find all directories and all symlinks that point to directories.
# Put the list in $all_dirs.
newdirs=
for d in $dirs
do
- echo " Searching $INPUT/$d"
+ if test $VERBOSE -gt 1
+ then echo " Searching $INPUT/$d" ; fi
# Find all directories under $d, relative to $d, excluding $d itself.
# (The /. is needed after $d in case $d is a symlink.)
# # # # # # # # # # # # # # # # # # # # #
#
dirs=
-echo "All directories (including links to directories):"
-echo $all_dirs
+if test $VERBOSE -gt 2
+then echo "All directories (including links to directories):"
+ echo $all_dirs
+fi
for file in $all_dirs; do
rm -rf $LIB/$file
treetops=". ${LIB}"
if $LINKS; then
- echo 'Making symbolic directory links'
+ if test $VERBOSE -gt 1
+ then echo 'Making symbolic directory links' ; fi
cwd=`${PWDCMD}`
for sym_link in $search_dirs; do
# If a link points to ., make a similar link to .
#
if [ ${full_dest_dir} = ${cinput} ]; then
- echo ${sym_link} '->' . ': Making self link'
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' . ': Making self link' ; fi
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
# DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
dots=`echo "${sym_link}" |
sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
- echo ${sym_link} '->' $dots$y ': Making local link'
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' $dots$y ': Making local link' ; fi
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
# and process $target into ${INPUT}/root$target
# treat this directory as if it actually contained the files.
#
- echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
+ fi
if [ -d $LIB/root${full_dest_dir} ]
then true
else
${sym_link}/*)
dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
sed -n "s|^${sym_link}/||p"`
- echo "Duplicating ${sym_link}'s ${dupdir}"
+ if test $VERBOSE -gt 2
+ then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi
if [ -d ${dupdir} ]
then true
else
then continue ; fi
touch ${DESTDIR}/DONE
- echo Fixing directory ${SRCDIR} into ${DESTDIR}
+ if test $VERBOSE -gt 1
+ then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi
# Check files which are symlinks as well as those which are files.
#
cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
chmod +w $3 2>/dev/null
chmod a+r $3 2>/dev/null
- echo Copied $2
+ if test $VERBOSE -gt 2
+ then echo Copied $2 ; fi
for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 |
sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
do
shift
done
-echo 'Cleaning up DONE files.'
+if test $VERBOSE -gt 2
+then echo 'Cleaning up DONE files.' ; fi
cd $LIB
find . -name DONE -exec rm -f '{}' ';'
-echo 'Removing unneeded directories:'
+if test $VERBOSE -gt 1
+then echo 'Cleaning up unneeded directories:' ; fi
cd $LIB
all_dirs=`find . -type d \! -name '.' -print | sort -r`
for file in $all_dirs; do
rmdir $LIB/$file > /dev/null 2>&1
done
+if test $VERBOSE -gt 0
+then echo fixincludes is done ; fi
+
# # # # # # # # # # # # # # # # # # # # #
#
# End of for INPUT directories
#define [=hackname _up =]_TEST_CT [=
_IF exesel _exist =][=
_eval exesel _count
- bypass _count +
- test _count +
- c_test _count + =][=
+ bypass _count +
+ test _count +
+ c_test _count +
+ "ct=%d ; re_ct=`expr $ct + $re_ct` ; echo $ct"
+ _printf _shell =][=
_ELSE =][=
_eval select _count
- bypass _count +
- test _count +
- c_test _count + =][=
- _ENDIF =]
-#define [=hackname _up =]_RE_CT [=
- _IF exesel _exist =][=
- _eval exesel _count bypass _count
- "#2$ct=`expr %d + %d` ; re_ct=`expr $ct + $re_ct` ; echo $ct"
- _printf _shell =][=
- _ELSE =][=
- _eval select _count bypass _count
- "#2$ct=`expr %d + %d` ; re_ct=`expr $ct + $re_ct` ; echo $ct"
- _printf _shell =][=
+ bypass _count +
+ test _count +
+ c_test _count +
+ "ct=%d ; re_ct=`expr $ct + $re_ct` ; echo $ct"
+ _printf _shell =][=
_ENDIF =]
tTestDesc a[=hackname _cap=]Tests[] = {[=
_ENDIF =] };[=
_ELSE =]
#define [=hackname _up=]_TEST_CT 0
-#define [=hackname _up=]_RE_CT 0
#define a[=hackname _cap=]Tests (tTestDesc*)NULL[=
_ENDIF =]
"These definitions are for HP Internal developers";
#define AAA_KI_IFACE_TEST_CT 1
-#define AAA_KI_IFACE_RE_CT 1
tTestDesc aAaa_Ki_IfaceTests[] = {
{ TT_EGREP, zAaa_Ki_IfaceSelect0, (regex_t*)NULL }, };
"11.00 HP-UX LP64";
#define AAA_KI_TEST_CT 1
-#define AAA_KI_RE_CT 1
tTestDesc aAaa_KiTests[] = {
{ TT_EGREP, zAaa_KiSelect0, (regex_t*)NULL }, };
"kthread_create_caller_t";
#define AAA_KI_CALLS_TEST_CT 1
-#define AAA_KI_CALLS_RE_CT 1
tTestDesc aAaa_Ki_CallsTests[] = {
{ TT_EGREP, zAaa_Ki_CallsSelect0, (regex_t*)NULL }, };
"Kernel Instrumentation Definitions";
#define AAA_KI_DEFS_TEST_CT 1
-#define AAA_KI_DEFS_RE_CT 1
tTestDesc aAaa_Ki_DefsTests[] = {
{ TT_EGREP, zAaa_Ki_DefsSelect0, (regex_t*)NULL }, };
*/
#define apzAaa_Bad_FixesMachs (const char**)NULL
#define AAA_BAD_FIXES_TEST_CT 0
-#define AAA_BAD_FIXES_RE_CT 0
#define aAaa_Bad_FixesTests (tTestDesc*)NULL
/*
"11.0 and later representation of ki time";
#define AAA_TIME_TEST_CT 1
-#define AAA_TIME_RE_CT 1
tTestDesc aAaa_TimeTests[] = {
{ TT_EGREP, zAaa_TimeSelect0, (regex_t*)NULL }, };
*/
#define apzAab_Dgux_Int_VarargsMachs (const char**)NULL
#define AAB_DGUX_INT_VARARGS_TEST_CT 0
-#define AAB_DGUX_INT_VARARGS_RE_CT 0
#define aAab_Dgux_Int_VarargsTests (tTestDesc*)NULL
/*
"} while";
#define AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT 1
-#define AAB_FD_ZERO_ASM_POSIX_TYPES_H_RE_CT 1
tTestDesc aAab_Fd_Zero_Asm_Posix_Types_HTests[] = {
{ TT_NEGREP, zAab_Fd_Zero_Asm_Posix_Types_HBypass0, (regex_t*)NULL }, };
"i[34567]86-*-linux-gnu*",
(const char*)NULL };
#define AAB_FD_ZERO_GNU_TYPES_H_TEST_CT 0
-#define AAB_FD_ZERO_GNU_TYPES_H_RE_CT 0
#define aAab_Fd_Zero_Gnu_Types_HTests (tTestDesc*)NULL
/*
"i[34567]86-*-linux-gnu*",
(const char*)NULL };
#define AAB_FD_ZERO_SELECTBITS_H_TEST_CT 0
-#define AAB_FD_ZERO_SELECTBITS_H_RE_CT 0
#define aAab_Fd_Zero_Selectbits_HTests (tTestDesc*)NULL
/*
"sparc-*-solaris2.[0-4]",
(const char*)NULL };
#define AAB_SVR4_REPLACE_BYTEORDER_TEST_CT 0
-#define AAB_SVR4_REPLACE_BYTEORDER_RE_CT 0
#define aAab_Svr4_Replace_ByteorderTests (tTestDesc*)NULL
/*
"bos325,";
#define AIX_SYSWAIT_TEST_CT 1
-#define AIX_SYSWAIT_RE_CT 1
tTestDesc aAix_SyswaitTests[] = {
{ TT_EGREP, zAix_SyswaitSelect0, (regex_t*)NULL }, };
"typedef volatile int sig_atomic_t";
#define AIX_VOLATILE_TEST_CT 1
-#define AIX_VOLATILE_RE_CT 1
tTestDesc aAix_VolatileTests[] = {
{ TT_EGREP, zAix_VolatileSelect0, (regex_t*)NULL }, };
"getopt\\(int, char \\*\\[";
#define ALPHA_GETOPT_TEST_CT 1
-#define ALPHA_GETOPT_RE_CT 1
tTestDesc aAlpha_GetoptTests[] = {
{ TT_EGREP, zAlpha_GetoptSelect0, (regex_t*)NULL }, };
"#ifndef\\(__mips64\\)";
#define ALPHA_PARENS_TEST_CT 1
-#define ALPHA_PARENS_RE_CT 1
tTestDesc aAlpha_ParensTests[] = {
{ TT_EGREP, zAlpha_ParensSelect0, (regex_t*)NULL }, };
"char[ \t]*\\*[\t ]*sbrk[ \t]*\\(";
#define ALPHA_SBRK_TEST_CT 1
-#define ALPHA_SBRK_RE_CT 1
tTestDesc aAlpha_SbrkTests[] = {
{ TT_EGREP, zAlpha_SbrkSelect0, (regex_t*)NULL }, };
"___type p_type";
#define ARM_NORCROFT_HINT_TEST_CT 1
-#define ARM_NORCROFT_HINT_RE_CT 1
tTestDesc aArm_Norcroft_HintTests[] = {
{ TT_EGREP, zArm_Norcroft_HintSelect0, (regex_t*)NULL }, };
"#[ \t]*define[ \t]*__wchar_t";
#define ARM_WCHAR_TEST_CT 1
-#define ARM_WCHAR_RE_CT 1
tTestDesc aArm_WcharTests[] = {
{ TT_EGREP, zArm_WcharSelect0, (regex_t*)NULL }, };
"#ifndef NOINLINE";
#define AUX_ASM_TEST_CT 1
-#define AUX_ASM_RE_CT 1
tTestDesc aAux_AsmTests[] = {
{ TT_EGREP, zAux_AsmSelect0, (regex_t*)NULL }, };
*/
#define apzAvoid_BoolMachs (const char**)NULL
#define AVOID_BOOL_TEST_CT 0
-#define AVOID_BOOL_RE_CT 0
#define aAvoid_BoolTests (tTestDesc*)NULL
/*
"^[ \t]*typedef[ \t]+struct[ \t]+term[ \t]*;";
#define BAD_STRUCT_TERM_TEST_CT 1
-#define BAD_STRUCT_TERM_RE_CT 1
tTestDesc aBad_Struct_TermTests[] = {
{ TT_EGREP, zBad_Struct_TermSelect0, (regex_t*)NULL }, };
*/
#define apzBadquoteMachs (const char**)NULL
#define BADQUOTE_TEST_CT 0
-#define BADQUOTE_RE_CT 0
#define aBadquoteTests (tTestDesc*)NULL
/*
"^[ \t]*#[ \t]*pragma[ \t][ \t]*extern_prefix";
#define BAD_LVAL_TEST_CT 1
-#define BAD_LVAL_RE_CT 1
tTestDesc aBad_LvalTests[] = {
{ TT_EGREP, zBad_LvalSelect0, (regex_t*)NULL }, };
"include.*stdio.h";
#define BROKEN_ASSERT_STDIO_TEST_CT 2
-#define BROKEN_ASSERT_STDIO_RE_CT 2
tTestDesc aBroken_Assert_StdioTests[] = {
{ TT_NEGREP, zBroken_Assert_StdioBypass0, (regex_t*)NULL },
{ TT_EGREP, zBroken_Assert_StdioSelect0, (regex_t*)NULL }, };
"include.*stdlib.h";
#define BROKEN_ASSERT_STDLIB_TEST_CT 2
-#define BROKEN_ASSERT_STDLIB_RE_CT 2
tTestDesc aBroken_Assert_StdlibTests[] = {
{ TT_NEGREP, zBroken_Assert_StdlibBypass0, (regex_t*)NULL },
{ TT_EGREP, zBroken_Assert_StdlibSelect0, (regex_t*)NULL }, };
"BSD43__IO";
#define BSD43_IO_MACROS_TEST_CT 1
-#define BSD43_IO_MACROS_RE_CT 1
tTestDesc aBsd43_Io_MacrosTests[] = {
{ TT_EGREP, zBsd43_Io_MacrosSelect0, (regex_t*)NULL }, };
*/
#define apzDec_Intern_AsmMachs (const char**)NULL
#define DEC_INTERN_ASM_TEST_CT 0
-#define DEC_INTERN_ASM_RE_CT 0
#define aDec_Intern_AsmTests (tTestDesc*)NULL
/*
tSCC zNo_Double_SlashFTst0[] = "double_slash";
#define NO_DOUBLE_SLASH_TEST_CT 1
-#define NO_DOUBLE_SLASH_RE_CT 0
tTestDesc aNo_Double_SlashTests[] = {
{ TT_FUNCTION, zNo_Double_SlashFTst0, 0 /* unused */ }, };
*/
#define apzEcd_CursorMachs (const char**)NULL
#define ECD_CURSOR_TEST_CT 0
-#define ECD_CURSOR_RE_CT 0
#define aEcd_CursorTests (tTestDesc*)NULL
/*
"i*86-*-sco3.2v5*",
(const char*)NULL };
#define SCO5_STAT_WRAPPERS_TEST_CT 0
-#define SCO5_STAT_WRAPPERS_RE_CT 0
#define aSco5_Stat_WrappersTests (tTestDesc*)NULL
/*
tSCC zEnd_Else_LabelFTst0[] = "else_endif_label";
#define END_ELSE_LABEL_TEST_CT 1
-#define END_ELSE_LABEL_RE_CT 0
tTestDesc aEnd_Else_LabelTests[] = {
{ TT_FUNCTION, zEnd_Else_LabelFTst0, 0 /* unused */ }, };
"include.*\"\\.\\./machine/";
#define HP_INLINE_TEST_CT 1
-#define HP_INLINE_RE_CT 1
tTestDesc aHp_InlineTests[] = {
{ TT_EGREP, zHp_InlineSelect0, (regex_t*)NULL }, };
"HPUX_SOURCE";
#define HP_SYSFILE_TEST_CT 1
-#define HP_SYSFILE_RE_CT 1
tTestDesc aHp_SysfileTests[] = {
{ TT_EGREP, zHp_SysfileSelect0, (regex_t*)NULL }, };
"\"C\"|__BEGIN_DECLS";
#define CXX_UNREADY_TEST_CT 1
-#define CXX_UNREADY_RE_CT 1
tTestDesc aCxx_UnreadyTests[] = {
{ TT_NEGREP, zCxx_UnreadyBypass0, (regex_t*)NULL }, };
*/
#define apzHpux_MaxintMachs (const char**)NULL
#define HPUX_MAXINT_TEST_CT 0
-#define HPUX_MAXINT_RE_CT 0
#define aHpux_MaxintTests (tTestDesc*)NULL
/*
"^extern struct sigevent;";
#define HPUX_SYSTIME_TEST_CT 1
-#define HPUX_SYSTIME_RE_CT 1
tTestDesc aHpux_SystimeTests[] = {
{ TT_EGREP, zHpux_SystimeSelect0, (regex_t*)NULL }, };
"inline";
#define HPUX8_BOGUS_INLINES_TEST_CT 1
-#define HPUX8_BOGUS_INLINES_RE_CT 1
tTestDesc aHpux8_Bogus_InlinesTests[] = {
{ TT_EGREP, zHpux8_Bogus_InlinesSelect0, (regex_t*)NULL }, };
"^#define UINT32_C\\(__c\\)[ \t]*__CONCAT__\\(__CONCAT_U__\\(__c\\),l\\)";
#define HPUX11_UINT32_C_TEST_CT 1
-#define HPUX11_UINT32_C_RE_CT 1
tTestDesc aHpux11_Uint32_CTests[] = {
{ TT_EGREP, zHpux11_Uint32_CSelect0, (regex_t*)NULL }, };
" -n \"`grep _POSIX_VERSION /usr/include/sys/unistd.h`\"";
#define INTERACTV_ADD1_TEST_CT 2
-#define INTERACTV_ADD1_RE_CT 0
tTestDesc aInteractv_Add1Tests[] = {
{ TT_TEST, zInteractv_Add1Test0, 0 /* unused */ },
{ TT_TEST, zInteractv_Add1Test1, 0 /* unused */ }, };
" -n \"`grep _POSIX_VERSION /usr/include/sys/unistd.h`\"";
#define INTERACTV_ADD2_TEST_CT 2
-#define INTERACTV_ADD2_RE_CT 0
tTestDesc aInteractv_Add2Tests[] = {
{ TT_TEST, zInteractv_Add2Test0, 0 /* unused */ },
{ TT_TEST, zInteractv_Add2Test1, 0 /* unused */ }, };
" -n \"`grep _POSIX_VERSION /usr/include/sys/unistd.h`\"";
#define INTERACTV_ADD3_TEST_CT 2
-#define INTERACTV_ADD3_RE_CT 0
tTestDesc aInteractv_Add3Tests[] = {
{ TT_TEST, zInteractv_Add3Test0, 0 /* unused */ },
{ TT_TEST, zInteractv_Add3Test1, 0 /* unused */ }, };
"[ \t]*[ \t](_|DES)IO[A-Z]*[ \t]*\\( *[^,']";
#define IO_DEF_QUOTES_TEST_CT 1
-#define IO_DEF_QUOTES_RE_CT 1
tTestDesc aIo_Def_QuotesTests[] = {
{ TT_EGREP, zIo_Def_QuotesSelect0, (regex_t*)NULL }, };
"CTRL[ \t]*\\(";
#define IOCTL_FIX_CTRL_TEST_CT 1
-#define IOCTL_FIX_CTRL_RE_CT 1
tTestDesc aIoctl_Fix_CtrlTests[] = {
{ TT_EGREP, zIoctl_Fix_CtrlSelect0, (regex_t*)NULL }, };
"}$";
#define IP_MISSING_SEMI_TEST_CT 1
-#define IP_MISSING_SEMI_RE_CT 1
tTestDesc aIp_Missing_SemiTests[] = {
{ TT_EGREP, zIp_Missing_SemiSelect0, (regex_t*)NULL }, };
*/
#define apzIrix_Multiline_CmntMachs (const char**)NULL
#define IRIX_MULTILINE_CMNT_TEST_CT 0
-#define IRIX_MULTILINE_CMNT_RE_CT 0
#define aIrix_Multiline_CmntTests (tTestDesc*)NULL
/*
"authdes_create.*struct sockaddr";
#define IRIX_SOCKADDR_TEST_CT 1
-#define IRIX_SOCKADDR_RE_CT 1
tTestDesc aIrix_SockaddrTests[] = {
{ TT_EGREP, zIrix_SockaddrSelect0, (regex_t*)NULL }, };
*/
#define apzIrix_Struct__FileMachs (const char**)NULL
#define IRIX_STRUCT__FILE_TEST_CT 0
-#define IRIX_STRUCT__FILE_RE_CT 0
#define aIrix_Struct__FileTests (tTestDesc*)NULL
/*
"^[ \t]*#.*[Ww]e're";
#define IRIX_ASM_APOSTROPHE_TEST_CT 1
-#define IRIX_ASM_APOSTROPHE_RE_CT 1
tTestDesc aIrix_Asm_ApostropheTests[] = {
{ TT_EGREP, zIrix_Asm_ApostropheSelect0, (regex_t*)NULL }, };
"fmod\\(double\\)";
#define ISC_FMOD_TEST_CT 1
-#define ISC_FMOD_RE_CT 1
tTestDesc aIsc_FmodTests[] = {
{ TT_EGREP, zIsc_FmodSelect0, (regex_t*)NULL }, };
"m68k-motorola-sysv*",
(const char*)NULL };
#define MOTOROLA_NESTED_TEST_CT 0
-#define MOTOROLA_NESTED_RE_CT 0
#define aMotorola_NestedTests (tTestDesc*)NULL
/*
"CHILD_MAX";
#define ISC_SYS_LIMITS_TEST_CT 1
-#define ISC_SYS_LIMITS_RE_CT 1
tTestDesc aIsc_Sys_LimitsTests[] = {
{ TT_EGREP, zIsc_Sys_LimitsSelect0, (regex_t*)NULL }, };
"/\\*\\*/";
#define KANDR_CONCAT_TEST_CT 1
-#define KANDR_CONCAT_RE_CT 1
tTestDesc aKandr_ConcatTests[] = {
{ TT_EGREP, zKandr_ConcatSelect0, (regex_t*)NULL }, };
"ifndef[ \t]+FLT_MIN";
#define LIMITS_IFNDEFS_TEST_CT 1
-#define LIMITS_IFNDEFS_RE_CT 1
tTestDesc aLimits_IfndefsTests[] = {
{ TT_NEGREP, zLimits_IfndefsBypass0, (regex_t*)NULL }, };
"#[ \t]*define[ \t]+void[ \t]+int";
#define LYNX_VOID_INT_TEST_CT 1
-#define LYNX_VOID_INT_RE_CT 1
tTestDesc aLynx_Void_IntTests[] = {
{ TT_EGREP, zLynx_Void_IntSelect0, (regex_t*)NULL }, };
"fcntl.*\\(int, int, int\\)";
#define LYNXOS_FCNTL_PROTO_TEST_CT 1
-#define LYNXOS_FCNTL_PROTO_RE_CT 1
tTestDesc aLynxos_Fcntl_ProtoTests[] = {
{ TT_EGREP, zLynxos_Fcntl_ProtoSelect0, (regex_t*)NULL }, };
"m88k-motorola-sysv3*",
(const char*)NULL };
#define M88K_BAD_HYPOT_OPT_TEST_CT 0
-#define M88K_BAD_HYPOT_OPT_RE_CT 0
#define aM88k_Bad_Hypot_OptTests (tTestDesc*)NULL
/*
"#define[ \t]+S_IS[A-Z]*(m)[ \t]";
#define M88K_BAD_S_IF_TEST_CT 1
-#define M88K_BAD_S_IF_RE_CT 1
tTestDesc aM88k_Bad_S_IfTests[] = {
{ TT_EGREP, zM88k_Bad_S_IfSelect0, (regex_t*)NULL }, };
"#ifndef";
#define M88K_MULTI_INCL_TEST_CT 1
-#define M88K_MULTI_INCL_RE_CT 1
tTestDesc aM88k_Multi_InclTests[] = {
{ TT_NEGREP, zM88k_Multi_InclBypass0, (regex_t*)NULL }, };
"^#[ \t]*(if|elif).*[^a-zA-Z0-9_](M32|_*MIPSE[LB]|_*SYSTYPE_[A-Z0-9]|_*[Rr][34]000|_*host_mips|_*i386|_*mips|bsd4|is68k|m[68]8k|mc680|news|ns32000|pdp11|pyr|sel|sony_news|sparc|sun|tahoe|tower|u370|u3b|unix|vax)";
#define MACHINE_NAME_TEST_CT 1
-#define MACHINE_NAME_RE_CT 1
tTestDesc aMachine_NameTests[] = {
{ TT_EGREP, zMachine_NameSelect0, (regex_t*)NULL }, };
"We have a problem when using C++";
#define MATH_EXCEPTION_TEST_CT 2
-#define MATH_EXCEPTION_RE_CT 2
tTestDesc aMath_ExceptionTests[] = {
{ TT_NEGREP, zMath_ExceptionBypass0, (regex_t*)NULL },
{ TT_EGREP, zMath_ExceptionSelect0, (regex_t*)NULL }, };
"define[ \t]*DBL_MAX";
#define MATH_HUGE_VAL_FROM_DBL_MAX_TEST_CT 2
-#define MATH_HUGE_VAL_FROM_DBL_MAX_RE_CT 2
tTestDesc aMath_Huge_Val_From_Dbl_MaxTests[] = {
{ TT_NEGREP, zMath_Huge_Val_From_Dbl_MaxBypass0, (regex_t*)NULL },
{ TT_EGREP, zMath_Huge_Val_From_Dbl_MaxSelect0, (regex_t*)NULL }, };
"define[ \t]*HUGE_VAL";
#define MATH_HUGE_VAL_IFNDEF_TEST_CT 1
-#define MATH_HUGE_VAL_IFNDEF_RE_CT 1
tTestDesc aMath_Huge_Val_IfndefTests[] = {
{ TT_EGREP, zMath_Huge_Val_IfndefSelect0, (regex_t*)NULL }, };
*/
#define apzNested_CommentMachs (const char**)NULL
#define NESTED_COMMENT_TEST_CT 0
-#define NESTED_COMMENT_RE_CT 0
#define aNested_CommentTests (tTestDesc*)NULL
/*
"#include <stdlib.h>";
#define NEWS_OS_RECURSION_TEST_CT 1
-#define NEWS_OS_RECURSION_RE_CT 1
tTestDesc aNews_Os_RecursionTests[] = {
{ TT_EGREP, zNews_Os_RecursionSelect0, (regex_t*)NULL }, };
"^extern.*double.*__const__.*";
#define NEXT_MATH_PREFIX_TEST_CT 1
-#define NEXT_MATH_PREFIX_RE_CT 1
tTestDesc aNext_Math_PrefixTests[] = {
{ TT_EGREP, zNext_Math_PrefixSelect0, (regex_t*)NULL }, };
"template";
#define NEXT_TEMPLATE_TEST_CT 1
-#define NEXT_TEMPLATE_RE_CT 1
tTestDesc aNext_TemplateTests[] = {
{ TT_EGREP, zNext_TemplateSelect0, (regex_t*)NULL }, };
"volatile";
#define NEXT_VOLITILE_TEST_CT 1
-#define NEXT_VOLITILE_RE_CT 1
tTestDesc aNext_VolitileTests[] = {
{ TT_EGREP, zNext_VolitileSelect0, (regex_t*)NULL }, };
"wait\\(union wait";
#define NEXT_WAIT_UNION_TEST_CT 1
-#define NEXT_WAIT_UNION_RE_CT 1
tTestDesc aNext_Wait_UnionTests[] = {
{ TT_EGREP, zNext_Wait_UnionSelect0, (regex_t*)NULL }, };
*/
#define apzNodeent_SyntaxMachs (const char**)NULL
#define NODEENT_SYNTAX_TEST_CT 0
-#define NODEENT_SYNTAX_RE_CT 0
#define aNodeent_SyntaxTests (tTestDesc*)NULL
/*
" -z \"`grep __regex_t regex.h`\"";
#define OSF_NAMESPACE_A_TEST_CT 4
-#define OSF_NAMESPACE_A_RE_CT 0
tTestDesc aOsf_Namespace_ATests[] = {
{ TT_TEST, zOsf_Namespace_ATest0, 0 /* unused */ },
{ TT_TEST, zOsf_Namespace_ATest1, 0 /* unused */ },
" -z \"`grep __regex_t regex.h`\"";
#define OSF_NAMESPACE_B_TEST_CT 4
-#define OSF_NAMESPACE_B_RE_CT 0
tTestDesc aOsf_Namespace_BTests[] = {
{ TT_TEST, zOsf_Namespace_BTest0, 0 /* unused */ },
{ TT_TEST, zOsf_Namespace_BTest1, 0 /* unused */ },
"^int __page_size";
#define PTHREAD_PAGE_SIZE_TEST_CT 1
-#define PTHREAD_PAGE_SIZE_RE_CT 1
tTestDesc aPthread_Page_SizeTests[] = {
{ TT_EGREP, zPthread_Page_SizeSelect0, (regex_t*)NULL }, };
"extern int\t.*, fread\\(\\), fwrite\\(\\)";
#define READ_RET_TYPE_TEST_CT 1
-#define READ_RET_TYPE_RE_CT 1
tTestDesc aRead_Ret_TypeTests[] = {
{ TT_EGREP, zRead_Ret_TypeSelect0, (regex_t*)NULL }, };
"[^a-zA-Z_]class\\(";
#define RS6000_DOUBLE_TEST_CT 1
-#define RS6000_DOUBLE_RE_CT 1
tTestDesc aRs6000_DoubleTests[] = {
{ TT_EGREP, zRs6000_DoubleSelect0, (regex_t*)NULL }, };
"fchmod\\(char";
#define RS6000_FCHMOD_TEST_CT 1
-#define RS6000_FCHMOD_RE_CT 1
tTestDesc aRs6000_FchmodTests[] = {
{ TT_EGREP, zRs6000_FchmodSelect0, (regex_t*)NULL }, };
"const char new";
#define RS6000_PARAM_TEST_CT 1
-#define RS6000_PARAM_RE_CT 1
tTestDesc aRs6000_ParamTests[] = {
{ TT_EGREP, zRs6000_ParamSelect0, (regex_t*)NULL }, };
"\"\\.\\./machine/endian.h\"";
#define SONY_INCLUDE_TEST_CT 1
-#define SONY_INCLUDE_RE_CT 1
tTestDesc aSony_IncludeTests[] = {
{ TT_EGREP, zSony_IncludeSelect0, (regex_t*)NULL }, };
"boottime$";
#define STATSSWTCH_TEST_CT 1
-#define STATSSWTCH_RE_CT 1
tTestDesc aStatsswtchTests[] = {
{ TT_EGREP, zStatsswtchSelect0, (regex_t*)NULL }, };
"__gnuc_va_list";
#define STDIO_VA_LIST_TEST_CT 1
-#define STDIO_VA_LIST_RE_CT 1
tTestDesc aStdio_Va_ListTests[] = {
{ TT_NEGREP, zStdio_Va_ListBypass0, (regex_t*)NULL }, };
"#ifdef __i386__ || __vax__";
#define SUN_BOGUS_IFDEF_TEST_CT 1
-#define SUN_BOGUS_IFDEF_RE_CT 1
tTestDesc aSun_Bogus_IfdefTests[] = {
{ TT_EGREP, zSun_Bogus_IfdefSelect0, (regex_t*)NULL }, };
"#ifdef __i386__ || __sun4c__";
#define SUN_BOGUS_IFDEF_SUN4C_TEST_CT 1
-#define SUN_BOGUS_IFDEF_SUN4C_RE_CT 1
tTestDesc aSun_Bogus_Ifdef_Sun4cTests[] = {
{ TT_EGREP, zSun_Bogus_Ifdef_Sun4cSelect0, (regex_t*)NULL }, };
"^#define[ \t]+CAT\\(a,b\\)";
#define SUN_CATMACRO_TEST_CT 1
-#define SUN_CATMACRO_RE_CT 1
tTestDesc aSun_CatmacroTests[] = {
{ TT_EGREP, zSun_CatmacroSelect0, (regex_t*)NULL }, };
*/
#define apzSun_MallocMachs (const char**)NULL
#define SUN_MALLOC_TEST_CT 0
-#define SUN_MALLOC_RE_CT 0
#define aSun_MallocTests (tTestDesc*)NULL
/*
"/\\*\t@\\(#\\)(head/memory.h\t50.1\t |memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2\t)\\*/";
#define SUN_MEMCPY_TEST_CT 1
-#define SUN_MEMCPY_RE_CT 1
tTestDesc aSun_MemcpyTests[] = {
{ TT_EGREP, zSun_MemcpySelect0, (regex_t*)NULL }, };
"_cnt$";
#define SUN_RUSERS_SEMI_TEST_CT 1
-#define SUN_RUSERS_SEMI_RE_CT 1
tTestDesc aSun_Rusers_SemiTests[] = {
{ TT_EGREP, zSun_Rusers_SemiSelect0, (regex_t*)NULL }, };
"^void\t\\(\\*signal\\(\\)\\)\\(\\);";
#define SUN_SIGNAL_TEST_CT 1
-#define SUN_SIGNAL_RE_CT 1
tTestDesc aSun_SignalTests[] = {
{ TT_EGREP, zSun_SignalSelect0, (regex_t*)NULL }, };
"\\(\\*[a-z][a-z_]*\\)\\(\\)";
#define SUN_AUTH_PROTO_TEST_CT 1
-#define SUN_AUTH_PROTO_RE_CT 1
tTestDesc aSun_Auth_ProtoTests[] = {
{ TT_EGREP, zSun_Auth_ProtoSelect0, (regex_t*)NULL }, };
"matherr.*struct exception";
#define SUNOS_MATHERR_DECL_TEST_CT 1
-#define SUNOS_MATHERR_DECL_RE_CT 1
tTestDesc aSunos_Matherr_DeclTests[] = {
{ TT_NEGREP, zSunos_Matherr_DeclBypass0, (regex_t*)NULL }, };
"int[ \t]*strlen";
#define SUNOS_STRLEN_TEST_CT 1
-#define SUNOS_STRLEN_RE_CT 1
tTestDesc aSunos_StrlenTests[] = {
{ TT_EGREP, zSunos_StrlenSelect0, (regex_t*)NULL }, };
"typedef[ \t]+[a-z_][ \ta-z_]*[ \t](size|ptrdiff|wchar)_t";
#define SYSTYPES_TEST_CT 1
-#define SYSTYPES_RE_CT 1
tTestDesc aSystypesTests[] = {
{ TT_EGREP, zSystypesSelect0, (regex_t*)NULL }, };
"_GCC_SIZE_T";
#define SYSTYPES_FOR_AIX_TEST_CT 2
-#define SYSTYPES_FOR_AIX_RE_CT 2
tTestDesc aSystypes_For_AixTests[] = {
{ TT_NEGREP, zSystypes_For_AixBypass0, (regex_t*)NULL },
{ TT_EGREP, zSystypes_For_AixSelect0, (regex_t*)NULL }, };
*/
#define apzSysv68_StringMachs (const char**)NULL
#define SYSV68_STRING_TEST_CT 0
-#define SYSV68_STRING_RE_CT 0
#define aSysv68_StringTests (tTestDesc*)NULL
/*
*/
#define apzSysz_Stdlib_For_SunMachs (const char**)NULL
#define SYSZ_STDLIB_FOR_SUN_TEST_CT 0
-#define SYSZ_STDLIB_FOR_SUN_RE_CT 0
#define aSysz_Stdlib_For_SunTests (tTestDesc*)NULL
/*
*/
#define apzSysz_Stdtypes_For_SunMachs (const char**)NULL
#define SYSZ_STDTYPES_FOR_SUN_TEST_CT 0
-#define SYSZ_STDTYPES_FOR_SUN_RE_CT 0
#define aSysz_Stdtypes_For_SunTests (tTestDesc*)NULL
/*
"[ \t]_cplusplus";
#define TINFO_CPLUSPLUS_TEST_CT 1
-#define TINFO_CPLUSPLUS_RE_CT 1
tTestDesc aTinfo_CplusplusTests[] = {
{ TT_EGREP, zTinfo_CplusplusSelect0, (regex_t*)NULL }, };
"ULTRIX";
#define ULTRIX_ANSI_COMPAT_TEST_CT 1
-#define ULTRIX_ANSI_COMPAT_RE_CT 1
tTestDesc aUltrix_Ansi_CompatTests[] = {
{ TT_EGREP, zUltrix_Ansi_CompatSelect0, (regex_t*)NULL }, };
"ULTRIX";
#define ULTRIX_FIX_FIXPROTO_TEST_CT 1
-#define ULTRIX_FIX_FIXPROTO_RE_CT 1
tTestDesc aUltrix_Fix_FixprotoTests[] = {
{ TT_EGREP, zUltrix_Fix_FixprotoSelect0, (regex_t*)NULL }, };
"atof\\([ \t]*char";
#define ULTRIX_ATOF_PARAM_TEST_CT 1
-#define ULTRIX_ATOF_PARAM_RE_CT 1
tTestDesc aUltrix_Atof_ParamTests[] = {
{ TT_EGREP, zUltrix_Atof_ParamSelect0, (regex_t*)NULL }, };
*/
#define apzUltrix_ConstMachs (const char**)NULL
#define ULTRIX_CONST_TEST_CT 0
-#define ULTRIX_CONST_RE_CT 0
#define aUltrix_ConstTests (tTestDesc*)NULL
/*
"#ifdef KERNEL";
#define ULTRIX_IFDEF_TEST_CT 1
-#define ULTRIX_IFDEF_RE_CT 1
tTestDesc aUltrix_IfdefTests[] = {
{ TT_EGREP, zUltrix_IfdefSelect0, (regex_t*)NULL }, };
*/
#define apzUltrix_Nested_CmntMachs (const char**)NULL
#define ULTRIX_NESTED_CMNT_TEST_CT 0
-#define ULTRIX_NESTED_CMNT_RE_CT 0
#define aUltrix_Nested_CmntTests (tTestDesc*)NULL
/*
"#include \"r[34]_cpu";
#define ULTRIX_STATIC_TEST_CT 1
-#define ULTRIX_STATIC_RE_CT 1
tTestDesc aUltrix_StaticTests[] = {
{ TT_EGREP, zUltrix_StaticSelect0, (regex_t*)NULL }, };
"#[ \t]*(ifn|un)def[ \t]*[ \t]NULL($|[ \t])";
#define UNDEFINE_NULL_TEST_CT 2
-#define UNDEFINE_NULL_RE_CT 2
tTestDesc aUndefine_NullTests[] = {
{ TT_NEGREP, zUndefine_NullBypass0, (regex_t*)NULL },
{ TT_EGREP, zUndefine_NullSelect0, (regex_t*)NULL }, };
"in_port_t";
#define UNIXWARE7_BYTEORDER_FIX_TEST_CT 1
-#define UNIXWARE7_BYTEORDER_FIX_RE_CT 1
tTestDesc aUnixware7_Byteorder_FixTests[] = {
{ TT_EGREP, zUnixware7_Byteorder_FixSelect0, (regex_t*)NULL }, };
"__(vsiz|vali|vpad|alignof__)";
#define VA_I960_MACRO_TEST_CT 1
-#define VA_I960_MACRO_RE_CT 1
tTestDesc aVa_I960_MacroTests[] = {
{ TT_EGREP, zVa_I960_MacroSelect0, (regex_t*)NULL }, };
"#[ \t]*define[ \t][ \t]*NULL[ \t].*void";
#define VOID_NULL_TEST_CT 1
-#define VOID_NULL_RE_CT 1
tTestDesc aVoid_NullTests[] = {
{ TT_EGREP, zVoid_NullSelect0, (regex_t*)NULL }, };
"__GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__";
#define VXWORKS_GCC_PROBLEM_TEST_CT 1
-#define VXWORKS_GCC_PROBLEM_RE_CT 1
tTestDesc aVxworks_Gcc_ProblemTests[] = {
{ TT_EGREP, zVxworks_Gcc_ProblemSelect0, (regex_t*)NULL }, };
"uint_t[ \t][ \t]*_clocks_per_sec";
#define VXWORKS_NEEDS_VXTYPES_TEST_CT 1
-#define VXWORKS_NEEDS_VXTYPES_RE_CT 1
tTestDesc aVxworks_Needs_VxtypesTests[] = {
{ TT_EGREP, zVxworks_Needs_VxtypesSelect0, (regex_t*)NULL }, };
" -n \"`egrep ULONG $file`\"";
#define VXWORKS_NEEDS_VXWORKS_TEST_CT 4
-#define VXWORKS_NEEDS_VXWORKS_RE_CT 1
tTestDesc aVxworks_Needs_VxworksTests[] = {
{ TT_TEST, zVxworks_Needs_VxworksTest0, 0 /* unused */ },
{ TT_TEST, zVxworks_Needs_VxworksTest1, 0 /* unused */ },
" -r vxWorks.h";
#define VXWORKS_TIME_TEST_CT 2
-#define VXWORKS_TIME_RE_CT 1
tTestDesc aVxworks_TimeTests[] = {
{ TT_TEST, zVxworks_TimeTest0, 0 /* unused */ },
{ TT_EGREP, zVxworks_TimeSelect0, (regex_t*)NULL }, };
"__cplusplus";
#define X11_CLASS_TEST_CT 1
-#define X11_CLASS_RE_CT 1
tTestDesc aX11_ClassTests[] = {
{ TT_NEGREP, zX11_ClassBypass0, (regex_t*)NULL }, };
"__cplusplus";
#define X11_CLASS_USAGE_TEST_CT 1
-#define X11_CLASS_USAGE_RE_CT 1
tTestDesc aX11_Class_UsageTests[] = {
{ TT_NEGREP, zX11_Class_UsageBypass0, (regex_t*)NULL }, };
"__cplusplus";
#define X11_NEW_TEST_CT 1
-#define X11_NEW_RE_CT 1
tTestDesc aX11_NewTests[] = {
{ TT_NEGREP, zX11_NewBypass0, (regex_t*)NULL }, };
*/
#define apzX11_SprintfMachs (const char**)NULL
#define X11_SPRINTF_TEST_CT 0
-#define X11_SPRINTF_RE_CT 0
#define aX11_SprintfTests (tTestDesc*)NULL
/*
*
* List of all fixes
*/
-#define REGEX_COUNT 89
+#define REGEX_COUNT 109
#define MACH_LIST_SIZE_LIMIT 279
#define FIX_COUNT 114
return pz_data;
}
+
+
+t_bool
+is_cxx_header (fname, text)
+ tCC *fname;
+ tCC *text;
+{
+ /* First, check to see if the file is in a C++ directory */
+ for (;;)
+ {
+ switch (*(fname++))
+ {
+ case 'C': /* check for "CC/" */
+ if ((fname[0] == 'C') && (fname[1] == '/'))
+ return BOOL_TRUE;
+ break;
+
+ case 'x': /* check for "xx/" */
+ if ((fname[0] == 'x') && (fname[1] == '/'))
+ return BOOL_TRUE;
+ break;
+
+ case '+': /* check for "++" */
+ if (fname[0] == '+')
+ return BOOL_TRUE;
+ break;
+
+ case NUL:
+ goto not_cxx_name;
+ }
+ } not_cxx_name:;
+
+ /* Or it might contain the phrase 'extern "C++"' */
+ for (;;)
+ {
+ tSCC zExtern[] = "extern";
+ tSCC zExtCxx[] = "\"C++\"";
+ tSCC zTemplate[] = "template";
+
+ switch (*(text++))
+ {
+ case 'e':
+ /* Check for "extern \"C++\"" */
+ if (strncmp (text, zExtern+1, sizeof( zExtern )-2) != 0)
+ break;
+ text += sizeof( zExtern )-2;
+ if (! isspace( *(text++)) )
+ break;
+ while (isspace( *text )) text++;
+ if (strncmp (text, zExtCxx, sizeof (zExtCxx) -1) == 0)
+ return BOOL_TRUE;
+ break;
+
+ case 't':
+ /* Check for "template<" */
+ if (strncmp (text, zTemplate+1, sizeof( zTemplate )-2) != 0)
+ break;
+ text += sizeof( zTemplate )-2;
+ while (isspace( *text )) text++;
+ if (*text == '<')
+ return BOOL_TRUE;
+ break;
+
+ case NUL:
+ goto text_done;
+ break;
+ }
+ } text_done:;
+
+ return BOOL_FALSE;
+}
} t_bool;
#endif
+typedef int apply_fix_p_t; /* Apply Fix Predicate Type */
+
+#define APPLY_FIX 0
+#define SKIP_FIX 1
+
#define _P_(p) ()
#endif
* Exported procedures
*/
char * load_file_data _P_(( FILE* fp ));
+t_bool is_cxx_header _P_(( tCC* filename, tCC* filetext ));
#endif /* FIXINCLUDES_FIXLIB_H */
#include "fixlib.h"
-typedef int apply_fix_p_t; /* Apply Fix Predicate Type */
-
-#define APPLY_FIX 0
-#define SKIP_FIX 1
-
#define SHOULD_APPLY(afp) ((afp) == APPLY_FIX)
apply_fix_p_t run_test();
typedef struct {
- const char* test_name;
+ tCC* test_name;
apply_fix_p_t (*test_proc)();
} test_entry_t;
#define TEST_FOR_FIX_PROC_HEAD( test ) \
static apply_fix_p_t test ( fname, text ) \
- const char* fname; \
- const char* text;
+ tCC* fname; \
+ tCC* text;
/*
* Skip over a quoted string. Single quote strings may
* a backslash. Especially a backslash followed by octal digits.
* We are not doing a correctness syntax check here.
*/
-static const char*
+tSCC*
skip_quote( q, text )
char q;
char* text;
return text;
}
-static apply_fix_p_t
-is_cxx_header (fname, text)
- const char *fname;
- const char *text;
-{
- /* First, check to see if the file is in a C++ directory */
- if (strstr( fname, "CC/" ) != NULL)
- return SKIP_FIX;
- if (strstr( fname, "xx/" ) != NULL)
- return SKIP_FIX;
- if (strstr( fname, "++" ) != NULL)
- return SKIP_FIX;
- /* Or it might contain the phrase 'extern "C++"' */
- if (strstr( text, "extern \"C++\"" ) != NULL)
- return SKIP_FIX;
-
- return APPLY_FIX;
-}
-
TEST_FOR_FIX_PROC_HEAD( double_slash_test )
{
- if (is_cxx_header (fname, text) == SKIP_FIX)
+ if (is_cxx_header (fname, text))
return SKIP_FIX;
/* Now look for the comment markers in the text */
TEST_FOR_FIX_PROC_HEAD( else_endif_label_test )
{
static int compiled = 0;
- static const char label_pat[] = "^[ \t]*#[ \t]*(else|endif)";
+ tSCC label_pat[] = "^[ \t]*#[ \t]*(else|endif)";
static regex_t label_re;
char ch;
- const char* pz_next = (char*)NULL;
+ tCC* pz_next = (char*)NULL;
regmatch_t match[2];
- const char *all_text = text;
+ t_bool file_is_cxx = is_cxx_header( fname, text );
/*
This routine may be run many times within a single execution.
case '/':
/*
Skip comments. Otherwise, we have a bogon */
- if (*pz_next == '*')
+ switch (*pz_next)
{
+ case '/':
+ /* IF we found a "//" in a C header, THEN fix it. */
+ if (! file_is_cxx)
+ return APPLY_FIX;
+
+ /* C++ header. Skip to newline and continue. */
+ pz_next = strchr( pz_next+1, '\n' );
+ if (pz_next == (char*)NULL)
+ return SKIP_FIX;
+ pz_next++;
+ break;
+
+ case '*':
+ /* A comment for either C++ or C. Skip over it. */
pz_next = strstr( pz_next+1, "*/" );
if (pz_next == (char*)NULL)
return SKIP_FIX;
pz_next += 2;
break;
+
+ default:
+ /* a '/' followed by other junk. */
+ return APPLY_FIX;
}
- else if (*pz_next == '/'
- && is_cxx_header( fname, all_text ) == SKIP_FIX)
- {
- pz_next = strchr( pz_next+1, '\n' );
- if (pz_next == (char*)NULL)
- return SKIP_FIX;
- pz_next++;
- break;
- }
-
- /* FALLTHROUGH */
+ break; /* a C or C++ comment */
default:
/*
*/
apply_fix_p_t
run_test( tname, fname, text )
- const char* tname;
- const char* fname;
- const char* text;
+ tCC* tname;
+ tCC* fname;
+ tCC* text;
{
#define _FT_(n,p) { n, p },
static test_entry_t test_table[] = { FIX_TEST_TABLE { NULL, NULL }};
char* fname = *++argv;
char* tname = *++argv;
char* buf;
- size_t buf_size = 0;
if (argc != 3)
return run_test( "No test name provided", NULL, NULL, 0 );
_FOR fix "\n\n" =]
#
- # Fix [=_eval _index 1 + #%3d _printf=]: [=hackname _Cap=]
+ # Fix [=
+ _IF FIXINC_DEBUG _exist =][=_eval _index 1 + #%3d _printf=]: [=
+ _ENDIF =][=hackname _Cap=]
#[=
_IF files _exist=]
case "${file}" in [=_FOR files " | \\\n\t"=]./[=files=][=/files=] )[=
_ELIF replace _exist =][=
_IF replace _len 0 > =]
- echo "[=hackname _down=] replacing file ${file}" >&2
+ echo "[=hackname =] replacing file ${file}" >&2
cat > ${DESTFILE} << '_EOF_'
[=replace=]
_EOF_[=
_ELSE =]
- echo "[=hackname _down=] bypassing file ${file}"[=
+ echo "[=hackname =] bypassing file ${file}"[=
_ENDIF =]
continue
[=
Define all the fixes we know about for repairing damaged headers.
Please see the README before adding or changing entries in this file.
-Now, first: DO NOT DO BROKEN FIXES (empty replacement fixes) */
+Set up a debug test so we can make the templates emit special
+code while debugging these fixes: */
+#ifdef DEBUG
+FIXINC_DEBUG = yes;
+#endif
+/* DO NOT DO BROKEN FIXES (empty replacement fixes) */
/*
- * Purge some HP-UX 11 files that are only borken after they are "fixed".
+ * Purge some HP-UX 11 files that are only broken after they are "fixed".
*/
fix = {
hackname = AAA_ki_iface;
/*
- * Purge some HP-UX 11 files that are only borken after they are "fixed".
+ * Purge some HP-UX 11 files that are only broken after they are "fixed".
*/
fix = {
hackname = AAA_ki;
/*
- * Purge some HP-UX 11 files that are only borken after they are "fixed".
+ * Purge some HP-UX 11 files that are only broken after they are "fixed".
*/
fix = {
hackname = AAA_ki_calls;
/*
- * Purge some HP-UX 11 files that are only borken after they are "fixed".
+ * Purge some HP-UX 11 files that are only broken after they are "fixed".
*/
fix = {
hackname = AAA_ki_defs;
/*
- * Purge some HP-UX 11 files that are only borken after they are "fixed".
+ * Purge some HP-UX 11 files that are only broken after they are "fixed".
*/
fix = {
hackname = AAA_time;
# Directory in which to store the results.
# Fail if no arg to specify a directory for the output.
if [ "x$1" = "x" ]
-then echo fixincludes: no output directory specified
-exit 1
+then
+ echo fixincludes: no output directory specified
+ exit 1
fi
LIB=${1}
FIXTESTS=$PWD/fixinc/fixtests
FIXFIXES=$PWD/fixinc/fixfixes
+if test -z "$VERBOSE"
+then
+ VERBOSE=2
+ export VERBOSE
+else
+ case "$VERBOSE" in
+ [0-9] ) : ;;
+ * ) VERBOSE=3 ;;
+ esac
+fi
+
# Define what target system we're fixing.
#
if test -r ./Makefile; then
;;
esac
-echo Fixing headers into ${LIB} for ${target_canonical} target
+if test $VERBOSE -gt 0
+then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi
# Determine whether this system has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
#
# # # # # # # # # # # # # # # # # # # # #
#
-echo Finding directories and links to directories
+if test $VERBOSE -gt 1
+then echo Finding directories and links to directories ; fi
# Find all directories and all symlinks that point to directories.
# Put the list in $all_dirs.
newdirs=
for d in $dirs
do
- echo " Searching $INPUT/$d"
+ if test $VERBOSE -gt 1
+ then echo " Searching $INPUT/$d" ; fi
# Find all directories under $d, relative to $d, excluding $d itself.
# (The /. is needed after $d in case $d is a symlink.)
# # # # # # # # # # # # # # # # # # # # #
#
dirs=
-echo "All directories (including links to directories):"
-echo $all_dirs
+if test $VERBOSE -gt 2
+then echo "All directories (including links to directories):"
+ echo $all_dirs
+fi
for file in $all_dirs; do
rm -rf $LIB/$file
treetops=". ${LIB}"
if $LINKS; then
- echo 'Making symbolic directory links'
+ if test $VERBOSE -gt 1
+ then echo 'Making symbolic directory links' ; fi
cwd=`${PWDCMD}`
for sym_link in $search_dirs; do
# If a link points to ., make a similar link to .
#
if [ ${full_dest_dir} = ${cinput} ]; then
- echo ${sym_link} '->' . ': Making self link'
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' . ': Making self link' ; fi
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
# DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
dots=`echo "${sym_link}" |
sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
- echo ${sym_link} '->' $dots$y ': Making local link'
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' $dots$y ': Making local link' ; fi
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
# and process $target into ${INPUT}/root$target
# treat this directory as if it actually contained the files.
#
- echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
+ fi
if [ -d $LIB/root${full_dest_dir} ]
then true
else
${sym_link}/*)
dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
sed -n "s|^${sym_link}/||p"`
- echo "Duplicating ${sym_link}'s ${dupdir}"
+ if test $VERBOSE -gt 2
+ then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi
if [ -d ${dupdir} ]
then true
else
then continue ; fi
touch ${DESTDIR}/DONE
- echo Fixing directory ${SRCDIR} into ${DESTDIR}
+ if test $VERBOSE -gt 1
+ then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi
# Check files which are symlinks as well as those which are files.
#
DESTFILE=${DESTDIR}/`echo ${file} | sed "s;${FIND_BASE}/;;" `
#
- # Fix 1: Aaa_Ki_Iface
+ # Fix Aaa_Ki_Iface
#
case "${file}" in ./sys/ki_iface.h )
if ( test -n "`egrep 'These definitions are for HP Internal developers' ${file}`"
) > /dev/null 2>&1 ; then
- echo "aaa_ki_iface bypassing file ${file}"
+ echo "AAA_ki_iface bypassing file ${file}"
continue
fi # end of select 'if'
#
- # Fix 2: Aaa_Ki
+ # Fix Aaa_Ki
#
case "${file}" in ./sys/ki.h )
if ( test -n "`egrep '11.00 HP-UX LP64' ${file}`"
) > /dev/null 2>&1 ; then
- echo "aaa_ki bypassing file ${file}"
+ echo "AAA_ki bypassing file ${file}"
continue
fi # end of select 'if'
#
- # Fix 3: Aaa_Ki_Calls
+ # Fix Aaa_Ki_Calls
#
case "${file}" in ./sys/ki_calls.h )
if ( test -n "`egrep 'kthread_create_caller_t' ${file}`"
) > /dev/null 2>&1 ; then
- echo "aaa_ki_calls bypassing file ${file}"
+ echo "AAA_ki_calls bypassing file ${file}"
continue
fi # end of select 'if'
#
- # Fix 4: Aaa_Ki_Defs
+ # Fix Aaa_Ki_Defs
#
case "${file}" in ./sys/ki_defs.h )
if ( test -n "`egrep 'Kernel Instrumentation Definitions' ${file}`"
) > /dev/null 2>&1 ; then
- echo "aaa_ki_defs bypassing file ${file}"
+ echo "AAA_ki_defs bypassing file ${file}"
continue
fi # end of select 'if'
#
- # Fix 5: Aaa_Bad_Fixes
+ # Fix Aaa_Bad_Fixes
#
case "${file}" in ./sundev/ipi_error.h )
- echo "aaa_bad_fixes bypassing file ${file}"
+ echo "AAA_bad_fixes bypassing file ${file}"
continue
;; # case end for file name test
#
- # Fix 6: Aaa_Time
+ # Fix Aaa_Time
#
case "${file}" in ./sys/time.h )
if ( test -n "`egrep '11.0 and later representation of ki time' ${file}`"
) > /dev/null 2>&1 ; then
- echo "aaa_time bypassing file ${file}"
+ echo "AAA_time bypassing file ${file}"
continue
fi # end of select 'if'
#
- # Fix 7: Aab_Dgux_Int_Varargs
+ # Fix Aab_Dgux_Int_Varargs
#
case "${file}" in ./_int_varargs.h )
- echo "aab_dgux_int_varargs replacing file ${file}" >&2
+ echo "AAB_dgux_int_varargs replacing file ${file}" >&2
cat > ${DESTFILE} << '_EOF_'
#ifndef __INT_VARARGS_H
#define __INT_VARARGS_H
#
- # Fix 8: Aab_Fd_Zero_Asm_Posix_Types_H
+ # Fix Aab_Fd_Zero_Asm_Posix_Types_H
#
case "${file}" in ./asm/posix_types.h )
case "$target_canonical" in i[34567]86-*-linux-gnu* )
if ( test -z "`egrep '} while' ${file}`"
) > /dev/null 2>&1 ; then
- echo "aab_fd_zero_asm_posix_types_h replacing file ${file}" >&2
+ echo "AAB_fd_zero_asm_posix_types_h replacing file ${file}" >&2
cat > ${DESTFILE} << '_EOF_'
/* This file fixes a bug in the __FD_ZERO macro
for older versions of the Linux kernel. */
#
- # Fix 9: Aab_Fd_Zero_Gnu_Types_H
+ # Fix Aab_Fd_Zero_Gnu_Types_H
#
case "${file}" in ./gnu/types.h )
case "$target_canonical" in i[34567]86-*-linux-gnu* )
- echo "aab_fd_zero_gnu_types_h replacing file ${file}" >&2
+ echo "AAB_fd_zero_gnu_types_h replacing file ${file}" >&2
cat > ${DESTFILE} << '_EOF_'
/* This file fixes a bug in the __FD_ZERO macro present in glibc 1.x. */
#ifndef _TYPES_H_WRAPPER
#
- # Fix 10: Aab_Fd_Zero_Selectbits_H
+ # Fix Aab_Fd_Zero_Selectbits_H
#
case "${file}" in ./selectbits.h )
case "$target_canonical" in i[34567]86-*-linux-gnu* )
- echo "aab_fd_zero_selectbits_h replacing file ${file}" >&2
+ echo "AAB_fd_zero_selectbits_h replacing file ${file}" >&2
cat > ${DESTFILE} << '_EOF_'
/* This file fixes a bug in the __FD_ZERO macro present in glibc 2.0.x. */
#ifndef _SELECTBITS_H_WRAPPER
#
- # Fix 11: Aab_Svr4_Replace_Byteorder
+ # Fix Aab_Svr4_Replace_Byteorder
#
case "${file}" in ./sys/byteorder.h )
case "$target_canonical" in *-*-sysv4* | \
i[34567]86-*-solaris2.[0-4] | \
powerpcle-*-solaris2.[0-4] | \
sparc-*-solaris2.[0-4] )
- echo "aab_svr4_replace_byteorder replacing file ${file}" >&2
+ echo "AAB_svr4_replace_byteorder replacing file ${file}" >&2
cat > ${DESTFILE} << '_EOF_'
#ifndef _SYS_BYTEORDER_H
#define _SYS_BYTEORDER_H
#
- # Fix 12: Aix_Syswait
+ # Fix Aix_Syswait
#
case "${file}" in ./sys/wait.h )
if ( test -n "`egrep 'bos325,' ${file}`"
#
- # Fix 13: Aix_Volatile
+ # Fix Aix_Volatile
#
case "${file}" in ./sys/signal.h )
if ( test -n "`egrep 'typedef volatile int sig_atomic_t' ${file}`"
#
- # Fix 14: Alpha_Getopt
+ # Fix Alpha_Getopt
#
case "${file}" in ./stdio.h | \
./stdlib.h )
#
- # Fix 15: Alpha_Parens
+ # Fix Alpha_Parens
#
case "${file}" in ./sym.h )
if ( test -n "`egrep '#ifndef\\(__mips64\\)' ${file}`"
#
- # Fix 16: Alpha_Sbrk
+ # Fix Alpha_Sbrk
#
case "${file}" in ./unistd.h )
if ( test -n "`egrep 'char[ ]*\\*[ ]*sbrk[ ]*\\(' ${file}`"
#
- # Fix 17: Arm_Norcroft_Hint
+ # Fix Arm_Norcroft_Hint
#
case "${file}" in ./X11/Intrinsic.h )
if ( test -n "`egrep '___type p_type' ${file}`"
#
- # Fix 18: Arm_Wchar
+ # Fix Arm_Wchar
#
case "${file}" in ./stdlib.h )
if ( test -n "`egrep '#[ ]*define[ ]*__wchar_t' ${file}`"
#
- # Fix 19: Aux_Asm
+ # Fix Aux_Asm
#
case "${file}" in ./sys/param.h )
if ( test -n "`egrep '#ifndef NOINLINE' ${file}`"
#
- # Fix 20: Avoid_Bool
+ # Fix Avoid_Bool
#
case "${file}" in ./curses.h | \
./curses_colr/curses.h | \
#
- # Fix 21: Bad_Struct_Term
+ # Fix Bad_Struct_Term
#
case "${file}" in ./curses.h )
if ( test -n "`egrep '^[ ]*typedef[ ]+struct[ ]+term[ ]*;' ${file}`"
#
- # Fix 22: Badquote
+ # Fix Badquote
#
case "${file}" in ./sundev/vuid_event.h )
fixlist="${fixlist}
#
- # Fix 23: Bad_Lval
+ # Fix Bad_Lval
#
case "${file}" in ./libgen.h | \
./dirent.h | \
#
- # Fix 24: Broken_Assert_Stdio
+ # Fix Broken_Assert_Stdio
#
case "${file}" in ./assert.h )
if ( test -n "`egrep 'stderr' ${file}`"
#
- # Fix 25: Broken_Assert_Stdlib
+ # Fix Broken_Assert_Stdlib
#
case "${file}" in ./assert.h )
if ( test -n "`egrep 'exit *\\(|abort *\\(' ${file}`"
#
- # Fix 26: Bsd43_Io_Macros
+ # Fix Bsd43_Io_Macros
#
if ( test -n "`egrep 'BSD43__IO' ${file}`"
) > /dev/null 2>&1 ; then
#
- # Fix 27: Dec_Intern_Asm
+ # Fix Dec_Intern_Asm
#
case "${file}" in ./c_asm.h )
fixlist="${fixlist}
#
- # Fix 28: No_Double_Slash
+ # Fix No_Double_Slash
#
if ${FIXTESTS} ${file} double_slash
then
#
- # Fix 29: Ecd_Cursor
+ # Fix Ecd_Cursor
#
case "${file}" in ./sunwindow/win_lock.h | \
./sunwindow/win_cursor.h )
#
- # Fix 30: Sco5_Stat_Wrappers
+ # Fix Sco5_Stat_Wrappers
#
case "${file}" in ./sys/stat.h )
case "$target_canonical" in i*86-*-sco3.2v5* )
#
- # Fix 31: End_Else_Label
+ # Fix End_Else_Label
#
if ${FIXTESTS} ${file} else_endif_label
then
#
- # Fix 32: Hp_Inline
+ # Fix Hp_Inline
#
case "${file}" in ./sys/spinlock.h )
if ( test -n "`egrep 'include.*\"\\.\\./machine/' ${file}`"
#
- # Fix 33: Hp_Sysfile
+ # Fix Hp_Sysfile
#
case "${file}" in ./sys/file.h )
if ( test -n "`egrep 'HPUX_SOURCE' ${file}`"
#
- # Fix 34: Cxx_Unready
+ # Fix Cxx_Unready
#
case "${file}" in ./sys/mman.h | \
./rpc/types.h )
#
- # Fix 35: Hpux_Maxint
+ # Fix Hpux_Maxint
#
case "${file}" in ./sys/param.h )
fixlist="${fixlist}
#
- # Fix 36: Hpux_Systime
+ # Fix Hpux_Systime
#
case "${file}" in ./sys/time.h )
if ( test -n "`egrep '^extern struct sigevent;' ${file}`"
#
- # Fix 37: Hpux8_Bogus_Inlines
+ # Fix Hpux8_Bogus_Inlines
#
case "${file}" in ./math.h )
if ( test -n "`egrep 'inline' ${file}`"
#
- # Fix 38: Hpux11_Uint32_C
+ # Fix Hpux11_Uint32_C
#
case "${file}" in ./inttypes.h )
if ( test -n "`egrep '^#define UINT32_C\\(__c\\)[ ]*__CONCAT__\\(__CONCAT_U__\\(__c\\),l\\)' ${file}`"
#
- # Fix 39: Interactv_Add1
+ # Fix Interactv_Add1
#
case "${file}" in ./stdio.h | \
./math.h | \
#
- # Fix 40: Interactv_Add2
+ # Fix Interactv_Add2
#
case "${file}" in ./math.h )
if ( test '(' -d /etc/conf/kconfig.d ')' -a \
#
- # Fix 41: Interactv_Add3
+ # Fix Interactv_Add3
#
case "${file}" in ./sys/limits.h )
if ( test '(' -d /etc/conf/kconfig.d ')' -a \
#
- # Fix 42: Io_Def_Quotes
+ # Fix Io_Def_Quotes
#
if ( test -n "`egrep '[ ]*[ ](_|DES)IO[A-Z]*[ ]*\\( *[^,'\\'']' ${file}`"
) > /dev/null 2>&1 ; then
#
- # Fix 43: Ioctl_Fix_Ctrl
+ # Fix Ioctl_Fix_Ctrl
#
if ( test -n "`egrep 'CTRL[ ]*\\(' ${file}`"
) > /dev/null 2>&1 ; then
#
- # Fix 44: Ip_Missing_Semi
+ # Fix Ip_Missing_Semi
#
case "${file}" in ./netinet/ip.h )
if ( test -n "`egrep '}$' ${file}`"
#
- # Fix 45: Irix_Multiline_Cmnt
+ # Fix Irix_Multiline_Cmnt
#
case "${file}" in ./sys/types.h )
fixlist="${fixlist}
#
- # Fix 46: Irix_Sockaddr
+ # Fix Irix_Sockaddr
#
case "${file}" in ./rpc/auth.h )
if ( test -n "`egrep 'authdes_create.*struct sockaddr' ${file}`"
#
- # Fix 47: Irix_Struct__File
+ # Fix Irix_Struct__File
#
case "${file}" in ./rpc/xdr.h )
fixlist="${fixlist}
#
- # Fix 48: Irix_Asm_Apostrophe
+ # Fix Irix_Asm_Apostrophe
#
case "${file}" in ./sys/asm.h )
if ( test -n "`egrep '^[ ]*#.*[Ww]e'\\''re' ${file}`"
#
- # Fix 49: Isc_Fmod
+ # Fix Isc_Fmod
#
case "${file}" in ./math.h )
if ( test -n "`egrep 'fmod\\(double\\)' ${file}`"
#
- # Fix 50: Motorola_Nested
+ # Fix Motorola_Nested
#
case "${file}" in ./limits.h | \
./sys/limits.h )
#
- # Fix 51: Isc_Sys_Limits
+ # Fix Isc_Sys_Limits
#
case "${file}" in ./sys/limits.h )
if ( test -n "`egrep 'CHILD_MAX' ${file}`"
#
- # Fix 52: Kandr_Concat
+ # Fix Kandr_Concat
#
case "${file}" in ./sparc/asm_linkage.h | \
./sun3/asm_linkage.h | \
#
- # Fix 53: Limits_Ifndefs
+ # Fix Limits_Ifndefs
#
case "${file}" in ./limits.h | \
./sys/limits.h )
#
- # Fix 54: Lynx_Void_Int
+ # Fix Lynx_Void_Int
#
case "${file}" in ./curses.h )
if ( test -n "`egrep '#[ ]*define[ ]+void[ ]+int' ${file}`"
#
- # Fix 55: Lynxos_Fcntl_Proto
+ # Fix Lynxos_Fcntl_Proto
#
case "${file}" in ./fcntl.h )
if ( test -n "`egrep 'fcntl.*\\(int, int, int\\)' ${file}`"
#
- # Fix 56: M88k_Bad_Hypot_Opt
+ # Fix M88k_Bad_Hypot_Opt
#
case "${file}" in ./math.h )
case "$target_canonical" in m88k-motorola-sysv3* )
#
- # Fix 57: M88k_Bad_S_If
+ # Fix M88k_Bad_S_If
#
case "${file}" in ./sys/stat.h )
case "$target_canonical" in m88k-*-sysv3* )
#
- # Fix 58: M88k_Multi_Incl
+ # Fix M88k_Multi_Incl
#
case "${file}" in ./time.h )
case "$target_canonical" in m88k-tektronix-sysv3* )
#
- # Fix 59: Machine_Name
+ # Fix Machine_Name
#
if ( test -n "`egrep '^#[ ]*(if|elif).*[^a-zA-Z0-9_](_*[MSRrhim]|[Mbimnpstuv])[a-zA-Z0-9_]' ${file}`"
) > /dev/null 2>&1 ; then
#
- # Fix 60: Math_Exception
+ # Fix Math_Exception
#
case "${file}" in ./math.h )
if ( test -n "`egrep 'struct exception' ${file}`"
#
- # Fix 61: Math_Huge_Val_From_Dbl_Max
+ # Fix Math_Huge_Val_From_Dbl_Max
#
case "${file}" in ./math.h )
if ( test -n "`egrep 'define[ ]*HUGE_VAL[ ]*DBL_MAX' ${file}`"
#
- # Fix 62: Math_Huge_Val_Ifndef
+ # Fix Math_Huge_Val_Ifndef
#
case "${file}" in ./math/math.h )
if ( test -n "`egrep 'define[ ]*HUGE_VAL' ${file}`"
#
- # Fix 63: Nested_Comment
+ # Fix Nested_Comment
#
case "${file}" in ./rpc/rpc.h )
fixlist="${fixlist}
#
- # Fix 64: News_Os_Recursion
+ # Fix News_Os_Recursion
#
case "${file}" in ./stdlib.h )
if ( test -n "`egrep '#include <stdlib.h>' ${file}`"
#
- # Fix 65: Next_Math_Prefix
+ # Fix Next_Math_Prefix
#
case "${file}" in ./ansi/math.h )
if ( test -n "`egrep '^extern.*double.*__const__.*' ${file}`"
#
- # Fix 66: Next_Template
+ # Fix Next_Template
#
case "${file}" in ./bsd/libc.h )
if ( test -n "`egrep 'template' ${file}`"
#
- # Fix 67: Next_Volitile
+ # Fix Next_Volitile
#
case "${file}" in ./ansi/stdlib.h )
if ( test -n "`egrep 'volatile' ${file}`"
#
- # Fix 68: Next_Wait_Union
+ # Fix Next_Wait_Union
#
case "${file}" in ./sys/wait.h )
if ( test -n "`egrep 'wait\\(union wait' ${file}`"
#
- # Fix 69: Nodeent_Syntax
+ # Fix Nodeent_Syntax
#
case "${file}" in ./netdnet/dnetdb.h )
fixlist="${fixlist}
#
- # Fix 70: Osf_Namespace_A
+ # Fix Osf_Namespace_A
#
case "${file}" in ./reg_types.h | \
./sys/lc_core.h )
#
- # Fix 71: Osf_Namespace_B
+ # Fix Osf_Namespace_B
#
case "${file}" in ./regex.h )
if ( test '(' -r reg_types.h ')' -a \
#
- # Fix 72: Pthread_Page_Size
+ # Fix Pthread_Page_Size
#
case "${file}" in ./pthread.h )
if ( test -n "`egrep '^int __page_size' ${file}`"
#
- # Fix 73: Read_Ret_Type
+ # Fix Read_Ret_Type
#
case "${file}" in ./stdio.h )
if ( test -n "`egrep 'extern int .*, fread\\(\\), fwrite\\(\\)' ${file}`"
#
- # Fix 74: Rs6000_Double
+ # Fix Rs6000_Double
#
case "${file}" in ./math.h )
if ( test -n "`egrep '[^a-zA-Z_]class\\(' ${file}`"
#
- # Fix 75: Rs6000_Fchmod
+ # Fix Rs6000_Fchmod
#
case "${file}" in ./sys/stat.h )
if ( test -n "`egrep 'fchmod\\(char' ${file}`"
#
- # Fix 76: Rs6000_Param
+ # Fix Rs6000_Param
#
case "${file}" in ./stdio.h | \
./unistd.h )
#
- # Fix 77: Sony_Include
+ # Fix Sony_Include
#
case "${file}" in ./machine/machparam.h )
if ( test -n "`egrep '\"\\.\\./machine/endian.h\"' ${file}`"
#
- # Fix 78: Statsswtch
+ # Fix Statsswtch
#
case "${file}" in ./rpcsvc/rstat.h )
if ( test -n "`egrep 'boottime$' ${file}`"
#
- # Fix 79: Stdio_Va_List
+ # Fix Stdio_Va_List
#
case "${file}" in ./stdio.h )
if ( test -z "`egrep '__gnuc_va_list' ${file}`"
#
- # Fix 80: Sun_Bogus_Ifdef
+ # Fix Sun_Bogus_Ifdef
#
case "${file}" in ./hsfs/hsfs_spec.h | \
./hsfs/iso_spec.h )
#
- # Fix 81: Sun_Bogus_Ifdef_Sun4c
+ # Fix Sun_Bogus_Ifdef_Sun4c
#
case "${file}" in ./hsfs/hsnode.h )
if ( test -n "`egrep '#ifdef __i386__ || __sun4c__' ${file}`"
#
- # Fix 82: Sun_Catmacro
+ # Fix Sun_Catmacro
#
case "${file}" in ./pixrect/memvar.h )
if ( test -n "`egrep '^#define[ ]+CAT\\(a,b\\)' ${file}`"
#
- # Fix 83: Sun_Malloc
+ # Fix Sun_Malloc
#
case "${file}" in ./malloc.h )
fixlist="${fixlist}
#
- # Fix 84: Sun_Memcpy
+ # Fix Sun_Memcpy
#
case "${file}" in ./memory.h )
if ( test -n "`egrep '/\\* @\\(#\\)(head/memory.h 50.1 |memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2 )\\*/' ${file}`"
#
- # Fix 85: Sun_Rusers_Semi
+ # Fix Sun_Rusers_Semi
#
case "${file}" in ./rpcsvc/rusers.h )
if ( test -n "`egrep '_cnt$' ${file}`"
#
- # Fix 86: Sun_Signal
+ # Fix Sun_Signal
#
case "${file}" in ./sys/signal.h | \
./signal.h )
#
- # Fix 87: Sun_Auth_Proto
+ # Fix Sun_Auth_Proto
#
case "${file}" in ./rpc/auth.h | \
./rpc/clnt.h | \
#
- # Fix 88: Sunos_Matherr_Decl
+ # Fix Sunos_Matherr_Decl
#
case "${file}" in ./math.h )
if ( test -z "`egrep 'matherr.*struct exception' ${file}`"
#
- # Fix 89: Sunos_Strlen
+ # Fix Sunos_Strlen
#
case "${file}" in ./strings.h )
if ( test -n "`egrep 'int[ ]*strlen' ${file}`"
#
- # Fix 90: Systypes
+ # Fix Systypes
#
case "${file}" in ./sys/types.h | \
./stdlib.h | \
#
- # Fix 91: Systypes_For_Aix
+ # Fix Systypes_For_Aix
#
case "${file}" in ./sys/types.h )
if ( test -n "`egrep 'typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t' ${file}`"
#
- # Fix 92: Sysv68_String
+ # Fix Sysv68_String
#
case "${file}" in ./string.h )
fixlist="${fixlist}
#
- # Fix 93: Sysz_Stdlib_For_Sun
+ # Fix Sysz_Stdlib_For_Sun
#
case "${file}" in ./stdlib.h )
fixlist="${fixlist}
#
- # Fix 94: Sysz_Stdtypes_For_Sun
+ # Fix Sysz_Stdtypes_For_Sun
#
case "${file}" in ./sys/stdtypes.h )
fixlist="${fixlist}
#
- # Fix 95: Tinfo_Cplusplus
+ # Fix Tinfo_Cplusplus
#
case "${file}" in ./tinfo.h )
if ( test -n "`egrep '[ ]_cplusplus' ${file}`"
#
- # Fix 96: Ultrix_Ansi_Compat
+ # Fix Ultrix_Ansi_Compat
#
case "${file}" in ./ansi_compat.h )
if ( test -n "`egrep 'ULTRIX' ${file}`"
#
- # Fix 97: Ultrix_Fix_Fixproto
+ # Fix Ultrix_Fix_Fixproto
#
case "${file}" in ./sys/utsname.h )
if ( test -n "`egrep 'ULTRIX' ${file}`"
#
- # Fix 98: Ultrix_Atof_Param
+ # Fix Ultrix_Atof_Param
#
case "${file}" in ./math.h )
if ( test -n "`egrep 'atof\\([ ]*char' ${file}`"
#
- # Fix 99: Ultrix_Const
+ # Fix Ultrix_Const
#
case "${file}" in ./stdio.h )
fixlist="${fixlist}
#
- # Fix 100: Ultrix_Ifdef
+ # Fix Ultrix_Ifdef
#
case "${file}" in ./sys/file.h )
if ( test -n "`egrep '#ifdef KERNEL' ${file}`"
#
- # Fix 101: Ultrix_Nested_Cmnt
+ # Fix Ultrix_Nested_Cmnt
#
case "${file}" in ./rpc/svc.h )
fixlist="${fixlist}
#
- # Fix 102: Ultrix_Static
+ # Fix Ultrix_Static
#
case "${file}" in ./machine/cpu.h )
if ( test -n "`egrep '#include \"r[34]_cpu' ${file}`"
#
- # Fix 103: Undefine_Null
+ # Fix Undefine_Null
#
if ( test -n "`egrep '^#[ ]*define[ ]*[ ]NULL[ ]' ${file}`"
) > /dev/null 2>&1 ; then
#
- # Fix 104: Unixware7_Byteorder_Fix
+ # Fix Unixware7_Byteorder_Fix
#
case "${file}" in ./arpa/inet.h )
case "$target_canonical" in *-*-sysv4* | \
#
- # Fix 105: Va_I960_Macro
+ # Fix Va_I960_Macro
#
case "${file}" in ./arch/i960/archI960.h )
if ( test -n "`egrep '__(vsiz|vali|vpad|alignof__)' ${file}`"
#
- # Fix 106: Void_Null
+ # Fix Void_Null
#
case "${file}" in ./curses.h | \
./dbm.h | \
#
- # Fix 107: Vxworks_Gcc_Problem
+ # Fix Vxworks_Gcc_Problem
#
case "${file}" in ./types/vxTypesBase.h )
if ( test -n "`egrep '__GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__' ${file}`"
#
- # Fix 108: Vxworks_Needs_Vxtypes
+ # Fix Vxworks_Needs_Vxtypes
#
case "${file}" in ./time.h )
if ( test -n "`egrep 'uint_t[ ][ ]*_clocks_per_sec' ${file}`"
#
- # Fix 109: Vxworks_Needs_Vxworks
+ # Fix Vxworks_Needs_Vxworks
#
case "${file}" in ./sys/stat.h )
if ( test -n "`egrep '#[ ]define[ ][ ]*__INCstath' ${file}`"
#
- # Fix 110: Vxworks_Time
+ # Fix Vxworks_Time
#
case "${file}" in ./time.h )
if ( test -n "`egrep 'VOIDFUNCPTR' ${file}`"
#
- # Fix 111: X11_Class
+ # Fix X11_Class
#
case "${file}" in ./X11/ShellP.h )
if ( test -z "`egrep '__cplusplus' ${file}`"
#
- # Fix 112: X11_Class_Usage
+ # Fix X11_Class_Usage
#
case "${file}" in ./Xm/BaseClassI.h )
if ( test -z "`egrep '__cplusplus' ${file}`"
#
- # Fix 113: X11_New
+ # Fix X11_New
#
case "${file}" in ./Xm/Traversal.h )
if ( test -z "`egrep '__cplusplus' ${file}`"
#
- # Fix 114: X11_Sprintf
+ # Fix X11_Sprintf
#
case "${file}" in ./X11*/Xmu.h )
fixlist="${fixlist}
cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
chmod +w $3 2>/dev/null
chmod a+r $3 2>/dev/null
- echo Copied $2
+ if test $VERBOSE -gt 2
+ then echo Copied $2 ; fi
for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 |
sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
do
shift
done
-echo 'Cleaning up DONE files.'
+if test $VERBOSE -gt 2
+then echo 'Cleaning up DONE files.' ; fi
cd $LIB
find . -name DONE -exec rm -f '{}' ';'
-echo 'Removing unneeded directories:'
+if test $VERBOSE -gt 1
+then echo 'Cleaning up unneeded directories:' ; fi
cd $LIB
all_dirs=`find . -type d \! -name '.' -print | sort -r`
for file in $all_dirs; do
rmdir $LIB/$file > /dev/null 2>&1
done
+if test $VERBOSE -gt 0
+then echo fixincludes is done ; fi
+
# # # # # # # # # # # # # # # # # # # # #
#
# End of for INPUT directories
-[= autogen template -*- Mode: ksh -*-
+[= autogen template -*- Mode: sh -*-
sh
#
#
# Directory in which to store the results.
# Fail if no arg to specify a directory for the output.
if [ "x$1" = "x" ]
-then echo fixincludes: no output directory specified
-exit 1
+then
+ echo fixincludes: no output directory specified
+ exit 1
fi
LIB=${1}
FIXTESTS=$PWD/fixinc/fixtests
FIXFIXES=$PWD/fixinc/fixfixes
[=_ENDIF=]
+if test -z "$VERBOSE"
+then
+ VERBOSE=[=
+ _IF FIXINC_DEBUG _exist =]3[=_ELSE=]2[=_ENDIF=]
+ export VERBOSE
+else
+ case "$VERBOSE" in
+ [0-9] ) : ;;
+ * ) VERBOSE=3 ;;
+ esac
+fi
+
# Define what target system we're fixing.
#
if test -r ./Makefile; then
;;
esac
-echo Fixing headers into ${LIB} for ${target_canonical} target
+if test $VERBOSE -gt 0
+then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi
# Determine whether this system has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
#
# # # # # # # # # # # # # # # # # # # # #
#
-echo Finding directories and links to directories
+if test $VERBOSE -gt 1
+then echo Finding directories and links to directories ; fi
# Find all directories and all symlinks that point to directories.
# Put the list in $all_dirs.
newdirs=
for d in $dirs
do
- echo " Searching $INPUT/$d"
+ if test $VERBOSE -gt 1
+ then echo " Searching $INPUT/$d" ; fi
# Find all directories under $d, relative to $d, excluding $d itself.
# (The /. is needed after $d in case $d is a symlink.)
# # # # # # # # # # # # # # # # # # # # #
#
dirs=
-echo "All directories (including links to directories):"
-echo $all_dirs
+if test $VERBOSE -gt 2
+then echo "All directories (including links to directories):"
+ echo $all_dirs
+fi
for file in $all_dirs; do
rm -rf $LIB/$file
treetops=". ${LIB}"
if $LINKS; then
- echo 'Making symbolic directory links'
+ if test $VERBOSE -gt 1
+ then echo 'Making symbolic directory links' ; fi
cwd=`${PWDCMD}`
for sym_link in $search_dirs; do
# If a link points to ., make a similar link to .
#
if [ ${full_dest_dir} = ${cinput} ]; then
- echo ${sym_link} '->' . ': Making self link'
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' . ': Making self link' ; fi
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
# DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
dots=`echo "${sym_link}" |
sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
- echo ${sym_link} '->' $dots$y ': Making local link'
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' $dots$y ': Making local link' ; fi
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
# and process $target into ${INPUT}/root$target
# treat this directory as if it actually contained the files.
#
- echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
+ fi
if [ -d $LIB/root${full_dest_dir} ]
then true
else
${sym_link}/*)
dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
sed -n "s|^${sym_link}/||p"`
- echo "Duplicating ${sym_link}'s ${dupdir}"
+ if test $VERBOSE -gt 2
+ then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi
if [ -d ${dupdir} ]
then true
else
then continue ; fi
touch ${DESTDIR}/DONE
- echo Fixing directory ${SRCDIR} into ${DESTDIR}
+ if test $VERBOSE -gt 1
+ then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi
# Check files which are symlinks as well as those which are files.
#
cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
chmod +w $3 2>/dev/null
chmod a+r $3 2>/dev/null
- echo Copied $2
+ if test $VERBOSE -gt 2
+ then echo Copied $2 ; fi
for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 |
sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
do
shift
done
-echo 'Cleaning up DONE files.'
+if test $VERBOSE -gt 2
+then echo 'Cleaning up DONE files.' ; fi
cd $LIB
find . -name DONE -exec rm -f '{}' ';'
-echo 'Removing unneeded directories:'
+if test $VERBOSE -gt 1
+then echo 'Cleaning up unneeded directories:' ; fi
cd $LIB
all_dirs=`find . -type d \! -name '.' -print | sort -r`
for file in $all_dirs; do
rmdir $LIB/$file > /dev/null 2>&1
done
+if test $VERBOSE -gt 0
+then echo fixincludes is done ; fi
+
# # # # # # # # # # # # # # # # # # # # #
#
# End of for INPUT directories