summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-28 14:42:20 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-28 14:42:20 +0200
commit81e37b4b042b824654b4bf2353732741cf49bce7 (patch)
treedab6d24e97d2a7c9b0ac83ed4bf2a64e9791f6b7 /src
parentbda0ee988acbae97dc908574c1247cf1ceb5b3c9 (diff)
Make acecadAutoDev into a flag.
Introduce AUTODEV_FLAG for the flags field in AceCadPrivateRec to tell if we are autodetecting devices or not, instead of having a separate acecadAutoDev field.
Diffstat (limited to 'src')
-rw-r--r--src/acecad.c8
-rw-r--r--src/acecad.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/acecad.c b/src/acecad.c
index 783b2f1..f5d4f25 100644
--- a/src/acecad.c
+++ b/src/acecad.c
@@ -367,12 +367,12 @@ AceCadPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
xf86OptionListReport(local->options);
priv->acecadInc = xf86SetIntOption(local->options, "Increment", 0 );
- priv->acecadAutoDev = FALSE;
+ priv->flags &= ~ AUTODEV_FLAG;
s = xf86FindOptionValue(local->options, "Device");
if (!s || (s && (xf86NameCmp(s, "auto-dev") == 0))) {
#ifdef LINUX_INPUT
- priv->acecadAutoDev = TRUE;
+ priv->flags |= AUTODEV_FLAG;
if (!AceCadAutoDevProbe(local, 0))
{
xf86Msg(X_ERROR, "%s: unable to find device\n", local->name);
@@ -541,7 +541,7 @@ DeviceOn (DeviceIntPtr dev)
{
xf86Msg(X_WARNING, "%s: cannot open input device %s\n", local->name, xf86FindOptionValue(local->options, "Device"));
#ifdef LINUX_INPUT
- if (priv->acecadAutoDev && AceCadAutoDevProbe(local, 4))
+ if ((priv->flags & AUTODEV_FLAG) && AceCadAutoDevProbe(local, 4))
local->fd = xf86OpenSerial(local->options);
if (local->fd == -1)
#endif
@@ -830,7 +830,7 @@ USBReadInput (LocalDevicePtr local)
if (len <= 0) {
xf86Msg(X_ERROR, "%s: error reading device: %s\n", local->name, strerror(errno));
- if ((errno == ENODEV) && priv->acecadAutoDev && AceCadAutoDevProbe(local, 4)) {
+ if ((errno == ENODEV) && (priv->flags & AUTODEV_FLAG) && AceCadAutoDevProbe(local, 4)) {
DeviceOff(local->dev);
DeviceOn(local->dev);
}
diff --git a/src/acecad.h b/src/acecad.h
index acba153..79618ae 100644
--- a/src/acecad.h
+++ b/src/acecad.h
@@ -58,6 +58,7 @@
#define ABSOLUTE_FLAG 1
#define USB_FLAG 2
+#define AUTODEV_FLAG 4
#define milisleep(ms) xf86usleep (ms * 1000)
@@ -78,7 +79,6 @@ typedef struct
int acecadMaxY; /* max Y value */
int acecadMaxZ; /* max Y value */
char acecadReportSpeed; /* report speed */
- BOOL acecadAutoDev; /* are using auto-dev */
int flags; /* various flags */
int packeti; /* number of bytes read */
int PacketSize; /* number of bytes read */