diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-02-07 14:38:33 -0800 |
---|---|---|
committer | Chase Douglas <chase.douglas@canonical.com> | 2012-02-10 13:20:49 -0800 |
commit | 5486ab3486e1ba4a0ef8fc9efe4d243ea90f5794 (patch) | |
tree | 08e26b6a2969cb84512c0b41267eb67c80bb9c0f | |
parent | 5658a2f643cf7440009dde2fa74287332237c0b9 (diff) |
Introduce SynapticsCopyHwState function
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/alpscomm.c | 2 | ||||
-rw-r--r-- | src/eventcomm.c | 2 | ||||
-rw-r--r-- | src/ps2comm.c | 2 | ||||
-rw-r--r-- | src/synaptics.c | 4 | ||||
-rw-r--r-- | src/synproto.c | 7 | ||||
-rw-r--r-- | src/synproto.h | 2 |
6 files changed, 14 insertions, 5 deletions
diff --git a/src/alpscomm.c b/src/alpscomm.c index dbc3554..8988e6b 100644 --- a/src/alpscomm.c +++ b/src/alpscomm.c @@ -218,7 +218,7 @@ ALPSReadHwState(InputInfoPtr pInfo, ALPS_process_packet(buf, hw); - *hwRet = *hw; + SynapticsCopyHwState(hwRet, hw); return TRUE; } diff --git a/src/eventcomm.c b/src/eventcomm.c index e494d4c..b83da8f 100644 --- a/src/eventcomm.c +++ b/src/eventcomm.c @@ -720,7 +720,7 @@ EventReadHwState(InputInfoPtr pInfo, EventProcessTouch(pInfo); hw->numFingers = count_fingers(comm); hw->millis = 1000 * ev.time.tv_sec + ev.time.tv_usec / 1000; - *hwRet = *hw; + SynapticsCopyHwState(hwRet, hw); return TRUE; } break; diff --git a/src/ps2comm.c b/src/ps2comm.c index 74bd937..5b34414 100644 --- a/src/ps2comm.c +++ b/src/ps2comm.c @@ -650,7 +650,7 @@ PS2ReadHwStateProto(InputInfoPtr pInfo, } } hw->millis = GetTimeInMillis(); - *hwRet = *hw; + SynapticsCopyHwState(hwRet, hw); return TRUE; } diff --git a/src/synaptics.c b/src/synaptics.c index a6efd7e..475683b 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -1337,7 +1337,7 @@ timerFunc(OsTimerPtr timer, CARD32 now, pointer arg) sigstate = xf86BlockSIGIO(); priv->hwState->millis += now - priv->timer_time; - *hw = *priv->hwState; + SynapticsCopyHwState(hw, priv->hwState); delay = HandleState(pInfo, hw, hw->millis, TRUE); priv->timer_time = now; @@ -1378,7 +1378,7 @@ ReadInput(InputInfoPtr pInfo) Bool newDelay = FALSE; while (SynapticsGetHwState(pInfo, priv, hw)) { - *priv->hwState = *hw; + SynapticsCopyHwState(priv->hwState, hw); delay = HandleState(pInfo, hw, hw->millis, FALSE); newDelay = TRUE; } diff --git a/src/synproto.c b/src/synproto.c index fc2b157..9f042b5 100644 --- a/src/synproto.c +++ b/src/synproto.c @@ -41,3 +41,10 @@ SynapticsHwStateFree(struct SynapticsHwState **hw) free(*hw); *hw = NULL; } + +void +SynapticsCopyHwState(struct SynapticsHwState *dst, + const struct SynapticsHwState *src) +{ + *dst = *src; +} diff --git a/src/synproto.h b/src/synproto.h index 74becca..8d50ce6 100644 --- a/src/synproto.h +++ b/src/synproto.h @@ -95,5 +95,7 @@ extern struct SynapticsProtocolOperations psm_proto_operations; extern struct SynapticsHwState *SynapticsHwStateAlloc(SynapticsPrivate *priv); extern void SynapticsHwStateFree(struct SynapticsHwState **hw); +extern void SynapticsCopyHwState(struct SynapticsHwState *dst, + const struct SynapticsHwState *src); #endif /* _SYNPROTO_H_ */ |