ChangeSet ID: 21410 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@winehq.org 2005/11/23 07:43:59
Modified files: dlls/x11drv : event.c
Log message: Fixed some broken code that was causing compiler warnings.
Patch: http://cvs.winehq.org/patch.py?id=21410
Old revision New revision Changes Path 1.60 1.61 +9 -25 wine/dlls/x11drv/event.c
Index: wine/dlls/x11drv/event.c diff -u -p wine/dlls/x11drv/event.c:1.60 wine/dlls/x11drv/event.c:1.61 --- wine/dlls/x11drv/event.c:1.60 23 Nov 2005 13:43:59 -0000 +++ wine/dlls/x11drv/event.c 23 Nov 2005 13:43:59 -0000 @@ -637,15 +637,8 @@ static void EVENT_DropFromOffiX( HWND hW unsigned long data_length; unsigned long aux_long; unsigned char* p_data = NULL; - union { - Atom atom_aux; - struct { - int x; - int y; - } pt_aux; - int i; - } u; - int x, y; + Atom atom_aux; + int x, y, dummy; BOOL bAccept; Window win, w_aux_root, w_aux_child; WND* pWnd; @@ -654,8 +647,7 @@ static void EVENT_DropFromOffiX( HWND hW win = X11DRV_get_whole_window(hWnd); wine_tsx11_lock(); XQueryPointer( event->display, win, &w_aux_root, &w_aux_child, - &x, &y, (int *) &u.pt_aux.x, (int *) &u.pt_aux.y, - (unsigned int*)&aux_long); + &x, &y, &dummy, &dummy, (unsigned int*)&aux_long); wine_tsx11_unlock();
pWnd = WIN_GetPtr(hWnd); @@ -692,25 +684,20 @@ static void EVENT_DropFromOffiX( HWND hW wine_tsx11_lock(); XGetWindowProperty( event->display, DefaultRootWindow(event->display), x11drv_atom(DndSelection), 0, 65535, FALSE, - AnyPropertyType, &u.atom_aux, (int *) &u.pt_aux.y, + AnyPropertyType, &atom_aux, &dummy, &data_length, &aux_long, &p_data); wine_tsx11_unlock();
if( !aux_long && p_data) /* don't bother if > 64K */ { - signed char *p = (signed char*) p_data; + char *p = (char *)p_data; char *p_drop;
aux_long = 0; while( *p ) /* calculate buffer size */ { - p_drop = p; - if((u.i = *p) != -1 ) - { - INT len = GetShortPathNameA( p, NULL, 0 ); - if (len) aux_long += len + 1; - else *p = -1; - } + INT len = GetShortPathNameA( p, NULL, 0 ); + if (len) aux_long += len + 1; p += strlen(p) + 1; } if( aux_long && aux_long < 65535 ) @@ -736,14 +723,11 @@ static void EVENT_DropFromOffiX( HWND hW lpDrop->fWide = FALSE; WIN_ReleasePtr(pDropWnd); p_drop = (char *)(lpDrop + 1); - p = p_data; + p = (char *)p_data; while(*p) { - if( *p != -1 ) /* use only "good" entries */ - { - GetShortPathNameA( p, p_drop, 65535 ); + if (GetShortPathNameA( p, p_drop, aux_long - (p_drop - (char *)lpDrop) )) p_drop += strlen( p_drop ) + 1; - } p += strlen(p) + 1; } *p_drop = '\0';