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
bbcf44eb
Commit
bbcf44eb
authored
Sep 26, 2019
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Sep 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fe91ae51
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
+6
-5
typelib.c
tools/widl/typelib.c
+2
-3
utils.c
tools/widl/utils.c
+1
-1
utils.h
tools/widl/utils.h
+2
-0
widl.c
tools/widl/widl.c
+1
-1
No files found.
tools/widl/typelib.c
View file @
bbcf44eb
...
...
@@ -64,7 +64,6 @@ static const struct oatype {
{
"VARIANT"
,
VT_VARIANT
},
{
"VARIANT_BOOL"
,
VT_BOOL
}
};
#define NTYPES (sizeof(oatypes)/sizeof(oatypes[0]))
#define KWP(p) ((const struct oatype *)(p))
static
int
kw_cmp_func
(
const
void
*
s1
,
const
void
*
s2
)
...
...
@@ -79,11 +78,11 @@ static unsigned short builtin_vt(const type_t *t)
const
struct
oatype
*
kwp
;
key
.
kw
=
kw
;
#ifdef KW_BSEARCH
kwp
=
bsearch
(
&
key
,
oatypes
,
NTYPES
,
sizeof
(
oatypes
[
0
]),
kw_cmp_func
);
kwp
=
bsearch
(
&
key
,
oatypes
,
ARRAY_SIZE
(
oatypes
)
,
sizeof
(
oatypes
[
0
]),
kw_cmp_func
);
#else
{
unsigned
int
i
;
for
(
kwp
=
NULL
,
i
=
0
;
i
<
NTYPES
;
i
++
)
for
(
kwp
=
NULL
,
i
=
0
;
i
<
ARRAY_SIZE
(
oatypes
)
;
i
++
)
if
(
!
kw_cmp_func
(
&
key
,
&
oatypes
[
i
]))
{
kwp
=
&
oatypes
[
i
];
break
;
...
...
tools/widl/utils.c
View file @
bbcf44eb
...
...
@@ -309,7 +309,7 @@ void add_output_to_resources( const char *type, const char *name )
size_t
data_size
=
output_buffer_pos
;
size_t
header_size
=
5
*
sizeof
(
unsigned
int
)
+
2
*
sizeof
(
unsigned
short
);
assert
(
nb_resources
<
sizeof
(
resources
)
/
sizeof
(
resources
[
0
])
);
assert
(
nb_resources
<
ARRAY_SIZE
(
resources
)
);
if
(
type
[
0
]
!=
'#'
)
header_size
+=
(
strlen
(
type
)
+
1
)
*
sizeof
(
unsigned
short
);
else
header_size
+=
2
*
sizeof
(
unsigned
short
);
...
...
tools/widl/utils.h
View file @
bbcf44eb
...
...
@@ -34,6 +34,8 @@ int strendswith(const char* str, const char* end);
#define __attribute__(X)
#endif
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
void
parser_error
(
const
char
*
s
)
__attribute__
((
noreturn
));
int
parser_warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
void
error_loc
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)))
__attribute__
((
noreturn
));
...
...
tools/widl/widl.c
View file @
bbcf44eb
...
...
@@ -302,7 +302,7 @@ static void set_target( const char *target )
if
(
!
(
p
=
strchr
(
spec
,
'-'
)))
error
(
"Invalid target specification '%s'
\n
"
,
target
);
*
p
++
=
0
;
for
(
i
=
0
;
i
<
sizeof
(
cpu_names
)
/
sizeof
(
cpu_names
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
cpu_names
);
i
++
)
{
if
(
!
strcmp
(
cpu_names
[
i
].
name
,
spec
))
{
...
...
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