Fixed some broken code that was causing compiler warnings.
This commit is contained in:
parent
f0c1e349e1
commit
fcfee2794b
|
@ -637,15 +637,8 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
unsigned long data_length;
|
unsigned long data_length;
|
||||||
unsigned long aux_long;
|
unsigned long aux_long;
|
||||||
unsigned char* p_data = NULL;
|
unsigned char* p_data = NULL;
|
||||||
union {
|
Atom atom_aux;
|
||||||
Atom atom_aux;
|
int x, y, dummy;
|
||||||
struct {
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
} pt_aux;
|
|
||||||
int i;
|
|
||||||
} u;
|
|
||||||
int x, y;
|
|
||||||
BOOL bAccept;
|
BOOL bAccept;
|
||||||
Window win, w_aux_root, w_aux_child;
|
Window win, w_aux_root, w_aux_child;
|
||||||
WND* pWnd;
|
WND* pWnd;
|
||||||
|
@ -654,8 +647,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
win = X11DRV_get_whole_window(hWnd);
|
win = X11DRV_get_whole_window(hWnd);
|
||||||
wine_tsx11_lock();
|
wine_tsx11_lock();
|
||||||
XQueryPointer( event->display, win, &w_aux_root, &w_aux_child,
|
XQueryPointer( event->display, win, &w_aux_root, &w_aux_child,
|
||||||
&x, &y, (int *) &u.pt_aux.x, (int *) &u.pt_aux.y,
|
&x, &y, &dummy, &dummy, (unsigned int*)&aux_long);
|
||||||
(unsigned int*)&aux_long);
|
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
|
|
||||||
pWnd = WIN_GetPtr(hWnd);
|
pWnd = WIN_GetPtr(hWnd);
|
||||||
|
@ -692,25 +684,20 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
wine_tsx11_lock();
|
wine_tsx11_lock();
|
||||||
XGetWindowProperty( event->display, DefaultRootWindow(event->display),
|
XGetWindowProperty( event->display, DefaultRootWindow(event->display),
|
||||||
x11drv_atom(DndSelection), 0, 65535, FALSE,
|
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);
|
&data_length, &aux_long, &p_data);
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
|
|
||||||
if( !aux_long && p_data) /* don't bother if > 64K */
|
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;
|
char *p_drop;
|
||||||
|
|
||||||
aux_long = 0;
|
aux_long = 0;
|
||||||
while( *p ) /* calculate buffer size */
|
while( *p ) /* calculate buffer size */
|
||||||
{
|
{
|
||||||
p_drop = p;
|
INT len = GetShortPathNameA( p, NULL, 0 );
|
||||||
if((u.i = *p) != -1 )
|
if (len) aux_long += len + 1;
|
||||||
{
|
|
||||||
INT len = GetShortPathNameA( p, NULL, 0 );
|
|
||||||
if (len) aux_long += len + 1;
|
|
||||||
else *p = -1;
|
|
||||||
}
|
|
||||||
p += strlen(p) + 1;
|
p += strlen(p) + 1;
|
||||||
}
|
}
|
||||||
if( aux_long && aux_long < 65535 )
|
if( aux_long && aux_long < 65535 )
|
||||||
|
@ -736,14 +723,11 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
lpDrop->fWide = FALSE;
|
lpDrop->fWide = FALSE;
|
||||||
WIN_ReleasePtr(pDropWnd);
|
WIN_ReleasePtr(pDropWnd);
|
||||||
p_drop = (char *)(lpDrop + 1);
|
p_drop = (char *)(lpDrop + 1);
|
||||||
p = p_data;
|
p = (char *)p_data;
|
||||||
while(*p)
|
while(*p)
|
||||||
{
|
{
|
||||||
if( *p != -1 ) /* use only "good" entries */
|
if (GetShortPathNameA( p, p_drop, aux_long - (p_drop - (char *)lpDrop) ))
|
||||||
{
|
|
||||||
GetShortPathNameA( p, p_drop, 65535 );
|
|
||||||
p_drop += strlen( p_drop ) + 1;
|
p_drop += strlen( p_drop ) + 1;
|
||||||
}
|
|
||||||
p += strlen(p) + 1;
|
p += strlen(p) + 1;
|
||||||
}
|
}
|
||||||
*p_drop = '\0';
|
*p_drop = '\0';
|
||||||
|
|
Loading…
Reference in New Issue