The DBG macro prints the device name/device file automatically.

Signed-off-by: Peter Hutterer <[email protected]>
---
 src/wcmCommon.c   |   35 ++++++++++++++++-------------------
 src/wcmXCommand.c |   10 ++++------
 src/xf86Wacom.c   |   21 +++++++++------------
 3 files changed, 29 insertions(+), 37 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 02f5067..fad9e47 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -227,7 +227,7 @@ static void xf86WcmSendButtons(LocalDevicePtr local, int 
buttons, int rx, int ry
        int button, mask;
        WacomDevicePtr priv = (WacomDevicePtr) local->private;
        WacomCommonPtr common = priv->common;
-       DBG(6, priv, "buttons=%d for %s\n", buttons, local->name);
+       DBG(6, priv, "buttons=%d\n", buttons);
 
        /* Tablet PC buttons only apply to penabled devices */
        if (common->wcmTPCButton && (priv->flags & STYLUS_ID))
@@ -461,10 +461,10 @@ static void sendAButton(LocalDevicePtr local, int button, 
int mask,
                return;
 
        DBG(4, priv, "TPCButton(%s) button=%d state=%d " 
-               "code=%08x, for %s coreEvent=%s \n", 
+               "code=%08x, coreEvent=%s \n", 
                common->wcmTPCButton ? "on" : "off", 
                button, mask, priv->button[button], 
-               local->name, (priv->button[button] & AC_CORE) ? "yes" : "no");
+               (priv->button[button] & AC_CORE) ? "yes" : "no");
 
        if (!priv->keys[button][0])
        {
@@ -577,7 +577,7 @@ static void sendWheelStripEvents(LocalDevicePtr local, 
const WacomDeviceState* d
        unsigned  *keyP = 0;
        int is_absolute = priv->flags & ABSOLUTE_FLAG;
 
-       DBG(10, priv, "strip events for %s \n", local->name);
+       DBG(10, priv, "\n");
 
        /* emulate events for relative wheel */
        if ( ds->relwheel )
@@ -745,9 +745,9 @@ void xf86WcmSendEvents(LocalDevicePtr local, const 
WacomDeviceState* ds)
 
        if (priv->serial && serial != priv->serial)
        {
-               DBG(10, priv, "[%s] serial number"
+               DBG(10, priv, "serial number"
                        " is %u but your system configured %u", 
-                       local->name, serial, (int)priv->serial);
+                       serial, (int)priv->serial);
                return;
        }
 
@@ -820,10 +820,9 @@ void xf86WcmSendEvents(LocalDevicePtr local, const 
WacomDeviceState* ds)
        }
        v5 = wheel;
 
-       DBG(6, priv, "[%s] %s prox=%d\tx=%d"
+       DBG(6, priv, "%s prox=%d\tx=%d"
                "\ty=%d\tz=%d\tv3=%d\tv4=%d\tv5=%d\tid=%d"
                "\tserial=%u\tbutton=%s\tbuttons=%d\n",
-               local->name,
                is_absolute ? "abs" : "rel",
                is_proximity,
                x, y, z, v3, v4, v5, id, serial,
@@ -1802,10 +1801,10 @@ static void xf86WcmInitialTVScreens(LocalDevicePtr 
local)
                priv->screenBottomY[1] = priv->tvResolution[1];
        }
 
-       DBG(10, priv, "\"%s\":"
+       DBG(10, priv,
                "topX0=%d topY0=%d bottomX0=%d bottomY0=%d "
                "topX1=%d topY1=%d bottomX1=%d bottomY1=%d \n",
-               local->name, priv->screenTopX[0], priv->screenTopY[0],
+               priv->screenTopX[0], priv->screenTopY[0],
                priv->screenBottomX[0], priv->screenBottomY[0],
                priv->screenTopX[1], priv->screenTopY[1],
                priv->screenBottomX[1], priv->screenBottomY[1]);
@@ -1820,8 +1819,7 @@ void xf86WcmInitialScreens(LocalDevicePtr local)
        WacomDevicePtr priv = (WacomDevicePtr)local->private;
        int i;
 
-       DBG(2, priv, "\"%s\":"
-               "number of screen=%d \n", local->name, screenInfo.numScreens);
+       DBG(2, priv, "number of screen=%d \n", screenInfo.numScreens);
        priv->tvoffsetX = 0;
        priv->tvoffsetY = 0;
        if (priv->twinview != TV_NONE)
@@ -1845,18 +1843,17 @@ void xf86WcmInitialScreens(LocalDevicePtr local)
                        priv->screenBottomX[i] = dixScreenOrigins[i].x;
                        priv->screenBottomY[i] = dixScreenOrigins[i].y;
 
-                       DBG(10, priv, "from dix for \"%s\" "
+                       DBG(10, priv, "from dix: "
                                "ScreenOrigins[%d].x=%d ScreenOrigins[%d].y=%d 
\n",
-                               local->name, i, priv->screenTopX[i], i,
-                               priv->screenTopY[i]);
+                               i, priv->screenTopX[i], i, priv->screenTopY[i]);
                }
 
                priv->screenBottomX[i] += screenInfo.screens[i]->width;
                priv->screenBottomY[i] += screenInfo.screens[i]->height;
 
-               DBG(10, priv, "\"%s\":"
+               DBG(10, priv,
                        "topX[%d]=%d topY[%d]=%d bottomX[%d]=%d bottomY[%d]=%d 
\n",
-                       local->name, i, priv->screenTopX[i], i, 
priv->screenTopY[i],
+                       i, priv->screenTopX[i], i, priv->screenTopY[i],
                        i, priv->screenBottomX[i], i, priv->screenBottomY[i]);
        }
 }
@@ -1871,7 +1868,7 @@ static void rotateOneTool(WacomDevicePtr priv)
        WacomToolAreaPtr area = priv->toolarea;
        int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
 
-       DBG(10, priv, "\"%s\"", priv->local->name);
+       DBG(10, priv, "\n");
 
        if (!IsTouch(priv))
        {
@@ -1948,7 +1945,7 @@ void xf86WcmRotateTablet(LocalDevicePtr local, int value)
        int oldRotation;
        int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
 
-       DBG(10, priv, "\"%s\":\n", local->name);
+       DBG(10, priv, "\n");
 
        if (common->wcmRotate == value) /* initialization */
        {
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index 60cbfa0..eecd759 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -71,8 +71,7 @@ int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode)
        WacomDevicePtr priv = (WacomDevicePtr)local->private;
        int is_absolute = priv->flags & ABSOLUTE_FLAG;
 
-       DBG(3, priv, "%s to mode=%d\n",
-               local->name, mode);
+       DBG(3, priv, "to mode=%d\n", mode);
 
        /* Pad is always in relative mode when it's a core device.
         * Always in absolute mode when it is not a core device.
@@ -96,8 +95,7 @@ int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode)
        }
        else if ( (mode != Absolute) && (mode != Relative))
        {
-               DBG(10, priv,
-                       "%s invalid mode=%d\n", local->name, mode);
+               DBG(10, priv, "invalid mode=%d\n", mode);
                return BadMatch;
        }
 
@@ -211,7 +209,7 @@ void InitWcmDeviceProperties(LocalDevicePtr local)
     WacomCommonPtr common = priv->common;
     int values[WCM_MAX_MOUSE_BUTTONS];
 
-    DBG(10, priv, "%s\n", local->name);
+    DBG(10, priv, "\n");
 
     values[0] = priv->topX;
     values[1] = priv->topY;
@@ -299,7 +297,7 @@ int xf86WcmSetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
     WacomDevicePtr priv = (WacomDevicePtr) local->private;
     WacomCommonPtr common = priv->common;
 
-    DBG(10, priv, "%s\n", local->name);
+    DBG(10, priv, "\n");
 
     if (property == prop_tablet_area)
     {
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 5938a55..477107f 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -296,8 +296,7 @@ void xf86WcmVirtualTabletPadding(LocalDevicePtr local)
                priv->topPadding = (int)((double)(priv->screenTopY[i] * 
priv->topPadding)
                        / ((double)(priv->screenBottomY[i] - 
priv->screenTopY[i])) + 0.5);
        }
-       DBG(10, priv, "\"%s\" "
-               "x=%d y=%d \n", local->name, priv->leftPadding, 
priv->topPadding);
+       DBG(10, priv, "x=%d y=%d \n", priv->leftPadding, priv->topPadding);
        return;
 }
 
@@ -336,8 +335,7 @@ void xf86WcmVirtualTabletSize(LocalDevicePtr local)
                priv->sizeY += (int)((double)((priv->maxHeight - 
priv->screenBottomY[i])
                        * tabletSize) / ((double)(priv->screenBottomY[i] - 
priv->screenTopY[i])) + 0.5);
        }
-       DBG(10, priv, "\"%s\" "
-               "x=%d y=%d \n", local->name, priv->sizeX, priv->sizeY);
+       DBG(10, priv, "x=%d y=%d \n", priv->sizeX, priv->sizeY);
        return;
 }
 
@@ -976,7 +974,7 @@ static Bool xf86WcmOpen(LocalDevicePtr local)
        int rc;
        struct serial_struct ser;
 
-       DBG(1, priv, "opening %s\n", common->wcmDevice);
+       DBG(1, priv, "opening device file\n");
 
        local->fd = xf86OpenSerial(local->options);
        if (local->fd < 0)
@@ -1066,8 +1064,8 @@ static int xf86WcmDevOpen(DeviceIntPtr pWcm)
                if (fstat(local->fd, &st) == -1)
                {
                        /* can not access major/minor */
-                       DBG(1, priv, "%s: stat failed (%s). "
-                               "cannot check status.\n", local->name, 
strerror(errno));
+                       DBG(1, priv, "stat failed (%s). "
+                               "cannot check status.\n", strerror(errno));
 
                        /* older systems don't support the required ioctl.
                         * So, we have to let it pass */
@@ -1098,7 +1096,7 @@ static int xf86WcmReady(LocalDevicePtr local)
        WacomDevicePtr priv = (WacomDevicePtr)local->private;
 #endif
        int n = xf86WaitForInput(local->fd, 0);
-       DBG(10, priv, "%s with %d numbers of data\n", local->name, n);
+       DBG(10, priv, "%d numbers of data\n", n);
 
        if (n >= 0) return n ? 1 : 0;
        xf86Msg(X_ERROR, "%s: select error: %s\n", local->name, 
strerror(errno));
@@ -1142,8 +1140,7 @@ void wcmReadPacket(LocalDevicePtr local)
        int len, pos, cnt, remaining;
        unsigned char * data;
 
-       DBG(10, common, "device=%s"
-               " fd=%d \n", common->wcmDevice, local->fd);
+       DBG(10, common, "fd=%d\n", local->fd);
 
        remaining = sizeof(common->buffer) - common->bufpos;
 
@@ -1285,12 +1282,12 @@ static int xf86WcmDevProc(DeviceIntPtr pWcm, int what)
        WacomDevicePtr priv = (WacomDevicePtr)local->private;
 
        DBG(2, priv, "BEGIN dev=%p priv=%p "
-                       "type=%s(%s) flags=%d fd=%d what=%s\n",
+                       "type=%s flags=%d fd=%d what=%s\n",
                        (void *)pWcm, (void *)priv,
                        IsStylus(priv) ? "stylus" :
                        IsCursor(priv) ? "cursor" :
                        IsPad(priv) ? "pad" : "eraser", 
-                       local->name, priv->flags, local ? local->fd : -1,
+                       priv->flags, local ? local->fd : -1,
                        (what == DEVICE_INIT) ? "INIT" :
                        (what == DEVICE_OFF) ? "OFF" :
                        (what == DEVICE_ON) ? "ON" :
-- 
1.6.5.2


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to