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
3e9ce1c2
Commit
3e9ce1c2
authored
Jul 07, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Avoid ARRAY_SIZE-like macros.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1e469c95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
clipboard.c
dlls/winex11.drv/clipboard.c
+5
-5
desktop.c
dlls/winex11.drv/desktop.c
+2
-3
No files found.
dlls/winex11.drv/clipboard.c
View file @
3e9ce1c2
...
...
@@ -187,7 +187,6 @@ static const struct
static
struct
list
format_list
=
LIST_INIT
(
format_list
);
#define NB_BUILTIN_FORMATS (sizeof(builtin_formats) / sizeof(builtin_formats[0]))
#define GET_ATOM(prop) (((prop) < FIRST_XATOM) ? (Atom)(prop) : X11DRV_Atoms[(prop) - FIRST_XATOM])
static
DWORD
clipboard_thread_id
;
...
...
@@ -295,9 +294,9 @@ static void register_builtin_formats(void)
struct
clipboard_format
*
formats
;
unsigned
int
i
;
if
(
!
(
formats
=
HeapAlloc
(
GetProcessHeap
(),
0
,
NB_BUILTIN_FORMATS
*
sizeof
(
*
formats
))))
return
;
if
(
!
(
formats
=
HeapAlloc
(
GetProcessHeap
(),
0
,
ARRAY_SIZE
(
builtin_formats
)
*
sizeof
(
*
formats
))))
return
;
for
(
i
=
0
;
i
<
NB_BUILTIN_FORMATS
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
builtin_formats
)
;
i
++
)
{
if
(
builtin_formats
[
i
].
name
)
formats
[
i
].
id
=
RegisterClipboardFormatW
(
builtin_formats
[
i
].
name
);
...
...
@@ -983,7 +982,7 @@ static HANDLE import_targets( Atom type, const void *data, size_t size )
register_x11_formats
(
properties
,
count
);
/* the builtin formats contain duplicates, so allocate some extra space */
if
(
!
(
formats
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
count
+
NB_BUILTIN_FORMATS
)
*
sizeof
(
*
formats
))))
if
(
!
(
formats
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
count
+
ARRAY_SIZE
(
builtin_formats
)
)
*
sizeof
(
*
formats
))))
return
0
;
pos
=
0
;
...
...
@@ -1454,7 +1453,8 @@ static BOOL export_targets( Display *display, Window win, Atom prop, Atom target
if
(
!
(
formats
=
get_clipboard_formats
(
&
count
)))
return
FALSE
;
/* the builtin formats contain duplicates, so allocate some extra space */
if
(
!
(
targets
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
count
+
NB_BUILTIN_FORMATS
)
*
sizeof
(
*
targets
)
)))
if
(
!
(
targets
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
count
+
ARRAY_SIZE
(
builtin_formats
))
*
sizeof
(
*
targets
)
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
formats
);
return
FALSE
;
...
...
dlls/winex11.drv/desktop.c
View file @
3e9ce1c2
...
...
@@ -73,7 +73,6 @@ static struct screen_size {
{
1920
,
1200
},
{
2560
,
1600
}
};
#define NUM_DESKTOP_MODES (sizeof(screen_sizes) / sizeof(struct screen_size))
#define _NET_WM_STATE_REMOVE 0
#define _NET_WM_STATE_ADD 1
...
...
@@ -88,7 +87,7 @@ static void make_modes(void)
/* original specified desktop size */
X11DRV_Settings_AddOneMode
(
screen_width
,
screen_height
,
0
,
60
);
for
(
i
=
0
;
i
<
NUM_DESKTOP_MODES
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
screen_sizes
)
;
i
++
)
{
if
(
(
screen_sizes
[
i
].
width
<=
max_width
)
&&
(
screen_sizes
[
i
].
height
<=
max_height
)
)
{
...
...
@@ -160,7 +159,7 @@ void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height )
dd_modes
=
X11DRV_Settings_SetHandlers
(
"desktop"
,
X11DRV_desktop_GetCurrentMode
,
X11DRV_desktop_SetCurrentMode
,
NUM_DESKTOP_MODES
+
2
,
1
);
ARRAY_SIZE
(
screen_sizes
)
+
2
,
1
);
make_modes
();
X11DRV_Settings_AddDepthModes
();
dd_mode_count
=
X11DRV_Settings_GetModeCount
();
...
...
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