Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
99d05d99
Commit
99d05d99
authored
May 14, 2000
by
Bruce Korb
Committed by
Bruce Korb
May 14, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add several tests and use the ``c_fix = format'' fixer more
From-SVN: r33895
parent
5ba02ca6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
240 additions
and
126 deletions
+240
-126
gcc/ChangeLog
+3
-0
gcc/fixinc/check.diff
+79
-3
gcc/fixinc/check.tpl
+5
-1
gcc/fixinc/fixincl.x
+86
-78
gcc/fixinc/inclhack.def
+67
-44
No files found.
gcc/ChangeLog
View file @
99d05d99
...
...
@@ -14,8 +14,11 @@
*
fixinc
/
fixlib
.
h
(
must_malloc
)
:
+
reformatting
*
fixinc
/
inclhack
.
def
:
replace
the
"1i"
and
"$a"
sed
commands
with
usages
of
``
c_fix
=
wrap
;
''
Add
several
tests
and
use
the
``
c_fix
=
format
''
fixer
more
.
*
fixinc
/
fixincl
.
x
:
regen
*
fixinc
/
check
.
diff
:
regen
*
fixinc
/
check
.
tpl
:
emit
the
associated
header
with
the
missing
test
message
Sun
May
14
17
:
58
:
59
2000
Hans
-
Peter
Nilsson
<
hp
@axis
.
com
>
...
...
gcc/fixinc/check.diff
View file @
99d05d99
...
...
@@ -444,14 +444,90 @@
*** inc/sys/wait.h
--- res/sys/wait.h
***************
*** 2,
6
****
--- 2,
7
----
*** 2,
7
****
--- 2,
8
----
#ifndef AIX_SYSWAIT_CHECK
/* bos325, */
+ struct rusage;
extern pid_t wait3();
/* pid_t wait3(int *, int, struct rusage *); */
#endif /* AIX_SYSWAIT_CHECK */
*** inc/testing.h
--- res/testing.h
***************
*** 1,33 ****
#ifndef IO_QUOTES_DEF_CHECK
! #define BSD43__IOWR(n, x) (('n'<<8)+x)
#endif /* IO_QUOTES_DEF_CHECK */
#ifndef IO_QUOTES_USE_CHECK
! #define TIOCFOO BSD43__IOWR(T, 1)
#endif /* IO_QUOTES_USE_CHECK */
#ifndef CTRL_QUOTES_DEF_CHECK
! #define BSD43_CTRL(n, x) (('n'<<8)+x)
#endif /* CTRL_QUOTES_DEF_CHECK */
#ifndef CTRL_QUOTES_USE_CHECK
! #define TIOCFOO BSD43_CTRL(T, 1)
#endif /* CTRL_QUOTES_USE_CHECK */
#ifndef MACHINE_NAME_CHECK
! #ifdef i386 /* no uniform machine_name test, so
this only works on i?86 machines */
#endif /* MACHINE_NAME_CHECK */
#ifndef UNDEFINE_NULL_CHECK
#define NULL 0UL
#define NULL ((void*)0)
#endif /* UNDEFINE_NULL_CHECK */
--- 1,37 ----
#ifndef IO_QUOTES_DEF_CHECK
! #define BSD43__IOWR(n, x) ((n<<8)+x)
#endif /* IO_QUOTES_DEF_CHECK */
#ifndef IO_QUOTES_USE_CHECK
! #define TIOCFOO BSD43__IOWR('T', 1)
#endif /* IO_QUOTES_USE_CHECK */
#ifndef CTRL_QUOTES_DEF_CHECK
! #define BSD43_CTRL(n, x) ((n<<8)+x)
#endif /* CTRL_QUOTES_DEF_CHECK */
#ifndef CTRL_QUOTES_USE_CHECK
! #define TIOCFOO BSD43_CTRL('T', 1)
#endif /* CTRL_QUOTES_USE_CHECK */
#ifndef MACHINE_NAME_CHECK
! #ifdef __i386__ /* no uniform machine_name test, so
this only works on i?86 machines */
#endif /* MACHINE_NAME_CHECK */
#ifndef UNDEFINE_NULL_CHECK
+ #ifndef NULL
#define NULL 0UL
+ #endif
+ #ifndef NULL
#define NULL ((void*)0)
+ #endif
#endif /* UNDEFINE_NULL_CHECK */
*** inc/time.h
--- res/time.h
***************
...
...
@@ -480,5 +556,5 @@
#ifndef ALPHA_SBRK_CHECK
! extern void
*
sbrk(ptrdiff_t increment);
! extern void
*
sbrk(ptrdiff_t increment);
#endif /* ALPHA_SBRK_CHECK */
gcc/fixinc/check.tpl
View file @
99d05d99
...
...
@@ -29,7 +29,11 @@ _FOR fix =][=
_IF test_text _exist ! =][=
_IF replace _exist ! =]
echo No test for [=hackname=][=
echo No test for [=hackname=] in inc/[=
_IF files _exist =][=
files[0] =][=
_ELSE =]testing.h[=
_ENDIF =][=
_ENDIF =][=
_ELSE =]
cat >> inc/[=
...
...
gcc/fixinc/fixincl.x
View file @
99d05d99
...
...
@@ -803,8 +803,9 @@ tTestDesc aAix_VolatileTests[] = {
/*
* Fix Command Arguments for Aix_Volatile
*/
const char* apzAix_VolatilePatch[] = { "sed",
"-e", "s/typedef volatile int sig_atomic_t/typedef int sig_atomic_t/",
const char* apzAix_VolatilePatch[] = {
"format",
"typedef int sig_atomic_t",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
...
...
@@ -838,8 +839,9 @@ tTestDesc aAlpha_GetoptTests[] = {
/*
* Fix Command Arguments for Alpha_Getopt
*/
const char* apzAlpha_GetoptPatch[] = { "sed",
"-e", "s/getopt(int, char \\*\\[\\],[ ]*char \\*)/getopt(int, char *const[], const char *)/",
const char* apzAlpha_GetoptPatch[] = {
"format",
"getopt(int, char *const[], const char *)",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
...
...
@@ -873,8 +875,9 @@ tTestDesc aAlpha_ParensTests[] = {
/*
* Fix Command Arguments for Alpha_Parens
*/
const char* apzAlpha_ParensPatch[] = { "sed",
"-e", "s/#ifndef(__mips64)/#ifndef __mips64/",
const char* apzAlpha_ParensPatch[] = {
"format",
"#ifndef __mips64",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
...
...
@@ -908,8 +911,9 @@ tTestDesc aAlpha_SbrkTests[] = {
/*
* Fix Command Arguments for Alpha_Sbrk
*/
const char* apzAlpha_SbrkPatch[] = { "sed",
"-e", "s/char\\([ \t]*\\*[\t ]*sbrk[ \t]*(\\)/void\\1/",
const char* apzAlpha_SbrkPatch[] = {
"format",
"void *sbrk(",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
...
...
@@ -1659,44 +1663,9 @@ const char* apzIsc_Omits_With_StdcPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Io_Quotes_Use fix
*/
#define IO_QUOTES_USE_FIXIDX 38
tSCC zIo_Quotes_UseName[] =
"io_quotes_use";
/*
* File name selection pattern
*/
#define zIo_Quotes_UseList (char*)NULL
/*
* Machine/OS name selection pattern
*/
#define apzIo_Quotes_UseMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
tSCC zIo_Quotes_UseSelect0[] =
"define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+IO[A-Z]*[ \t]*\\( *[^,']";
#define IO_QUOTES_USE_TEST_CT 1
tTestDesc aIo_Quotes_UseTests[] = {
{ TT_EGREP, zIo_Quotes_UseSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Io_Quotes_Use
*/
const char* apzIo_Quotes_UsePatch[] = {
"char_macro_use",
"IO",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Io_Quotes_Def fix
*/
#define IO_QUOTES_DEF_FIXIDX 3
9
#define IO_QUOTES_DEF_FIXIDX 3
8
tSCC zIo_Quotes_DefName[] =
"io_quotes_def";
...
...
@@ -1729,44 +1698,44 @@ const char* apzIo_Quotes_DefPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of
Ctrl
_Quotes_Use fix
* Description of
Io
_Quotes_Use fix
*/
#define
CTRL_QUOTES_USE_FIXIDX 40
tSCC z
Ctrl
_Quotes_UseName[] =
"
ctrl
_quotes_use";
#define
IO_QUOTES_USE_FIXIDX 39
tSCC z
Io
_Quotes_UseName[] =
"
io
_quotes_use";
/*
* File name selection pattern
*/
#define z
Ctrl
_Quotes_UseList (char*)NULL
#define z
Io
_Quotes_UseList (char*)NULL
/*
* Machine/OS name selection pattern
*/
#define apz
Ctrl
_Quotes_UseMachs (const char**)NULL
#define apz
Io
_Quotes_UseMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
tSCC z
Ctrl
_Quotes_UseSelect0[] =
"define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+
CTRL
[ \t]*\\( *[^,']";
tSCC z
Io
_Quotes_UseSelect0[] =
"define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+
IO[A-Z]*
[ \t]*\\( *[^,']";
#define
CTRL
_QUOTES_USE_TEST_CT 1
tTestDesc a
Ctrl
_Quotes_UseTests[] = {
{ TT_EGREP, z
Ctrl
_Quotes_UseSelect0, (regex_t*)NULL }, };
#define
IO
_QUOTES_USE_TEST_CT 1
tTestDesc a
Io
_Quotes_UseTests[] = {
{ TT_EGREP, z
Io
_Quotes_UseSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for
Ctrl
_Quotes_Use
* Fix Command Arguments for
Io
_Quotes_Use
*/
const char* apz
Ctrl
_Quotes_UsePatch[] = {
const char* apz
Io
_Quotes_UsePatch[] = {
"char_macro_use",
"
CTRL
",
"
IO
",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Ctrl_Quotes_Def fix
*/
#define CTRL_QUOTES_DEF_FIXIDX 4
1
#define CTRL_QUOTES_DEF_FIXIDX 4
0
tSCC zCtrl_Quotes_DefName[] =
"ctrl_quotes_def";
...
...
@@ -1799,6 +1768,41 @@ const char* apzCtrl_Quotes_DefPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Ctrl_Quotes_Use fix
*/
#define CTRL_QUOTES_USE_FIXIDX 41
tSCC zCtrl_Quotes_UseName[] =
"ctrl_quotes_use";
/*
* File name selection pattern
*/
#define zCtrl_Quotes_UseList (char*)NULL
/*
* Machine/OS name selection pattern
*/
#define apzCtrl_Quotes_UseMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
tSCC zCtrl_Quotes_UseSelect0[] =
"define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+CTRL[ \t]*\\( *[^,']";
#define CTRL_QUOTES_USE_TEST_CT 1
tTestDesc aCtrl_Quotes_UseTests[] = {
{ TT_EGREP, zCtrl_Quotes_UseSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Ctrl_Quotes_Use
*/
const char* apzCtrl_Quotes_UsePatch[] = {
"char_macro_use",
"CTRL",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Ip_Missing_Semi fix
*/
#define IP_MISSING_SEMI_FIXIDX 42
...
...
@@ -4206,13 +4210,13 @@ tSCC zUndefine_NullName[] =
* content selection pattern - do fix if pattern found
*/
tSCC zUndefine_NullSelect0[] =
"^#[ \t]*define[ \t]
*[ \t]NULL[ \t\r
]";
"^#[ \t]*define[ \t]
+NULL[ \t
]";
/*
* content bypass pattern - skip fix if pattern found
*/
tSCC zUndefine_NullBypass0[] =
"#[ \t]*(ifn|un)def[ \t]
*[ \t]
NULL($|[ \t\r])";
"#[ \t]*(ifn|un)def[ \t]
+
NULL($|[ \t\r])";
#define UNDEFINE_NULL_TEST_CT 2
tTestDesc aUndefine_NullTests[] = {
...
...
@@ -4222,9 +4226,13 @@ tTestDesc aUndefine_NullTests[] = {
/*
* Fix Command Arguments for Undefine_Null
*/
const char* apzUndefine_NullPatch[] = { "sed",
"-e", "/^#[ \t]*define[ \t][ \t]*NULL[ \t\r]/i\\\n\
#undef NULL\n",
const char* apzUndefine_NullPatch[] = {
"format",
"#ifndef NULL%2\n\
#define NULL%1%2\n\
#endif%2\n",
"^#[ \t]*define[ \t]*[ \t]NULL([^\r\n\
]+)([\r]*)\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
...
...
@@ -4763,22 +4771,22 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
{ zAix_VolatileName, zAix_VolatileList,
apzAix_VolatileMachs,
AIX_VOLATILE_TEST_CT, FD_MACH_ONLY,
AIX_VOLATILE_TEST_CT, FD_MACH_ONLY
| FD_SUBROUTINE
,
aAix_VolatileTests, apzAix_VolatilePatch },
{ zAlpha_GetoptName, zAlpha_GetoptList,
apzAlpha_GetoptMachs,
ALPHA_GETOPT_TEST_CT, FD_MACH_ONLY,
ALPHA_GETOPT_TEST_CT, FD_MACH_ONLY
| FD_SUBROUTINE
,
aAlpha_GetoptTests, apzAlpha_GetoptPatch },
{ zAlpha_ParensName, zAlpha_ParensList,
apzAlpha_ParensMachs,
ALPHA_PARENS_TEST_CT, FD_MACH_ONLY,
ALPHA_PARENS_TEST_CT, FD_MACH_ONLY
| FD_SUBROUTINE
,
aAlpha_ParensTests, apzAlpha_ParensPatch },
{ zAlpha_SbrkName, zAlpha_SbrkList,
apzAlpha_SbrkMachs,
ALPHA_SBRK_TEST_CT, FD_MACH_ONLY,
ALPHA_SBRK_TEST_CT, FD_MACH_ONLY
| FD_SUBROUTINE
,
aAlpha_SbrkTests, apzAlpha_SbrkPatch },
{ zArm_Norcroft_HintName, zArm_Norcroft_HintList,
...
...
@@ -4881,26 +4889,26 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
ISC_OMITS_WITH_STDC_TEST_CT, FD_MACH_ONLY,
aIsc_Omits_With_StdcTests, apzIsc_Omits_With_StdcPatch },
{ zIo_Quotes_UseName, zIo_Quotes_UseList,
apzIo_Quotes_UseMachs,
IO_QUOTES_USE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIo_Quotes_UseTests, apzIo_Quotes_UsePatch },
{ zIo_Quotes_DefName, zIo_Quotes_DefList,
apzIo_Quotes_DefMachs,
IO_QUOTES_DEF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIo_Quotes_DefTests, apzIo_Quotes_DefPatch },
{ z
Ctrl_Quotes_UseName, zCtrl
_Quotes_UseList,
apz
Ctrl
_Quotes_UseMachs,
CTRL
_QUOTES_USE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
a
Ctrl_Quotes_UseTests, apzCtrl
_Quotes_UsePatch },
{ z
Io_Quotes_UseName, zIo
_Quotes_UseList,
apz
Io
_Quotes_UseMachs,
IO
_QUOTES_USE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
a
Io_Quotes_UseTests, apzIo
_Quotes_UsePatch },
{ zCtrl_Quotes_DefName, zCtrl_Quotes_DefList,
apzCtrl_Quotes_DefMachs,
CTRL_QUOTES_DEF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aCtrl_Quotes_DefTests, apzCtrl_Quotes_DefPatch },
{ zCtrl_Quotes_UseName, zCtrl_Quotes_UseList,
apzCtrl_Quotes_UseMachs,
CTRL_QUOTES_USE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aCtrl_Quotes_UseTests, apzCtrl_Quotes_UsePatch },
{ zIp_Missing_SemiName, zIp_Missing_SemiList,
apzIp_Missing_SemiMachs,
IP_MISSING_SEMI_TEST_CT, FD_MACH_ONLY,
...
...
@@ -5223,7 +5231,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
{ zUndefine_NullName, zUndefine_NullList,
apzUndefine_NullMachs,
UNDEFINE_NULL_TEST_CT, FD_MACH_ONLY,
UNDEFINE_NULL_TEST_CT, FD_MACH_ONLY
| FD_SUBROUTINE
,
aUndefine_NullTests, apzUndefine_NullPatch },
{ zUnixware7_Byteorder_FixName, zUnixware7_Byteorder_FixList,
...
...
gcc/fixinc/inclhack.def
View file @
99d05d99
...
...
@@ -517,8 +517,8 @@ fix = {
/*
* sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the
definition
*
of struct rusage, so the prototype (added by fixproto) causes havoc
.
* sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the
*
definition of struct rusage, so the prototype added by fixproto fails
.
*/
fix = {
hackname = aix_syswait;
...
...
@@ -527,7 +527,9 @@ fix = {
select = "bos325,";
c_fix = format;
c_fix_arg = "struct rusage;\n%0";
test_text = "/* bos325, */\nextern pid_t wait3();";
test_text = "/* bos325, */\n"
"extern pid_t wait3();\n"
"\t/* pid_t wait3(int *, int, struct rusage *); */";
};
...
...
@@ -541,8 +543,8 @@ fix = {
hackname = aix_volatile;
files = sys/signal.h;
select = "typedef volatile int sig_atomic_t";
sed = "s/typedef volatile int sig_atomic_t"
"/typedef int sig_atomic_t/
";
c_fix = format;
c_fix_arg = "typedef int sig_atomic_t
";
test_text = "typedef volatile int sig_atomic_t;";
};
...
...
@@ -555,8 +557,8 @@ fix = {
files = "stdio.h";
files = "stdlib.h";
select = 'getopt\(int, char \*\[\], *char \*\)';
sed = 's/getopt(int, char \*\[\],[ ]*char \*)/'
'getopt(int, char *const[], const char *)/'
;
c_fix = format;
c_fix_arg = "getopt(int, char *const[], const char *)"
;
test_text = 'extern int getopt(int, char *[], char *);';
};
...
...
@@ -568,7 +570,8 @@ fix = {
hackname = alpha_parens;
files = sym.h;
select = '#ifndef\(__mips64\)';
sed = "s/#ifndef(__mips64)/#ifndef __mips64/";
c_fix = format;
c_fix_arg = "#ifndef __mips64";
test_text = "#ifndef(__mips64) /* bogus */\nextern int foo;\n#endif";
};
...
...
@@ -580,7 +583,8 @@ fix = {
hackname = alpha_sbrk;
files = unistd.h;
select = "char[ \t]*\\*[\t ]*sbrk[ \t]*\\(";
sed = "s/char\\([ \t]*\\*[\t ]*sbrk[ \t]*(\\)/void\\1/";
c_fix = format;
c_fix_arg = "void *sbrk(";
test_text = "extern char* sbrk(ptrdiff_t increment);";
};
...
...
@@ -968,59 +972,71 @@ fix = {
};
/*
* Fix various macros used to define ioctl numbers. The traditional
* syntax was
* #define _IO(n, x) (('n'<<8)+x)
* #define TIOCFOO _IO(T, 1)
* Fix various macros used to define ioctl numbers.
* The traditional syntax was:
*
* #define _IO(n, x) (('n'<<8)+x)
* #define TIOCFOO _IO(T, 1)
*
* but this does not work with the C standard, which disallows macro
* expansion inside strings. We have to rewrite it thus:
* #define _IO(n, x) ((n<<8)+x)
* #define TIOCFOO _IO('T', 1)
*
* #define _IO(n, x) ((n<<8)+x)
* #define TIOCFOO _IO('T', 1)
*
* The select expressions match too much, but the c_fix code is cautious.
*
* _IO might be: _IO DESIO BSD43__IO with W, R, WR, C, ... suffixes.
*/
fix = {
hackname = io_quotes_use;
select = "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+IO[A-Z]*[ \t]*"
"\\( *[^,']";
c_fix = char_macro_use;
hackname = io_quotes_def;
select = "define[ \t]+[A-Z0-9_]+IO[A-Z]*\\(([a-zA-Z]).*'\\1'";
c_fix = char_macro_def;
c_fix_arg = "IO";
test_text = "#define BSD43__IOWR(n, x) (('n'<<8)+x)";
};
fix = {
hackname = io_quotes_def;
select = "define[ \t]+[A-Z0-9_]+IO[A-Z]*\\(([a-zA-Z]).*'\\1'";
c_fix = char_macro_def;
hackname = io_quotes_use;
select = "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+IO[A-Z]*[ \t]*"
"\\( *[^,']";
c_fix = char_macro_use;
c_fix_arg = "IO";
test_text = "#define TIOCFOO BSD43__IOWR(T, 1)";
};
/*
* Fix various macros used to define ioctl numbers. The traditional
* syntax was
* #define _CTRL(n, x) (('n'<<8)+x)
* #define TIOCFOO _CTRL(T, 1)
* Fix various macros used to define ioctl numbers.
* The traditional syntax was:
*
* #define _CTRL(n, x) (('n'<<8)+x)
* #define TCTRLCFOO _CTRL(T, 1)
*
* but this does not work with the C standard, which disallows macro
* expansion inside strings. We have to rewrite it thus:
* #define _CTRL(n, x) ((n<<8)+x)
* #define TIOCFOO _CTRL('T', 1)
*
* #define _CTRL(n, x) ((n<<8)+x)
* #define TCTRLCFOO _CTRL('T', 1)
*
* The select expressions match too much, but the c_fix code is cautious.
*
* CTRL might be: CTRL _CTRL ISCTRL BSD43_CTRL ...
*/
fix = {
hackname = ctrl_quotes_use;
select = "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+CTRL[ \t]*\\( *[^,']";
c_fix = char_macro_use;
c_fix_arg = "CTRL";
};
fix = {
hackname = ctrl_quotes_def;
select = "define[ \t]+[A-Z0-9_]+CTRL\\(([a-zA-Z]).*'\\1'";
c_fix = char_macro_def;
c_fix_arg = "CTRL";
test_text = "#define BSD43_CTRL(n, x) (('n'<<8)+x)";
};
fix = {
hackname = ctrl_quotes_use;
select = "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+CTRL[ \t]*\\( *[^,']";
c_fix = char_macro_use;
c_fix_arg = "CTRL";
test_text = "#define TIOCFOO BSD43_CTRL(T, 1)";
};
...
...
@@ -1293,9 +1309,11 @@ fix = {
* Fix non-ansi machine name defines
*/
fix = {
hackname = machine_name;
c_test = machine_name;
c_fix = machine_name;
hackname = machine_name;
c_test = machine_name;
c_fix = machine_name;
test_text = "#ifdef i386 /* no uniform machine_name test, so\n"
" this only works on i?86 machines */";
};
...
...
@@ -2459,14 +2477,19 @@ fix = {
/*
* Fix multiple defines for NULL
* Fix multiple defines for NULL. Sometimes, we stumble into \r\n
* terminated lines, so accommodate these. Test both ways.
*/
fix = {
hackname = undefine_null;
select = "^#[ \t]*define[ \t]*[ \t]NULL[ \t\r]";
bypass = "#[ \t]*(ifn|un)def[ \t]*[ \t]NULL($|[ \t\r])";
sed = "/^#[ \t]*define[ \t][ \t]*NULL[ \t\r]/i\\\n"
"#undef NULL\n";
hackname = undefine_null;
select = "^#[ \t]*define[ \t]+NULL[ \t]";
bypass = "#[ \t]*(ifn|un)def[ \t]+NULL($|[ \t\r])";
c_fix = format;
c_fix_arg = "#ifndef NULL%2\n#define NULL%1%2\n#endif%2\n";
c_fix_arg = "^#[ \t]*define[ \t]*[ \t]NULL([^\r\n]+)([\r]*)\n";
test_text = "#define NULL 0UL\r\n#define NULL\t((void*)0)\n";
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment