Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
55548382
Commit
55548382
authored
Nov 04, 2002
by
Patrik Stridvall
Committed by
Alexandre Julliard
Nov 04, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for normal types (not just structures).
parent
7e18d733
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
16 deletions
+86
-16
c_parser.pm
tools/winapi/c_parser.pm
+19
-15
c_type.pm
tools/winapi/c_type.pm
+21
-0
tests.dat
tools/winapi/tests.dat
+0
-0
tests.pm
tools/winapi/tests.pm
+46
-1
winapi_test
tools/winapi/winapi_test
+0
-0
No files found.
tools/winapi/c_parser.pm
View file @
55548382
...
...
@@ -1186,8 +1186,8 @@ sub parse_c_function {
my
$match
;
while
(
$self
->
_parse_c
(
'(?:const|inline|extern(?:\s+\"C\")?|EXTERN_C|static|volatile|'
.
'signed(?=\s+__int
64
\b|\s+char\b|\s+int\b|\s+long(?:\s+long)?\b|\s+short\b)|'
.
'unsigned(?=\s+__int
64
\b|\s+char\b|\s+int\b|\s+long(?:\s+long)?\b|\s+short\b)|'
.
'signed(?=\s+__int
(?:8|16|32|64)
\b|\s+char\b|\s+int\b|\s+long(?:\s+long)?\b|\s+short\b)|'
.
'unsigned(?=\s+__int
(?:8|16|32|64)
\b|\s+char\b|\s+int\b|\s+long(?:\s+long)?\b|\s+short\b)|'
.
'long(?=\s+double\b|\s+int\b|\s+long\b))(?=\b)'
,
\
$_
,
\
$line
,
\
$column
,
\
$match
))
{
...
...
@@ -1933,6 +1933,7 @@ sub parse_c_variable {
my
$begin_column
=
$column
+
1
;
my
$linkage
=
""
;
my
$sign
=
""
;
my
$type
=
""
;
my
$name
=
""
;
...
...
@@ -1940,14 +1941,22 @@ sub parse_c_variable {
my
$match
;
while
(
$self
->
_parse_c
(
'(?:const|inline|extern(?:\s+\"C\")?|EXTERN_C|static|volatile|'
.
'signed(?=\s+__int
64
\b|\s+char\b|\s+int\b|\s+long(?:\s+long)?\b|\s+short\b)|'
.
'unsigned(?=\s+__int
64
\b|\s+char\b|\s+int\b|\s+long(?:\s+long)?\b|\s+short\b)|'
.
'signed(?=\s+__int
(?:8|16|32|64)
\b|\s+char\b|\s+int\b|\s+long(?:\s+long)?\b|\s+short\b)|'
.
'unsigned(?=\s+__int
(?:8|16|32|64)
\b|\s+char\b|\s+int\b|\s+long(?:\s+long)?\b|\s+short\b)|'
.
'long(?=\s+double\b|\s+int\b|\s+long\b))(?=\b)'
,
\
$_
,
\
$line
,
\
$column
,
\
$match
))
{
if
(
$match
=~
/^extern|static$/
)
{
if
(
!
$linkage
)
{
if
(
$match
=~
/^extern|static$/
)
{
if
(
!
$linkage
)
{
$linkage
=
$match
;
}
else
{
$self
->
_parse_c_warning
(
$_
,
$line
,
$column
,
"repeated linkage (ignored): $match"
);
}
}
elsif
(
$match
=~
/^signed|unsigned$/
)
{
if
(
!
$sign
)
{
$sign
=
"$match "
;
}
else
{
$self
->
_parse_c_warning
(
$_
,
$line
,
$column
,
"repeated sign (ignored): $match"
);
}
}
}
...
...
@@ -1970,8 +1979,8 @@ sub parse_c_variable {
}
$finished
=
1
;
}
elsif
(
s/^((?:enum\s+|struct\s+|union\s+)?\w+(?:\s*\*)*)\s*(\w+)\s*(\[.*?\]$|:\s*(\d+)$|\{)?//s
)
{
$type
=
$1
;
}
elsif
(
s/^((?:enum\s+|struct\s+|union\s+)?\w+
\b
(?:\s*\*)*)\s*(\w+)\s*(\[.*?\]$|:\s*(\d+)$|\{)?//s
)
{
$type
=
"$sign$1"
;
$name
=
$2
;
if
(
defined
(
$3
))
{
...
...
@@ -1989,13 +1998,8 @@ sub parse_c_variable {
$type
=
$self
->
_format_c_type
(
$type
);
$finished
=
1
;
}
elsif
(
s/^((?:enum\s+|struct\s+|union\s+)?\w+(?:\s*\*)*\s*\(\s*(?:\*\s*)*)(\w+)\s*(\)\(.*?\))$//s
)
{
$type
=
$self
->
_format_c_type
(
"$1$3"
);
$name
=
$2
;
$finished
=
1
;
$type
=
$self
->
_format_c_type
(
"$1$3"
);
}
elsif
(
s/^((?:enum\s+|struct\s+|union\s+)?\w+\b(?:\s*\*)*\s*\((?:\s*CALLBACK|\s*NTAPI|\s*WINAPI)?(?:\s*\*)*)\s*(\w+)\s*(\)\s*\(.*?\))$//s
)
{
$type
=
$self
->
_format_c_type
(
"$sign$1$3"
);
$name
=
$2
;
$finished
=
1
;
...
...
tools/winapi/c_type.pm
View file @
55548382
...
...
@@ -43,6 +43,17 @@ sub set_find_align_callback {
}
########################################################################
# set_find_kind_callback
#
sub
set_find_kind_callback
{
my
$self
=
shift
;
my
$find_kind
=
\
$
{
$self
->
{
FIND_KIND
}};
$$find_kind
=
shift
;
}
########################################################################
# set_find_size_callback
#
sub
set_find_size_callback
{
...
...
@@ -62,6 +73,10 @@ sub kind {
if
(
defined
(
$_
))
{
$$kind
=
$_
;
$$dirty
=
1
;
}
if
(
!
defined
(
$$kind
))
{
$self
->
_refresh
();
}
return
$$kind
;
}
...
...
@@ -219,6 +234,7 @@ sub _refresh {
return
if
!
$$dirty
;
my
$find_align
=
\
$
{
$self
->
{
FIND_ALIGN
}};
my
$find_kind
=
\
$
{
$self
->
{
FIND_KIND
}};
my
$find_size
=
\
$
{
$self
->
{
FIND_SIZE
}};
my
$align
=
\
$
{
$self
->
{
ALIGN
}};
...
...
@@ -230,6 +246,7 @@ sub _refresh {
my
$field_sizes
=
\
$
{
$self
->
{
FIELD_SIZES
}};
my
$pack
=
$self
->
pack
;
$pack
=
4
if
!
defined
(
$pack
);
my
$max_field_align
=
0
;
...
...
@@ -258,6 +275,10 @@ sub _refresh {
}
}
if
(
$$kind
!~
/^(?:struct|union)$/
)
{
$$kind
=
&
$$find_kind
(
$type_name
)
||
""
;
}
if
(
!
defined
(
$size
))
{
$$align
=
undef
;
$$size
=
undef
;
...
...
tools/winapi/tests.dat
View file @
55548382
This diff is collapsed.
Click to expand it.
tools/winapi/tests.pm
View file @
55548382
...
...
@@ -135,6 +135,46 @@ sub get_test_dirs {
return
sort
(
keys
(
%
test_dirs
));
}
sub
get_sections
{
my
$self
=
shift
;
my
$tests
=
\%
{
$self
->
{
TESTS
}};
my
$test_dir
=
shift
;
my
$test
=
shift
;
my
%
sections
=
();
if
(
defined
(
$test_dir
))
{
if
(
defined
(
$test
))
{
foreach
my
$section
(
sort
(
keys
(
%
{
$$tests
{
$test_dir
}{
$test
}})))
{
$sections
{
$section
}
++
;
}
}
else
{
foreach
my
$test
(
sort
(
keys
(
%
{
$$tests
{
$test_dir
}})))
{
foreach
my
$section
(
sort
(
keys
(
%
{
$$tests
{
$test_dir
}{
$test
}})))
{
$sections
{
$section
}
++
;
}
}
}
}
elsif
(
defined
(
$test
))
{
foreach
my
$test_dir
(
sort
(
keys
(
%
$tests
)))
{
foreach
my
$section
(
sort
(
keys
(
%
{
$$tests
{
$test_dir
}{
$test
}})))
{
$sections
{
$section
}
++
;
}
}
}
else
{
foreach
my
$test_dir
(
sort
(
keys
(
%
$tests
)))
{
foreach
my
$test
(
sort
(
keys
(
%
{
$$tests
{
$test_dir
}})))
{
foreach
my
$section
(
sort
(
keys
(
%
{
$$tests
{
$test_dir
}{
$test
}})))
{
$sections
{
$section
}
++
;
}
}
}
}
return
sort
(
keys
(
%
sections
));
}
sub
get_section
{
my
$self
=
shift
;
...
...
@@ -144,7 +184,12 @@ sub get_section {
my
$test
=
shift
;
my
$section
=
shift
;
return
@
{
$$tests
{
$test_dir
}{
$test
}{
$section
}};
my
$array
=
$$tests
{
$test_dir
}{
$test
}{
$section
};
if
(
defined
(
$array
))
{
return
@$array
;
}
else
{
return
();
}
}
1
;
tools/winapi/winapi_test
View file @
55548382
This diff is collapsed.
Click to expand it.
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