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
79a6dd21
Commit
79a6dd21
authored
Oct 22, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
86ebd6dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
po.c
tools/wrc/po.c
+5
-5
utils.c
tools/wrc/utils.c
+1
-1
No files found.
tools/wrc/po.c
View file @
79a6dd21
...
...
@@ -602,7 +602,7 @@ static const char *get_language_name( const language_t *lang )
static
char
name
[
20
];
unsigned
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
languages
)
/
sizeof
(
languages
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
languages
);
i
++
)
if
(
languages
[
i
].
id
==
lang
->
id
&&
languages
[
i
].
sub
==
lang
->
sub
)
return
languages
[
i
].
name
;
...
...
@@ -1314,7 +1314,7 @@ static ver_value_t *translate_stringfileinfo( ver_value_t *val, language_t *lang
new_blk
=
new_ver_block
();
*
new_blk
=
*
blk
;
name
=
convert_msgid_ascii
(
blk
->
name
,
0
);
for
(
i
=
0
;
i
<
sizeof
(
block_name
)
/
sizeof
(
block_name
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
block_name
);
i
++
)
{
if
(
!
strcasecmp
(
name
,
english_block_name
[
i
]
))
{
...
...
@@ -1344,7 +1344,7 @@ static ver_value_t *translate_stringfileinfo( ver_value_t *val, language_t *lang
val
=
val
->
next
;
}
for
(
i
=
0
;
i
<
sizeof
(
block_name
)
/
sizeof
(
block_name
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
block_name
);
i
++
)
free
(
block_name
[
i
]
);
return
head
;
}
...
...
@@ -1494,10 +1494,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
);
...
...
tools/wrc/utils.c
View file @
79a6dd21
...
...
@@ -565,7 +565,7 @@ int get_language_codepage( unsigned short lang, unsigned short sublang )
unsigned
int
i
;
int
cp
=
-
1
,
defcp
=
-
1
;
for
(
i
=
0
;
i
<
sizeof
(
lang2cps
)
/
sizeof
(
lang2cps
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
lang2cps
);
i
++
)
{
if
(
lang2cps
[
i
].
lang
!=
lang
)
continue
;
if
(
lang2cps
[
i
].
sublang
==
sublang
)
...
...
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