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
86ebd6dc
Commit
86ebd6dc
authored
Oct 22, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmc: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9e365e4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
lang.c
tools/wmc/lang.c
+3
-4
po.c
tools/wmc/po.c
+2
-2
No files found.
tools/wmc/lang.c
View file @
86ebd6dc
...
...
@@ -162,14 +162,12 @@ static const language_t languages[] = {
{
0x500A
,
850
,
1252
,
"Spanish"
,
"Puerto Rico"
}
};
#define NLAN (sizeof(languages)/sizeof(languages[0]))
void
show_languages
(
void
)
{
unsigned
int
i
;
printf
(
" Code | DOS-cp | WIN-cp | Language | Country
\n
"
);
printf
(
"-------+--------+--------+--------------+---------
\n
"
);
for
(
i
=
0
;
i
<
NLAN
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
languages
)
;
i
++
)
printf
(
"0x%04x | %5d | %5d | %-12s | %s
\n
"
,
languages
[
i
].
id
,
languages
[
i
].
doscp
,
...
...
@@ -185,7 +183,8 @@ static int langcmp(const void *p1, const void *p2)
const
language_t
*
find_language
(
unsigned
id
)
{
return
(
const
language_t
*
)
bsearch
(
&
id
,
languages
,
NLAN
,
sizeof
(
languages
[
0
]),
langcmp
);
return
(
const
language_t
*
)
bsearch
(
&
id
,
languages
,
ARRAY_SIZE
(
languages
),
sizeof
(
languages
[
0
]),
langcmp
);
}
void
show_codepages
(
void
)
...
...
tools/wmc/po.c
View file @
86ebd6dc
...
...
@@ -666,10 +666,10 @@ void add_translations( const char *po_dir )
if
((
p
=
strchr
(
buffer
,
'#'
)))
*
p
=
0
;
for
(
tok
=
strtok
(
buffer
,
"
\t\r\n
"
);
tok
;
tok
=
strtok
(
NULL
,
"
\t\r\n
"
))
{
for
(
i
=
0
;
i
<
sizeof
(
languages
)
/
sizeof
(
languages
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
languages
);
i
++
)
if
(
!
strcmp
(
tok
,
languages
[
i
].
name
))
break
;
if
(
i
==
sizeof
(
languages
)
/
sizeof
(
languages
[
0
]
))
if
(
i
==
ARRAY_SIZE
(
languages
))
error
(
"unknown language '%s'
\n
"
,
tok
);
name
=
strmake
(
"%s/%s.mo"
,
po_dir
,
tok
);
...
...
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