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
7d550de2
Commit
7d550de2
authored
Aug 16, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Avoid an ARRAY_SIZE-like macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a9bc0fec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
capability.c
dlls/sane.ds/capability.c
+5
-7
No files found.
dlls/sane.ds/capability.c
View file @
7d550de2
...
...
@@ -844,7 +844,6 @@ static const supported_size_t supported_sizes[] =
{
TWSS_USEXECUTIVE
,
184
.
15
,
266
.
7
},
{
TWSS_A3
,
297
,
420
},
};
#define SUPPORTED_SIZE_COUNT (sizeof(supported_sizes) / sizeof(supported_sizes[0]))
static
TW_UINT16
get_default_paper_size
(
const
supported_size_t
*
s
,
int
n
)
{
...
...
@@ -920,11 +919,11 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
TW_UINT16
twCC
=
TWCC_BADCAP
;
#ifdef SONAME_LIBSANE
static
TW_UINT32
possible_values
[
SUPPORTED_SIZE_COUNT
];
static
TW_UINT32
possible_values
[
ARRAY_SIZE
(
supported_sizes
)
];
unsigned
int
i
;
TW_UINT32
val
;
TW_UINT16
default_size
=
get_default_paper_size
(
supported_sizes
,
SUPPORTED_SIZE_COUNT
);
TW_UINT16
current_size
=
get_current_paper_size
(
supported_sizes
,
SUPPORTED_SIZE_COUNT
);
TW_UINT16
default_size
=
get_default_paper_size
(
supported_sizes
,
ARRAY_SIZE
(
supported_sizes
)
);
TW_UINT16
current_size
=
get_current_paper_size
(
supported_sizes
,
ARRAY_SIZE
(
supported_sizes
)
);
TRACE
(
"ICAP_SUPPORTEDSIZES
\n
"
);
...
...
@@ -946,7 +945,7 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
case
MSG_SET
:
twCC
=
msg_set
(
pCapability
,
&
val
);
if
(
twCC
==
TWCC_SUCCESS
)
for
(
i
=
1
;
i
<
SUPPORTED_SIZE_COUNT
;
i
++
)
for
(
i
=
1
;
i
<
ARRAY_SIZE
(
supported_sizes
)
;
i
++
)
if
(
supported_sizes
[
i
].
size
==
val
)
return
set_width_height
(
supported_sizes
[
i
].
x
,
supported_sizes
[
i
].
y
);
...
...
@@ -960,7 +959,7 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
case
MSG_RESET
:
twCC
=
TWCC_BADCAP
;
for
(
i
=
1
;
i
<
SUPPORTED_SIZE_COUNT
;
i
++
)
for
(
i
=
1
;
i
<
ARRAY_SIZE
(
supported_sizes
)
;
i
++
)
if
(
supported_sizes
[
i
].
size
==
default_size
)
{
twCC
=
set_width_height
(
supported_sizes
[
i
].
x
,
supported_sizes
[
i
].
y
);
...
...
@@ -976,7 +975,6 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
break
;
}
#undef SUPPORTED_SIZE_COUNT
#endif
return
twCC
;
}
...
...
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