Module: wine Branch: master Commit: 7d614be43c2637a1512bf94d242e7d0b5a3dacc0 URL: https://gitlab.winehq.org/wine/wine/-/commit/7d614be43c2637a1512bf94d242e7d0...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Nov 18 09:23:38 2022 +0100
winex11: Use int instead of long types in a few places.
---
dlls/winex11.drv/display.c | 2 +- dlls/winex11.drv/event.c | 6 +++--- dlls/winex11.drv/graphics.c | 2 +- dlls/winex11.drv/keyboard.c | 4 ++-- dlls/winex11.drv/pen.c | 4 ++-- dlls/winex11.drv/window.c | 8 ++++---- dlls/winex11.drv/x11drv.h | 2 +- dlls/winex11.drv/xim.c | 11 +++++------ 8 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index a09b0600fa0..6e3340fb069 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -163,7 +163,7 @@ void init_registry_display_settings(void) DISPLAY_DEVICEW dd = {sizeof(dd)}; UNICODE_STRING device_name; DWORD i = 0; - LONG ret; + int ret;
while (!NtUserEnumDisplayDevices( NULL, i++, &dd, 0 )) { diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 4a1a8dc0443..12d86216a61 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1268,7 +1268,7 @@ static int get_window_wm_state( Display *display, Window window ) static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event, BOOL update_window ) { struct x11drv_win_data *data = get_win_data( hwnd ); - DWORD style; + UINT style;
if (!data) return;
@@ -1781,7 +1781,7 @@ static DWORD xdnd_action_to_drop_effect( long action ) }
-static long drop_effect_to_xdnd_action( DWORD effect ) +static long drop_effect_to_xdnd_action( UINT effect ) { if (effect == DROPEFFECT_COPY) return x11drv_atom(XdndActionCopy); @@ -1801,7 +1801,7 @@ static void handle_xdnd_position_event( HWND hwnd, XClientMessageEvent *event ) { struct dnd_position_event_params params; XClientMessageEvent e; - DWORD effect; + UINT effect;
params.hwnd = HandleToUlong( hwnd ); params.point = root_to_virtual_screen( event->data.l[2] >> 16, event->data.l[2] & 0xFFFF ); diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 7adb79e181d..6365c9a30ad 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -1704,7 +1704,7 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, IO_STATUS_BLOCK io; UINT64 hash = 0; HANDLE file; - NTSTATUS status; + int status;
for (i = 0; i < buflen; i++) hash = (hash << 16) - hash + buffer[i]; for (i = 0; i < sizeof(hash) * 2; i++) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index adf00b052c0..f67db25525d 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1132,7 +1132,7 @@ static WORD EVENT_event_to_vkey( XIC xic, XKeyEvent *e) /*********************************************************************** * X11DRV_send_keyboard_input */ -static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD flags, DWORD time ) +static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, UINT flags, UINT time ) { INPUT input;
@@ -1275,7 +1275,7 @@ static void adjust_lock_state( BYTE *keystate, HWND hwnd, WORD vkey, WORD scan, } }
-static void update_lock_state( HWND hwnd, WORD vkey, UINT state, DWORD time ) +static void update_lock_state( HWND hwnd, WORD vkey, UINT state, UINT time ) { BYTE keystate[256];
diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c index a32bf4752e1..3baf6a0a74e 100644 --- a/dlls/winex11.drv/pen.c +++ b/dlls/winex11.drv/pen.c @@ -51,7 +51,7 @@ static DWORD get_user_dashes( char *res, const DWORD *style, DWORD len ) } else dashes[pos++] = dashes[i]; } - for (i = 0; i < pos; i++) res[i] = min( dashes[i], 255 ); + for (i = 0; i < pos; i++) res[i] = (char)min( dashes[i], 255 ); return pos; }
@@ -147,7 +147,7 @@ HPEN CDECL X11DRV_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern (logpen.lopnStyle & PS_STYLE_MASK) != PS_USERSTYLE && (logpen.lopnStyle & PS_STYLE_MASK) != PS_ALTERNATE) for(i = 0; i < physDev->pen.dash_len; i++) - physDev->pen.dashes[i] = min( physDev->pen.dashes[i] * physDev->pen.width, 255 ); + physDev->pen.dashes[i] = (char)min( physDev->pen.dashes[i] * physDev->pen.width, 255 );
free( elp );
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index f712207df80..585eff2eeb2 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -737,7 +737,7 @@ static void set_size_hints( struct x11drv_win_data *data, DWORD style ) /*********************************************************************** * set_mwm_hints */ -static void set_mwm_hints( struct x11drv_win_data *data, DWORD style, DWORD ex_style ) +static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_style ) { MwmHints mwm_hints;
@@ -1015,7 +1015,7 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) */ void update_net_wm_states( struct x11drv_win_data *data ) { - DWORD i, style, ex_style, new_state = 0; + UINT i, style, ex_style, new_state = 0;
if (!data->managed) return; if (data->whole_window == root_window) return; @@ -2053,7 +2053,7 @@ HWND create_foreign_window( Display *display, Window xwin ) Window *xchildren; unsigned int nchildren; XWindowAttributes attr; - DWORD style = WS_CLIPCHILDREN; + UINT style = WS_CLIPCHILDREN; UNICODE_STRING class_name;
if (!class_registered) @@ -2592,7 +2592,7 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, { struct x11drv_thread_data *thread_data; struct x11drv_win_data *data; - DWORD new_style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); + UINT new_style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); RECT old_window_rect, old_whole_rect, old_client_rect; int event_type;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index d51df30c2d0..47a29c8eb98 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -823,7 +823,7 @@ extern struct x11drv_display_device_handler desktop_handler DECLSPEC_HIDDEN; extern BOOL X11DRV_InitXIM( const WCHAR *input_style ) DECLSPEC_HIDDEN; extern XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) DECLSPEC_HIDDEN; extern void X11DRV_SetupXIM(void) DECLSPEC_HIDDEN; -extern void X11DRV_XIMLookupChars( const char *str, DWORD count ) DECLSPEC_HIDDEN; +extern void X11DRV_XIMLookupChars( const char *str, UINT count ) DECLSPEC_HIDDEN;
#define XEMBED_MAPPED (1 << 0)
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index 00c15bb3bcf..d736dd80345 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -61,17 +61,16 @@ static XIMStyle ximStyle = 0; static XIMStyle ximStyleRoot = 0; static XIMStyle ximStyleRequest = STYLE_CALLBACK;
-static void X11DRV_ImmSetInternalString(DWORD dwOffset, - DWORD selLength, LPWSTR lpComp, DWORD dwCompLen) +static void X11DRV_ImmSetInternalString(UINT offset, UINT selLength, LPWSTR lpComp, UINT len) { /* Composition strings are edited in chunks */ - unsigned int byte_length = dwCompLen * sizeof(WCHAR); - unsigned int byte_offset = dwOffset * sizeof(WCHAR); + unsigned int byte_length = len * sizeof(WCHAR); + unsigned int byte_offset = offset * sizeof(WCHAR); unsigned int byte_selection = selLength * sizeof(WCHAR); int byte_expansion = byte_length - byte_selection; LPBYTE ptr_new;
- TRACE("( %i, %i, %p, %d):\n", dwOffset, selLength, lpComp, dwCompLen ); + TRACE("( %i, %i, %p, %d):\n", offset, selLength, lpComp, len );
if (byte_expansion + dwCompStringLength >= dwCompStringSize) { @@ -96,7 +95,7 @@ static void X11DRV_ImmSetInternalString(DWORD dwOffset, CompositionString, dwCompStringLength ); }
-void X11DRV_XIMLookupChars( const char *str, DWORD count ) +void X11DRV_XIMLookupChars( const char *str, UINT count ) { WCHAR *output; DWORD len;