Andrew Talbot : dinput: Assign to structs instead of using memcpy.
Alexandre Julliard
julliard at winehq.org
Sat Mar 1 06:13:21 CST 2008
Module: wine
Branch: master
Commit: da0a48d235c533e5c2113ad9d6e1ead9a8220c99
URL: http://source.winehq.org/git/wine.git/?a=commit;h=da0a48d235c533e5c2113ad9d6e1ead9a8220c99
Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date: Fri Feb 29 22:06:34 2008 +0000
dinput: Assign to structs instead of using memcpy.
---
dlls/dinput/effect_linuxinput.c | 6 +++---
dlls/dinput/mouse.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c
index 0dfbe23..7d603bb 100644
--- a/dlls/dinput/effect_linuxinput.c
+++ b/dlls/dinput/effect_linuxinput.c
@@ -780,12 +780,12 @@ HRESULT linuxinput_create_effect(
LinuxInputEffectImpl* newEffect = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(LinuxInputEffectImpl));
DWORD type = _typeFromGUID(rguid);
-
+
newEffect->lpVtbl = &LinuxInputEffectVtbl;
newEffect->ref = 1;
- memcpy(&(newEffect->guid), rguid, sizeof(*rguid));
+ newEffect->guid = *rguid;
newEffect->fd = fd;
-
+
/* set the type. this cannot be changed over the effect's life. */
switch (type) {
case DIEFT_PERIODIC:
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index 70c65cf..3c3b3c3 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -180,7 +180,7 @@ static SysMouseImpl *alloc_device(REFGUID rguid, const void *mvt, IDirectInputIm
newDevice->base.lpVtbl = mvt;
newDevice->base.ref = 1;
newDevice->base.dwCoopLevel = DISCL_NONEXCLUSIVE | DISCL_BACKGROUND;
- memcpy(&newDevice->base.guid, rguid, sizeof(*rguid));
+ newDevice->base.guid = *rguid;
InitializeCriticalSection(&newDevice->base.crit);
newDevice->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SysMouseImpl*->base.crit");
newDevice->base.dinput = dinput;
More information about the wine-cvs
mailing list