Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
def8d4f4
Commit
def8d4f4
authored
Jul 09, 2009
by
Francois Gouget
Committed by
Alexandre Julliard
Jul 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winapi: Modify parse_c_typedef() to get rid of the $finished variable.
parent
6f5ae458
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
39 deletions
+21
-39
c_parser.pm
tools/winapi/c_parser.pm
+21
-39
No files found.
tools/winapi/c_parser.pm
View file @
def8d4f4
...
@@ -1569,60 +1569,49 @@ sub parse_c_typedef($$$$)
...
@@ -1569,60 +1569,49 @@ sub parse_c_typedef($$$$)
my
$line
=
$$refline
;
my
$line
=
$$refline
;
my
$column
=
$$refcolumn
;
my
$column
=
$$refcolumn
;
my
$type
;
if
(
!
$self
->
_parse_c
(
"typedef"
,
\
$_
,
\
$line
,
\
$column
))
{
if
(
!
$self
->
_parse_c
(
"typedef"
,
\
$_
,
\
$line
,
\
$column
))
{
return
0
;
return
0
;
}
}
my
$finished
=
0
;
my
(
$kind
,
$name
,
@field_type_names
,
@field_names
,
@names
);
my
(
$linkage
,
$type_name
);
if
(
$finished
)
{
if
(
$self
->
parse_c_enum
(
\
$_
,
\
$line
,
\
$column
))
# Nothing
{
}
elsif
(
$self
->
parse_c_enum
(
\
$_
,
\
$line
,
\
$column
))
{
# Nothing to do
$finished
=
1
;
}
}
elsif
(
$self
->
parse_c_struct_union
(
\
$_
,
\
$line
,
\
$column
,
\
$kind
,
\
$name
,
\
@field_type_names
,
\
@field_names
,
\
@names
))
my
$kind
;
my
$_name
;
my
@field_type_names
;
my
@field_names
;
my
@names
;
if
(
$finished
)
{
# Nothing
}
elsif
(
$self
->
parse_c_struct_union
(
\
$_
,
\
$line
,
\
$column
,
\
$kind
,
\
$_name
,
\
@field_type_names
,
\
@field_names
,
\
@names
))
{
{
my
$base_name
;
my
$base_name
;
foreach
my
$name
(
@names
)
foreach
my
$
_
name
(
@names
)
{
{
if
(
$name
=~
/^\w+$/
)
if
(
$
_
name
=~
/^\w+$/
)
{
{
$base_name
=
$name
;
$base_name
=
$
_
name
;
last
;
last
;
}
}
}
}
$base_name
=
"$kind $
_name"
if
(
!
defined
$base_name
and
defined
$_
name
);
$base_name
=
"$kind $
name"
if
(
!
defined
$base_name
and
defined
$
name
);
$base_name
=
$kind
if
(
!
defined
$base_name
);
$base_name
=
$kind
if
(
!
defined
$base_name
);
foreach
my
$name
(
@names
)
{
foreach
my
$
_
name
(
@names
)
{
if
(
$name
=~
/^\w+$/
)
{
if
(
$
_
name
=~
/^\w+$/
)
{
my
$type
=
$self
->
{
CREATE_TYPE
}();
my
$type
=
$self
->
{
CREATE_TYPE
}();
$type
->
kind
(
$kind
);
$type
->
kind
(
$kind
);
$type
->
_name
(
$
_
name
);
$type
->
_name
(
$name
);
$type
->
name
(
$name
);
$type
->
name
(
$
_
name
);
$type
->
field_type_names
([
@field_type_names
]);
$type
->
field_type_names
([
@field_type_names
]);
$type
->
field_names
([
@field_names
]);
$type
->
field_names
([
@field_names
]);
$self
->
{
FOUND_TYPE
}(
$type
);
$self
->
{
FOUND_TYPE
}(
$type
);
}
elsif
(
$name
=~
/^(\*+)\s*(?:RESTRICTED_POINTER\s+)?(\w+)$/
)
{
}
elsif
(
$
_
name
=~
/^(\*+)\s*(?:RESTRICTED_POINTER\s+)?(\w+)$/
)
{
my
$type_name
=
"$base_name $1"
;
my
$type_name
=
"$base_name $1"
;
$name
=
$2
;
$
_
name
=
$2
;
my
$type
=
$self
->
{
CREATE_TYPE
}();
my
$type
=
$self
->
{
CREATE_TYPE
}();
$type
->
kind
(
""
);
$type
->
kind
(
""
);
$type
->
name
(
$name
);
$type
->
name
(
$
_
name
);
$type
->
field_type_names
([
$type_name
]);
$type
->
field_type_names
([
$type_name
]);
$type
->
field_names
([
""
]);
$type
->
field_names
([
""
]);
...
@@ -1631,16 +1620,9 @@ sub parse_c_typedef($$$$)
...
@@ -1631,16 +1620,9 @@ sub parse_c_typedef($$$$)
$self
->
_parse_c_error
(
$_
,
$line
,
$column
,
"typedef 2"
);
$self
->
_parse_c_error
(
$_
,
$line
,
$column
,
"typedef 2"
);
}
}
}
}
$finished
=
1
;
}
}
elsif
(
$self
->
parse_c_variable
(
\
$_
,
\
$line
,
\
$column
,
\
$linkage
,
\
$type_name
,
\
$name
))
my
$linkage
;
{
my
$type_name
;
my
$name
;
if
(
$finished
)
{
# Nothing
}
elsif
(
$self
->
parse_c_variable
(
\
$_
,
\
$line
,
\
$column
,
\
$linkage
,
\
$type_name
,
\
$name
))
{
$type_name
=~
s/\s+/ /g
;
$type_name
=~
s/\s+/ /g
;
if
(
defined
(
$type_name
)
&&
defined
(
$name
))
{
if
(
defined
(
$type_name
)
&&
defined
(
$name
))
{
...
...
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