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
9fbe2f57
Commit
9fbe2f57
authored
Feb 03, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opencl: Factor out parse_feature().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2a35d9a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
23 deletions
+30
-23
make_opencl
dlls/opencl/make_opencl
+30
-23
No files found.
dlls/opencl/make_opencl
View file @
9fbe2f57
...
...
@@ -369,13 +369,34 @@ sub generate_struct($)
return
$ret
;
}
my
%
all_functions
;
my
%
all_enums
;
my
%
all_types
;
sub
parse_feature
($)
{
my
$feature
=
shift
;
foreach
my
$cmd
(
$feature
->
findnodes
(
"./require/command"
))
{
$core_functions
{
$cmd
->
{
name
}}
=
$all_functions
{
$cmd
->
{
name
}};
}
foreach
my
$enum
(
$feature
->
findnodes
(
"./require/enum"
))
{
$header_enums
{
$enum
->
{
name
}}
=
$all_enums
{
$enum
->
{
name
}};
}
foreach
my
$type
(
$feature
->
findnodes
(
"./require/type"
))
{
next
unless
$all_types
{
$type
->
{
name
}};
push
@header_types
,
$type
->
{
name
}
unless
$header_types
{
$type
->
{
name
}};
$header_types
{
$type
->
{
name
}}
=
$all_types
{
$type
->
{
name
}};
}
}
sub
parse_file
($)
{
my
$file
=
shift
;
my
$xml
=
XML::
LibXML
->
load_xml
(
location
=>
$file
);
my
%
functions
;
my
%
enums
;
my
%
types
;
# save all functions
foreach
my
$command
(
$xml
->
findnodes
(
"/registry/commands/command"
))
...
...
@@ -384,7 +405,7 @@ sub parse_file($)
my
$name
=
@
{
$command
->
findnodes
(
"./proto/name"
)}[
0
];
$proto
->
removeChild
(
$name
);
my
@params
=
$command
->
findnodes
(
"./param"
);
$functions
{
$name
->
textContent
()}
=
[
$proto
,
\
@params
];
$
all_
functions
{
$name
->
textContent
()}
=
[
$proto
,
\
@params
];
}
# save all enums
...
...
@@ -392,11 +413,11 @@ sub parse_file($)
{
if
(
defined
$enum
->
{
value
})
{
$enums
{
$enum
->
{
name
}}
=
$enum
->
{
value
};
$
all_
enums
{
$enum
->
{
name
}}
=
$enum
->
{
value
};
}
else
{
$enums
{
$enum
->
{
name
}}
=
"(1 << "
.
$enum
->
{
bitpos
}
.
")"
;
$
all_
enums
{
$enum
->
{
name
}}
=
"(1 << "
.
$enum
->
{
bitpos
}
.
")"
;
}
}
...
...
@@ -407,7 +428,7 @@ sub parse_file($)
{
my
$name
=
@
{
$type
->
findnodes
(
"./name"
)}[
0
];
$name
=
$name
->
textContent
;
$types
{
$name
}
=
$type
;
$
all_
types
{
$name
}
=
$type
;
my
$basetype
=
@
{
$type
->
findnodes
(
"./type"
)}[
0
];
if
(
$type
->
textContent
()
=~
/[[*]/
)
...
...
@@ -426,28 +447,14 @@ sub parse_file($)
elsif
(
$type
->
{
category
}
eq
"struct"
)
{
my
$name
=
$type
->
{
name
};
$types
{
$name
}
=
$type
;
$
all_
types
{
$name
}
=
$type
;
}
}
# generate core functions
foreach
my
$feature
(
$xml
->
findnodes
(
"/registry/feature"
))
{
next
unless
defined
$core_categories
{
$feature
->
{
name
}};
foreach
my
$cmd
(
$feature
->
findnodes
(
"./require/command"
))
{
$core_functions
{
$cmd
->
{
name
}}
=
$functions
{
$cmd
->
{
name
}};
}
foreach
my
$enum
(
$feature
->
findnodes
(
"./require/enum"
))
{
$header_enums
{
$enum
->
{
name
}}
=
$enums
{
$enum
->
{
name
}};
}
foreach
my
$type
(
$feature
->
findnodes
(
"./require/type"
))
{
next
unless
$types
{
$type
->
{
name
}};
push
@header_types
,
$type
->
{
name
}
unless
$header_types
{
$type
->
{
name
}};
$header_types
{
$type
->
{
name
}}
=
$types
{
$type
->
{
name
}};
}
parse_feature
(
$feature
)
if
defined
$core_categories
{
$feature
->
{
name
}};
}
# generate extension list
...
...
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