Commit a8228686 by Bruce Korb Committed by Bruce Korb

yet more applications of c_fix=format + tests

From-SVN: r34055
parent fbd40359
......@@ -24,6 +24,7 @@
* fixinc/inclhack.def: more applications of c_fix=format + tests
* fixinc/check.diff: regenerated
* fixinc/fixincl.x: regenerated
Sat May 20 09:30:55 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
......@@ -81,6 +81,36 @@
};
! extern Wedged( Widget c_new, Widget old );
#endif /* X11_NEW_CHECK */
*** inc/ansi/math.h
--- res/ansi/math.h
***************
*** 1,5 ****
#if defined( NEXT_MATH_PREFIX_CHECK )
! extern double __const__ mumble();
#endif /* NEXT_MATH_PREFIX_CHECK */
--- 1,5 ----
#if defined( NEXT_MATH_PREFIX_CHECK )
! extern double mumble();
#endif /* NEXT_MATH_PREFIX_CHECK */
*** inc/ansi/stdlib.h
--- res/ansi/stdlib.h
***************
*** 1,5 ****
#if defined( NEXT_VOLITILE_CHECK )
! extern volatile void abort();
#endif /* NEXT_VOLITILE_CHECK */
--- 1,5 ----
#if defined( NEXT_VOLITILE_CHECK )
! extern void abort();
#endif /* NEXT_VOLITILE_CHECK */
*** inc/assert.h
--- res/assert.h
***************
......@@ -109,6 +139,21 @@
+ #endif /* FIXINC_BROKEN_ASSERT_STDIO_CHECK */
+
+ #endif /* FIXINC_BROKEN_ASSERT_STDLIB_CHECK */
*** inc/bsd/libc.h
--- res/bsd/libc.h
***************
*** 1,5 ****
#if defined( NEXT_TEMPLATE_CHECK )
! extern mumble( char * template); /* fix */
#endif /* NEXT_TEMPLATE_CHECK */
--- 1,5 ----
#if defined( NEXT_TEMPLATE_CHECK )
! extern mumble( char *); /* fix */
#endif /* NEXT_TEMPLATE_CHECK */
*** inc/c_asm.h
--- res/c_asm.h
***************
......@@ -235,10 +280,25 @@
# define DBL_DIG 0 /* somthin' */
+ #endif
#endif /* LIMITS_IFNDEFS_CHECK */
*** inc/machine/ansi.h
--- res/machine/ansi.h
***************
*** 1,5 ****
#if defined( MACHINE_ANSI_H_VA_LIST_CHECK )
! # define _BSD_VA_LIST_ char**
#endif /* MACHINE_ANSI_H_VA_LIST_CHECK */
--- 1,5 ----
#if defined( MACHINE_ANSI_H_VA_LIST_CHECK )
! # define _BSD_VA_LIST_ __builtin_va_list
#endif /* MACHINE_ANSI_H_VA_LIST_CHECK */
*** inc/math.h
--- res/math.h
***************
*** 1,44 ****
*** 1,41 ****
#if defined( BROKEN_CABS_CHECK )
......@@ -280,10 +340,7 @@
#endif /* M88K_BAD_HYPOT_OPT_CHECK */
#if defined( MATH_EXCEPTION_CHECK )
typedef struct exception t_math_exception;
#endif /* MATH_EXCEPTION_CHECK */
--- 1,69 ----
--- 1,61 ----
+ #ifndef FIXINC_MATH_EXCEPTION_CHECK
+ #define FIXINC_MATH_EXCEPTION_CHECK 1
+
......@@ -345,9 +402,16 @@
#endif /* M88K_BAD_HYPOT_OPT_CHECK */
#if defined( MATH_EXCEPTION_CHECK )
typedef struct exception t_math_exception;
#endif /* MATH_EXCEPTION_CHECK */
***************
*** 45,49 ****
--- 65,76 ----
#if defined( MATH_HUGE_VAL_IFNDEF_CHECK )
+ #ifndef HUGE_VAL
# define HUGE_VAL 3.4e+40
+ #endif
#endif /* MATH_HUGE_VAL_IFNDEF_CHECK */
+ #ifdef __cplusplus
+ #undef exception
+ #endif
......@@ -469,7 +533,7 @@
*** inc/stdlib.h
--- res/stdlib.h
***************
*** 1,7 ****
*** 1,12 ****
#if defined( ARM_WCHAR_CHECK )
......@@ -477,7 +541,12 @@
! # define __wchar_t short
# endif /* __wchar_t */
#endif /* ARM_WCHAR_CHECK */
--- 1,7 ----
#if defined( NEWS_OS_RECURSION_CHECK )
#include <stdlib.h>
#endif /* NEWS_OS_RECURSION_CHECK */
--- 1,14 ----
#if defined( ARM_WCHAR_CHECK )
......@@ -485,6 +554,13 @@
! # define _GCC_WCHAR_T short
# endif /* __wchar_t */
#endif /* ARM_WCHAR_CHECK */
#if defined( NEWS_OS_RECURSION_CHECK )
+ #ifdef BOGUS_RECURSION
#include <stdlib.h>
+ #endif
#endif /* NEWS_OS_RECURSION_CHECK */
*** inc/sundev/vuid_event.h
--- res/sundev/vuid_event.h
***************
......@@ -729,7 +805,7 @@
*** inc/testing.h
--- res/testing.h
***************
*** 1,35 ****
*** 1,36 ****
#if defined( CTRL_QUOTES_DEF_CHECK )
......@@ -763,7 +839,7 @@
#define NULL ((void*)0)
#endif /* UNDEFINE_NULL_CHECK */
--- 1,39 ----
--- 1,40 ----
#if defined( CTRL_QUOTES_DEF_CHECK )
......
......@@ -611,8 +611,11 @@ fix = {
hackname = arm_wchar;
files = stdlib.h;
select = "#[ \t]*define[ \t]*__wchar_t";
sed = "s/\\(#[ \t]*ifndef[ \t]*\\)__wchar_t/\\1_GCC_WCHAR_T/";
sed = "s/\\(#[ \t]*define[ \t]*\\)__wchar_t/\\1_GCC_WCHAR_T/";
c_fix = format;
c_fix_arg = "%1_GCC_WCHAR_T";
c_fix_arg = "(#[ \t]*(ifndef|define)[ \t]+)__wchar_t";
test_text =
"# ifndef \t __wchar_t /* we don't have wchar_t yet, ... */\n"
"# define __wchar_t short\n"
......@@ -651,6 +654,7 @@ fix = {
files = tinfo.h;
select = "#[ \t]*define[ \t]+bool[ \t]";
bypass = "we must use the C\\+\\+ compiler's type";
c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
......@@ -667,6 +671,7 @@ fix = {
files = tinfo.h;
select = "^[ \t]*typedef[ \t].*[ \t]bool[ \t]*;";
bypass = "we must use the C\\+\\+ compiler's type";
c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
......@@ -684,6 +689,12 @@ fix = {
* properly in most cases, they don't allow you to take a pointer to the
* "something" being modified. To get around this limitation, change these
* statements to be of the form '#define something _FOOsomething'.
*
* sed ain't egrep, lesson 2463: sed can use self-referential
* regular expressions. In the substitute expression below,
* "\\1" and "\\2" refer to subexpressions found earlier in the
* same match. So, we continue to use sed. "extern_prefix" will
* be a rare match anyway...
*/
fix = {
hackname = bad_lval;
......@@ -1096,7 +1107,10 @@ fix = {
hackname = hpux_systime;
files = sys/time.h;
select = "^extern struct sigevent;";
sed = "s/^extern struct sigevent;/struct sigevent;/";
c_fix = format;
c_fix_arg = "struct sigevent;";
test_text = 'extern struct sigevent;';
};
......@@ -1210,10 +1224,9 @@ fix = {
bypass = "ifndef[ \t]+FLT_MIN";
c_fix = format;
c_fix_arg = "#ifndef %1\n%0#endif\n";
c_fix_arg = "#ifndef %1\n%0\n#endif";
c_fix_arg = "^[ \t]*#[ \t]*define[ \t]+"
"((FLT|DBL)_(MIN|MAX|DIG))"
"[ \t][^\n]*\n";
"((FLT|DBL)_(MIN|MAX|DIG))[ \t].*";
test_text = " #\tdefine\tDBL_DIG \t 0 /* somthin' */";
};
......@@ -1312,10 +1325,14 @@ fix = {
fix = {
hackname = machine_ansi_h_va_list;
files = machine/ansi.h;
select = '_BSD_VA_LIST_';
select = "define[ \t]+_BSD_VA_LIST_[ \t]";
bypass = '__builtin_va_list';
sed = "s/\\(_BSD_VA_LIST_[ \t][ \t]*\\).*$/\\1__builtin_va_list/";
c_fix = format;
c_fix_arg = "%1__builtin_va_list";
c_fix_arg = "(define[ \t]+_BSD_VA_LIST_[ \t]+).*";
test_text = " # define _BSD_VA_LIST_\tchar**";
};
......@@ -1326,11 +1343,10 @@ fix = {
hackname = machine_name;
c_test = machine_name;
c_fix = machine_name;
test_text =
"#if /* MACH_DIFF: */ \\\n"
"\t defined( i386 ) \\\n"
"\t|| defined( sparc ) /*\n"
"no uniform test, so be careful :-) */";
test_text = "/* MACH_DIFF: */\n"
"#if defined( i386 )"
" || defined( sparc )"
"\n/* no uniform test, so be careful :-) */";
};
......@@ -1347,7 +1363,7 @@ fix = {
hackname = math_exception;
files = math.h;
select = "struct exception";
bypass = "We have a problem when using C\\+\\+";
bypass = 'We have a problem when using C\+\+';
c_fix = wrap;
c_fix_arg = "#ifdef __cplusplus\n"
......@@ -1361,6 +1377,13 @@ fix = {
test_text = "typedef struct exception t_math_exception;";
};
/*
* This looks pretty broken to me. ``dbl_max_def'' will contain
* "define DBL_MAX " at the start, when what we really want is just
* the value portion. Can't figure out how to write a test case
* for this either :-(
*/
fix = {
hackname = math_huge_val_from_dbl_max;
files = math.h;
......@@ -1387,16 +1410,21 @@ fix = {
"\tfi";
};
/*
* In any case, put #ifndef .. #endif around #define HUGE_VAL in math.h.
*/
fix = {
hackname = math_huge_val_ifndef;
files = math.h;
files = math/math.h;
select = "define[ \t]*HUGE_VAL";
select = "define[ \t]+HUGE_VAL";
c_fix = format;
c_fix_arg = "#ifndef HUGE_VAL\n%0\n#endif";
c_fix_arg = "^[ \t]*#[ \t]*define[ \t]+HUGE_VAL[ \t].*";
sed = "/define[ \t]HUGE_VAL[ \t]/i\\\n#ifndef HUGE_VAL\n";
sed = "/define[ \t]HUGE_VAL[ \t]/a\\\n#endif\n";
test_text = "# define\tHUGE_VAL 3.4e+40";
};
......@@ -1457,11 +1485,11 @@ fix = {
fix = {
hackname = news_os_recursion;
files = stdlib.h;
select = "#include <stdlib.h>";
sed = "/^#include <stdlib.h>/i\\\n"
"#ifdef BOGUS_RECURSION\n";
sed = "/^#include <stdlib.h>/a\\\n"
"#endif\n";
select = '#include <stdlib\.h>';
c_fix = format;
c_fix_arg = "#ifdef BOGUS_RECURSION\n%0\n#endif";
test_text = "#include <stdlib.h>";
};
......@@ -1472,30 +1500,30 @@ fix = {
fix = {
hackname = next_math_prefix;
files = ansi/math.h;
select = "^extern.*double.*__const__.*";
select = "^extern[ \t]+double[ \t]+__const__[ \t]";
c_fix = format;
c_fix_arg = "extern double %1(";
c_fix_arg = "^extern[ \t]+double[ \t]+__const__[ \t]+([a-z]+)\\(";
sed = "/^extern.*double.*__const__.*sqrt(/s/__const__//";
sed = "/^extern.*double.*__const__.*fabs(/s/__const__//";
sed = "/^extern.*double.*__const__.*cos(/s/__const__//";
sed = "/^extern.*double.*__const__.*hypot(/s/__const__//";
sed = "/^extern.*double.*__const__.*sin(/s/__const__//";
test_text = "extern\tdouble\t__const__\tmumble();";
};
/*
* NeXT 3.2 uses the word "template" as a parameter for some
* functions. GCC reports an invalid use of a reserved key word
* with the built-in functions. NeXT 3.2 includes the keyword
* volatile in the prototype for abort(). This conflicts with
* the built-in definition.
* with the built-in functions.
*/
fix = {
hackname = next_template;
files = bsd/libc.h;
select = template;
select = "[ \t]template\\)";
sed = '/\(.*template\)/s/template//';
sed = "/extern.*volatile.*void.*abort/s/volatile//";
c_fix = format;
c_fix_arg = "(%1)";
c_fix_arg = "\\(([^)]*)[ \t]template\\)";
test_text = "extern mumble( char * template); /* fix */";
};
......@@ -1506,10 +1534,13 @@ fix = {
fix = {
hackname = next_volitile;
files = ansi/stdlib.h;
select = volatile;
select = "^extern[ \t]+volatile[ \t]+void[ \t]";
c_fix = format;
c_fix_arg = "extern void %1(";
c_fix_arg = "^extern[ \t]+volatile[ \t]+void[ \t]+(exit|abort)\\(";
sed = "/extern.*volatile.*void.*exit/s/volatile//";
sed = "/extern.*volatile.*void.*abort/s/volatile//";
test_text = "extern\tvolatile\tvoid\tabort();";
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment