diff options
author | Peter Osterlund <petero2@telia.com> | 2005-10-03 17:25:17 +0200 |
---|---|---|
committer | Peter Osterlund <petero2@telia.com> | 2006-04-09 04:03:33 +0200 |
commit | d5c9403b8f86f6bb6e02cada7a3784bc07cbdafd (patch) | |
tree | 4f6b1301ee81c29224633b7902315cd30c0c1eea | |
parent | 209ef752c9899f78c4a8c7b871d1c61a034d4d5d (diff) |
Fixed some long vs int inconsistencies to make the driver
work correctly on 64 bit machines.
-rw-r--r-- | synaptics.c | 22 | ||||
-rw-r--r-- | synaptics.h | 16 |
2 files changed, 18 insertions, 20 deletions
diff --git a/synaptics.c b/synaptics.c index 6cf2873..726ae01 100644 --- a/synaptics.c +++ b/synaptics.c @@ -96,7 +96,7 @@ typedef enum { #define MAX(a, b) (((a)>(b))?(a):(b)) #define MIN(a, b) (((a)<(b))?(a):(b)) -#define TIME_DIFF(a, b) ((long)((a)-(b))) +#define TIME_DIFF(a, b) ((int)((a)-(b))) #define SYSCALL(call) while (((call) == -1) && (errno == EINTR)) #ifndef M_PI @@ -276,7 +276,6 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags) pointer optList; #endif char *str_par; - unsigned long now; SynapticsSHM *pars; char *repeater; @@ -331,12 +330,11 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags) priv->timer = NULL; priv->repeatButtons = 0; priv->nextRepeat = 0; - now = GetTimeInMillis(); priv->count_packet_finger = 0; priv->tap_state = TS_START; priv->tap_button = 0; priv->tap_button_state = TBS_BUTTON_UP; - priv->touch_on.millis = now; + priv->touch_on.millis = 0; /* install shared memory or normal memory for parameters */ priv->shm_config = xf86SetBoolOption(local->options, "SHMConfig", FALSE); @@ -811,11 +809,11 @@ ReadInput(LocalDevicePtr local) } static int -HandleMidButtonEmulation(SynapticsPrivate *priv, struct SynapticsHwState *hw, long *delay) +HandleMidButtonEmulation(SynapticsPrivate *priv, struct SynapticsHwState *hw, int *delay) { SynapticsSHM *para = priv->synpara; Bool done = FALSE; - long timeleft; + int timeleft; int mid = 0; while (!done) { @@ -1045,8 +1043,8 @@ HandleTapProcessing(SynapticsPrivate *priv, struct SynapticsHwState *hw, { SynapticsSHM *para = priv->synpara; Bool touch, release, is_timeout, move; - long timeleft, timeout; - long delay = 1000000000; + int timeleft, timeout; + int delay = 1000000000; if (priv->palm) return delay; @@ -1169,7 +1167,7 @@ estimate_delta(double x0, double x1, double x2, double x3) return x0 * 0.3 + x1 * 0.1 - x2 * 0.1 - x3 * 0.3; } -static long +static int ComputeDeltas(SynapticsPrivate *priv, struct SynapticsHwState *hw, edge_type edge, int *dxP, int *dyP) { @@ -1178,7 +1176,7 @@ ComputeDeltas(SynapticsPrivate *priv, struct SynapticsHwState *hw, int dist; double dx, dy; double speed, integral; - long delay = 1000000000; + int delay = 1000000000; dx = dy = 0; @@ -1520,8 +1518,8 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw) int change; struct ScrollData scroll; int double_click, repeat_delay; - long delay = 1000000000; - long timeleft; + int delay = 1000000000; + int timeleft; int i; /* update hardware state in shared memory */ diff --git a/synaptics.h b/synaptics.h index 95266b0..ae2aaf7 100644 --- a/synaptics.h +++ b/synaptics.h @@ -49,10 +49,10 @@ typedef struct _SynapticsSHM /* Parameter data */ int left_edge, right_edge, top_edge, bottom_edge; /* edge coordinates absolute */ int finger_low, finger_high; /* finger detection values in Z-values */ - unsigned long tap_time; + int tap_time; int tap_move; /* max. tapping time and movement in packets and coord. */ - unsigned long tap_time_2; /* max. tapping time for double taps */ - unsigned long click_time; /* The duration of a single click */ + int tap_time_2; /* max. tapping time for double taps */ + int click_time; /* The duration of a single click */ Bool fast_taps; /* Faster reaction to single taps */ int emulate_mid_button_time; /* Max time between left and right button presses to emulate a middle button press. */ @@ -121,7 +121,7 @@ typedef struct _SynapticsSHM typedef struct _SynapticsMoveHist { int x, y; - unsigned int millis; + int millis; } SynapticsMoveHistRec; enum MidButtonEmulation { @@ -177,9 +177,9 @@ typedef struct _SynapticsPrivateRec int scroll_y; /* last y-scroll position */ int scroll_x; /* last x-scroll position */ double scroll_a; /* last angle-scroll position */ - unsigned long count_packet_finger; /* packet counter with finger on the touchpad */ - unsigned int button_delay_millis; /* button delay for 3rd button emulation */ - unsigned int prev_up; /* Previous up button value, for double click emulation */ + int count_packet_finger; /* packet counter with finger on the touchpad */ + int button_delay_millis; /* button delay for 3rd button emulation */ + Bool prev_up; /* Previous up button value, for double click emulation */ Bool finger_flag; /* previous finger */ enum TapState tap_state; /* State of tap processing */ @@ -201,7 +201,7 @@ typedef struct _SynapticsPrivateRec double frac_x, frac_y; /* absolute -> relative fraction */ enum MidButtonEmulation mid_emu_state; /* emulated 3rd button */ int repeatButtons; /* buttons for repeat */ - unsigned long nextRepeat; /* Time when to trigger next auto repeat event */ + int nextRepeat; /* Time when to trigger next auto repeat event */ int lastButtons; /* last state of the buttons */ int palm; /* Set to true when palm detected, reset to false when palm/finger contact disappears */ |