From 0d0b237077aa4f06c011c3e1a3bb66b1e0784fcf Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Sun, 16 Mar 2008 02:44:35 -0300 Subject: [PATCH] Don't call non existing function and compile warning fixes. --- src/xf86MagicTouch.c | 21 ++++++++------------- 1 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/xf86MagicTouch.c b/src/xf86MagicTouch.c index 4de6559..1a784ff 100644 --- a/src/xf86MagicTouch.c +++ b/src/xf86MagicTouch.c @@ -12,12 +12,9 @@ #endif #ifdef XFREE86_V4 - -#ifndef XFree86LOADER #include #include #include -#endif #include #include @@ -213,7 +210,6 @@ static int debug_level = 0; #define read(fd, ptr, num) xf86ReadSerial(fd, ptr, num) #define write(fd, ptr, num) xf86WriteSerial(fd, ptr, num) #define close(fd) xf86CloseSerial(fd) -#define strdup(str) xf86strdup(str) #endif @@ -549,8 +545,10 @@ xf86MagicControl(DeviceIntPtr dev, LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate; MagicPrivatePtr priv = (MagicPrivatePtr)(local->private); unsigned char map[] = { 0, 1 }; - unsigned char req[MAGIC_PACKET_SIZE], replay[MAGIC_PACKET_SIZE]; + unsigned char req[MAGIC_PACKET_SIZE]; +#if 0 int status_line; +#endif switch (mode) { case DEVICE_INIT: @@ -725,7 +723,6 @@ GetPacket(LocalDevicePtr local, unsigned char *buffer, int *n_rx, int fd) int num_bytes; int i; Bool ok; - MagicPrivatePtr priv=(MagicPrivatePtr) local->private; DBG(6, ErrorF("Entering GetPacket with packet_pos == %d\n", *n_rx) ); @@ -851,11 +848,10 @@ xf86MagicReadInput(LocalDevicePtr local) MagicPrivatePtr priv = (MagicPrivatePtr)(local->private); int cur_x, cur_y; Bool touch_now; - static int n_coms = 0; if (!priv->e_presente) { DBG(4, - ErrorF("<<%s[%d]>> ReadInput: Touch Controller non inizializzato\n") + ErrorF("xf86MagicReadInput: Touch Controller non inizializzato\n") ); return; } @@ -874,8 +870,8 @@ xf86MagicReadInput(LocalDevicePtr local) cur_y = priv->packet_buf[3]; cur_y <<= 6; cur_y |= priv->packet_buf[4]; - - touch_now = priv->packet_buf[0] & MGCT_TOUCH == MGCT_TOUCH; + + touch_now = (priv->packet_buf[0] & MGCT_TOUCH) == MGCT_TOUCH; /* Se c'e' pressione sul touch inizio a calcolare la posizione e a spostare il cursore grafico */ @@ -972,8 +968,7 @@ xf86MagicConvert(LocalDevicePtr local, return TRUE; } - - +#ifndef XFree86LOADER /* ************************************************************************ * @@ -1066,7 +1061,7 @@ xf86MagicAllocate(InputDriverPtr drv) return local; } /* xf86MagicAllocae */ - +#endif #ifndef XFREE86_V4 -- 1.5.3.2