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
a0d4401d
Commit
a0d4401d
authored
Nov 07, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libs/port: Avoid an ARRAY_SIZE-like macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52ed7888
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
cptable.c
libs/port/cptable.c
+2
-4
No files found.
libs/port/cptable.c
View file @
a0d4401d
...
@@ -175,8 +175,6 @@ static const union cptable * const cptables[72] =
...
@@ -175,8 +175,6 @@ static const union cptable * const cptables[72] =
/* ### cpmap end ### */
/* ### cpmap end ### */
/* Everything above this line is generated automatically by make_unicode */
/* Everything above this line is generated automatically by make_unicode */
#define NB_CODEPAGES (sizeof(cptables)/sizeof(cptables[0]))
static
int
cmp_codepage
(
const
void
*
codepage
,
const
void
*
entry
)
static
int
cmp_codepage
(
const
void
*
codepage
,
const
void
*
entry
)
{
{
...
@@ -189,7 +187,7 @@ const union cptable *wine_cp_get_table( unsigned int codepage )
...
@@ -189,7 +187,7 @@ const union cptable *wine_cp_get_table( unsigned int codepage )
{
{
const
union
cptable
**
res
;
const
union
cptable
**
res
;
if
(
!
(
res
=
bsearch
(
&
codepage
,
cptables
,
NB_CODEPAGES
,
if
(
!
(
res
=
bsearch
(
&
codepage
,
cptables
,
ARRAY_SIZE
(
cptables
)
,
sizeof
(
cptables
[
0
]),
cmp_codepage
)))
return
NULL
;
sizeof
(
cptables
[
0
]),
cmp_codepage
)))
return
NULL
;
return
*
res
;
return
*
res
;
}
}
...
@@ -198,6 +196,6 @@ const union cptable *wine_cp_get_table( unsigned int codepage )
...
@@ -198,6 +196,6 @@ const union cptable *wine_cp_get_table( unsigned int codepage )
/* enum valid codepages */
/* enum valid codepages */
const
union
cptable
*
wine_cp_enum_table
(
unsigned
int
index
)
const
union
cptable
*
wine_cp_enum_table
(
unsigned
int
index
)
{
{
if
(
index
>=
NB_CODEPAGES
)
return
NULL
;
if
(
index
>=
ARRAY_SIZE
(
cptables
)
)
return
NULL
;
return
cptables
[
index
];
return
cptables
[
index
];
}
}
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