From 7fb5d765ba1e28eb775b847cef3d6079eba3bac1 Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Fri, 14 Mar 2014 15:40:43 +0000 Subject: [PATCH] hw/xwin: Use AllocDevicePair() Use AllocDevicePair() rather than allocating Windows keyboard and pointer devices individually. Signed-off-by: Colin Harrison Reviewed-by: Jon TURNEY --- hw/xwin/InitInput.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c index 36346b7e1..38203c906 100644 --- a/hw/xwin/InitInput.c +++ b/hw/xwin/InitInput.c @@ -108,10 +108,11 @@ InitInput(int argc, char *argv[]) } #endif - g_pwinPointer = AddInputDevice(serverClient, winMouseProc, TRUE); - g_pwinKeyboard = AddInputDevice(serverClient, winKeybdProc, TRUE); - g_pwinPointer->name = strdup("Windows mouse"); - g_pwinKeyboard->name = strdup("Windows keyboard"); + if (AllocDevicePair(serverClient, "Windows", + &g_pwinPointer, &g_pwinKeyboard, + winMouseProc, winKeybdProc, + FALSE) != Success) + FatalError("InitInput - Failed to allocate slave devices.\n"); mieqInit();