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
3c9ede8a
Commit
3c9ede8a
authored
Feb 14, 2024
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Use exports struct in assign_names.
parent
1bc06138
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
22 deletions
+17
-22
build.h
tools/winebuild/build.h
+0
-2
parser.c
tools/winebuild/parser.c
+17
-20
No files found.
tools/winebuild/build.h
View file @
3c9ede8a
...
...
@@ -153,7 +153,6 @@ typedef struct
int
heap_size
;
/* exe heap size */
int
nb_entry_points
;
/* number of used entry points */
int
alloc_entry_points
;
/* number of allocated entry points */
int
nb_names
;
/* number of entry points with names */
unsigned
int
nb_resources
;
/* number of resources */
int
characteristics
;
/* characteristics for the PE header */
int
dll_characteristics
;
/* DLL characteristics for the PE header */
...
...
@@ -162,7 +161,6 @@ typedef struct
int
subsystem_minor
;
/* subsystem version minor number */
int
unicode_app
;
/* default to unicode entry point */
ORDDEF
*
entry_points
;
/* spec entry points */
ORDDEF
**
names
;
/* array of entry point names (points into entry_points) */
struct
exports
exports
;
/* dll exports */
struct
resource
*
resources
;
/* array of dll resources (format differs between Win16/Win32) */
struct
apiset
apiset
;
/* list of defined api sets */
...
...
tools/winebuild/parser.c
View file @
3c9ede8a
...
...
@@ -843,24 +843,24 @@ static int name_compare( const void *ptr1, const void *ptr2 )
*
* Build the name array and catch duplicates.
*/
static
void
assign_names
(
DLLSPEC
*
spec
)
static
void
assign_names
(
struct
exports
*
exports
)
{
int
i
,
j
,
nb_exp_names
=
0
;
ORDDEF
**
all_names
;
spec
->
nb_names
=
0
;
for
(
i
=
0
;
i
<
spec
->
nb_entry_points
;
i
++
)
if
(
spec
->
entry_points
[
i
].
name
)
spec
->
nb_names
++
;
else
if
(
spec
->
entry_points
[
i
].
export_name
)
nb_exp_names
++
;
exports
->
nb_names
=
0
;
for
(
i
=
0
;
i
<
exports
->
nb_entry_points
;
i
++
)
if
(
exports
->
entry_points
[
i
]
->
name
)
exports
->
nb_names
++
;
else
if
(
exports
->
entry_points
[
i
]
->
export_name
)
nb_exp_names
++
;
if
(
!
spec
->
nb_names
&&
!
nb_exp_names
)
return
;
if
(
!
exports
->
nb_names
&&
!
nb_exp_names
)
return
;
/* check for duplicates */
all_names
=
xmalloc
(
(
spec
->
nb_names
+
nb_exp_names
)
*
sizeof
(
all_names
[
0
])
);
for
(
i
=
j
=
0
;
i
<
spec
->
nb_entry_points
;
i
++
)
if
(
spec
->
entry_points
[
i
].
name
||
spec
->
entry_points
[
i
].
export_name
)
all_names
[
j
++
]
=
&
spec
->
entry_points
[
i
];
all_names
=
xmalloc
(
(
exports
->
nb_names
+
nb_exp_names
)
*
sizeof
(
all_names
[
0
])
);
for
(
i
=
j
=
0
;
i
<
exports
->
nb_entry_points
;
i
++
)
if
(
exports
->
entry_points
[
i
]
->
name
||
exports
->
entry_points
[
i
]
->
export_name
)
all_names
[
j
++
]
=
exports
->
entry_points
[
i
];
qsort
(
all_names
,
j
,
sizeof
(
all_names
[
0
]),
name_compare
);
...
...
@@ -879,15 +879,15 @@ static void assign_names( DLLSPEC *spec )
}
free
(
all_names
);
if
(
spec
->
nb_names
)
if
(
exports
->
nb_names
)
{
spec
->
names
=
xmalloc
(
spec
->
nb_names
*
sizeof
(
spec
->
names
[
0
])
);
for
(
i
=
j
=
0
;
i
<
spec
->
nb_entry_points
;
i
++
)
if
(
spec
->
entry_points
[
i
].
name
)
spec
->
names
[
j
++
]
=
&
spec
->
entry_points
[
i
];
exports
->
names
=
xmalloc
(
exports
->
nb_names
*
sizeof
(
exports
->
names
[
0
])
);
for
(
i
=
j
=
0
;
i
<
exports
->
nb_entry_points
;
i
++
)
if
(
exports
->
entry_points
[
i
]
->
name
)
exports
->
names
[
j
++
]
=
exports
->
entry_points
[
i
];
/* sort the list of names */
qsort
(
spec
->
names
,
spec
->
nb_names
,
sizeof
(
spec
->
names
[
0
]),
name_compare
);
for
(
i
=
0
;
i
<
spec
->
nb_names
;
i
++
)
spec
->
names
[
i
]
->
hint
=
i
;
qsort
(
exports
->
names
,
exports
->
nb_names
,
sizeof
(
exports
->
names
[
0
]),
name_compare
);
for
(
i
=
0
;
i
<
exports
->
nb_names
;
i
++
)
exports
->
names
[
i
]
->
hint
=
i
;
}
}
...
...
@@ -962,11 +962,8 @@ static void assign_exports( DLLSPEC *spec )
exports
->
entry_points
[
exports
->
nb_entry_points
++
]
=
entry
;
}
assign_names
(
spec
);
assign_names
(
exports
);
assign_ordinals
(
exports
);
exports
->
nb_names
=
spec
->
nb_names
;
exports
->
names
=
spec
->
names
;
}
...
...
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