dinput: Add error check to silence a compiler warning.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-02-13 19:38:36 +01:00
parent 71ddc97b91
commit 6925fb0bb6
1 changed files with 4 additions and 3 deletions

View File

@ -298,10 +298,11 @@ static void assign_action(HWND dialog)
int obj = lv_get_cur_item(dialog); int obj = lv_get_cur_item(dialog);
int old_action = lv_get_item_data(dialog, obj); int old_action = lv_get_item_data(dialog, obj);
int used_obj; int used_obj;
DWORD type;
DIDEVICEOBJECTINSTANCEW ddo = device->ddo[obj];
if (old_action == action) return; if (old_action == action) return;
if (obj < 0) return;
type = device->ddo[obj].dwType;
/* Clear old action */ /* Clear old action */
if (old_action != -1) if (old_action != -1)
@ -320,7 +321,7 @@ static void assign_action(HWND dialog)
lv_set_action(dialog, used_obj, -1, lpdiaf); lv_set_action(dialog, used_obj, -1, lpdiaf);
/* Set new action */ /* Set new action */
lpdiaf->rgoAction[action].dwObjID = ddo.dwType; lpdiaf->rgoAction[action].dwObjID = type;
lpdiaf->rgoAction[action].guidInstance = device->ddi.guidInstance; lpdiaf->rgoAction[action].guidInstance = device->ddi.guidInstance;
lpdiaf->rgoAction[action].dwHow = DIAH_USERCONFIG; lpdiaf->rgoAction[action].dwHow = DIAH_USERCONFIG;