summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-12-23 10:03:16 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-12-24 09:00:24 +1000
commitea0591783f7c32dc9c650bc1b1f12a7c62379991 (patch)
tree77640c667152f4ffb508d93df182060884d63768
parent0501b9977050dbec74c72dbd8c78f2b72df43ab9 (diff)
downloadxf86-input-wacom-ea0591783f7c32dc9c650bc1b1f12a7c62379991.tar.gz
Merge the function name into the DBG macro.
Each time DBG is called, prefix with __func__ regardless of the actual message. An empty DBG string thus prints "function name:". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/wcmCommon.c48
-rw-r--r--src/wcmConfig.c4
-rw-r--r--src/wcmFilter.c2
-rw-r--r--src/wcmISDV4.c10
-rw-r--r--src/wcmTouchFilter.c6
-rw-r--r--src/wcmUSB.c20
-rw-r--r--src/wcmXCommand.c16
-rw-r--r--src/xf86Wacom.c40
-rw-r--r--src/xf86Wacom.h6
9 files changed, 76 insertions, 76 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 128467f..f0a6866 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -56,8 +56,8 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
void xf86WcmMappingFactor(LocalDevicePtr local)
{
WacomDevicePtr priv = (WacomDevicePtr) local->private;
-
- DBG(10, priv->debugLevel, "xf86WcmMappingFactor \n");
+
+ DBG(10, priv->debugLevel, "\n"); /* just prints function name */
xf86WcmVirtualTabletSize(local);
@@ -81,9 +81,9 @@ void xf86WcmMappingFactor(LocalDevicePtr local)
if (priv->currentScreen == -1) /* tool on the tablet */
priv->currentScreen = 0;
- DBG(10, priv->debugLevel, "xf86WcmMappingFactor"
- " Active tablet area x=%d y=%d (virtual tablet area x=%d y=%d) map"
- " to maxWidth =%d maxHeight =%d\n",
+ DBG(10, priv->debugLevel,
+ "Active tablet area x=%d y=%d (virtual tablet area x=%d y=%d) map"
+ " to maxWidth =%d maxHeight =%d\n",
priv->bottomX, priv->bottomY, priv->sizeX, priv->sizeY,
priv->maxWidth, priv->maxHeight);
@@ -106,7 +106,7 @@ static void xf86WcmSetScreen(LocalDevicePtr local, int v0, int v1)
WacomDevicePtr priv = (WacomDevicePtr) local->private;
int screenToSet = -1, i, j, x, y, tabletSize = 0;
- DBG(6, priv->debugLevel, "xf86WcmSetScreen v0=%d v1=%d "
+ DBG(6, priv->debugLevel, "v0=%d v1=%d "
"currentScreen=%d\n", v0, v1, priv->currentScreen);
if (priv->screen_no != -1 && priv->screen_no >= priv->numScreen)
@@ -152,7 +152,7 @@ static void xf86WcmSetScreen(LocalDevicePtr local, int v0, int v1)
if (v0 > priv->topY && v0 <= priv->topY + priv->tvoffsetY)
priv->currentScreen = 1;
}
- DBG(10, priv->debugLevel, "xf86WcmSetScreen TwinView setup screenToSet=%d\n",
+ DBG(10, priv->debugLevel, "TwinView setup screenToSet=%d\n",
priv->currentScreen);
}
@@ -194,7 +194,7 @@ static void xf86WcmSetScreen(LocalDevicePtr local, int v0, int v1)
if (screenToSet == -1)
{
- DBG(3, priv->debugLevel, "xf86WcmSetScreen Error: "
+ DBG(3, priv->debugLevel, "Error: "
"Can not find valid screen (currentScreen=%d)\n",
priv->currentScreen);
return;
@@ -210,7 +210,7 @@ static void xf86WcmSetScreen(LocalDevicePtr local, int v0, int v1)
y = screenInfo.screens[screenToSet]->height - 1;
xf86XInputSetScreen(local, screenToSet, x, y);
- DBG(10, priv->debugLevel, "xf86WcmSetScreen current=%d ToSet=%d\n",
+ DBG(10, priv->debugLevel, "current=%d ToSet=%d\n",
priv->currentScreen, screenToSet);
priv->currentScreen = screenToSet;
}
@@ -227,8 +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->debugLevel, "xf86WcmSendButtons "
- "buttons=%d for %s\n", buttons, local->name);
+ DBG(6, priv->debugLevel, "buttons=%d for %s\n", buttons, local->name);
/* Tablet PC buttons only apply to penabled devices */
if (common->wcmTPCButton && (priv->flags & STYLUS_ID))
@@ -461,7 +460,7 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
if (!priv->button[button]) /* ignore this button event */
return;
- DBG(4, priv->debugLevel, "sendAButton TPCButton(%s) button=%d state=%d "
+ DBG(4, priv->debugLevel, "TPCButton(%s) button=%d state=%d "
"code=%08x, for %s coreEvent=%s \n",
common->wcmTPCButton ? "on" : "off",
button, mask, priv->button[button],
@@ -578,7 +577,7 @@ static void sendWheelStripEvents(LocalDevicePtr local, const WacomDeviceState* d
unsigned *keyP = 0;
int is_absolute = priv->flags & ABSOLUTE_FLAG;
- DBG(10, priv->debugLevel, "sendWheelStripEvents for %s \n", local->name);
+ DBG(10, priv->debugLevel, "strip events for %s \n", local->name);
/* emulate events for relative wheel */
if ( ds->relwheel )
@@ -668,8 +667,7 @@ static void sendWheelStripEvents(LocalDevicePtr local, const WacomDeviceState* d
if (!fakeButton) return;
- DBG(10, priv->debugLevel, "sendWheelStripEvents "
- "send fakeButton %x with value = %d \n",
+ DBG(10, priv->debugLevel, "send fakeButton %x with value = %d \n",
fakeButton, value);
switch (fakeButton & AC_TYPE)
@@ -1068,7 +1066,7 @@ static int xf86WcmSuppress(WacomCommonPtr common, const WacomDeviceState* dsOrig
dsNew->y = dsOrig->y;
}
- DBG(10, common->debugLevel, "xf86WcmSuppress at level = %d"
+ DBG(10, common->debugLevel, "level = %d"
" return value = %d\n", suppress, returnV);
return returnV;
}
@@ -1103,7 +1101,7 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel,
pChannel = common->wcmChannel + channel;
pLast = &pChannel->valid.state;
- DBG(10, common->debugLevel, "wcmEvent at channel = %d\n", channel);
+ DBG(10, common->debugLevel, "channel = %d\n", channel);
/* sanity check the channel */
if (channel >= MAX_CHANNELS)
@@ -1115,7 +1113,7 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel,
/* timestamp the state for velocity and acceleration analysis */
ds.sample = (int)GetTimeInMillis();
- DBG(10, common->debugLevel, "wcmEvent: "
+ DBG(10, common->debugLevel,
"c=%d i=%d t=%d s=%u x=%d y=%d b=%d "
"p=%d rz=%d tx=%d ty=%d aw=%d rw=%d "
"t=%d df=%d px=%d st=%d cs=%d \n",
@@ -1337,7 +1335,7 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
}
}
- DBG(10, common->debugLevel, "commonDispatchDevice device type = %d\n", ds->device_type);
+ DBG(10, common->debugLevel, "device type = %d\n", ds->device_type);
/* Find the device the current events are meant for */
/* 1: Find the tool (the one with correct serial or in second
* hand, the one with serial set to 0 if no match with the
@@ -1804,7 +1802,7 @@ static void xf86WcmInitialTVScreens(LocalDevicePtr local)
priv->screenBottomY[1] = priv->tvResolution[1];
}
- DBG(10, priv->debugLevel, "xf86WcmInitialTVScreens for \"%s\" "
+ DBG(10, priv->debugLevel, "\"%s\":"
"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],
@@ -1822,7 +1820,7 @@ void xf86WcmInitialScreens(LocalDevicePtr local)
WacomDevicePtr priv = (WacomDevicePtr)local->private;
int i;
- DBG(2, priv->debugLevel, "xf86WcmInitialScreens for \"%s\" "
+ DBG(2, priv->debugLevel, "\"%s\":"
"number of screen=%d \n", local->name, screenInfo.numScreens);
priv->tvoffsetX = 0;
priv->tvoffsetY = 0;
@@ -1847,7 +1845,7 @@ void xf86WcmInitialScreens(LocalDevicePtr local)
priv->screenBottomX[i] = dixScreenOrigins[i].x;
priv->screenBottomY[i] = dixScreenOrigins[i].y;
- DBG(10, priv->debugLevel, "xf86WcmInitialScreens from dix for \"%s\" "
+ DBG(10, priv->debugLevel, "from dix for \"%s\" "
"ScreenOrigins[%d].x=%d ScreenOrigins[%d].y=%d \n",
local->name, i, priv->screenTopX[i], i,
priv->screenTopY[i]);
@@ -1856,7 +1854,7 @@ void xf86WcmInitialScreens(LocalDevicePtr local)
priv->screenBottomX[i] += screenInfo.screens[i]->width;
priv->screenBottomY[i] += screenInfo.screens[i]->height;
- DBG(10, priv->debugLevel, "xf86WcmInitialScreens for \"%s\" "
+ DBG(10, priv->debugLevel, "\"%s\":"
"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->screenBottomX[i], i, priv->screenBottomY[i]);
@@ -1873,7 +1871,7 @@ static void rotateOneTool(WacomDevicePtr priv)
WacomToolAreaPtr area = priv->toolarea;
int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
- DBG(10, priv->debugLevel, "rotateOneTool for \"%s\" \n", priv->local->name);
+ DBG(10, priv->debugLevel, "\"%s\"", priv->local->name);
if (!IsTouch(priv))
{
@@ -1950,7 +1948,7 @@ void xf86WcmRotateTablet(LocalDevicePtr local, int value)
int oldRotation;
int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
- DBG(10, priv->debugLevel, "xf86WcmRotateTablet for \"%s\" \n", local->name);
+ DBG(10, priv->debugLevel, "\"%s\":\n", local->name);
if (common->wcmRotate == value) /* initialization */
{
diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index 3d8cd03..137a2d1 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -229,7 +229,7 @@ static void xf86WcmUninit(InputDriverPtr drv, LocalDevicePtr local, int flags)
WacomDevicePtr dev;
WacomDevicePtr *prev;
- DBG(1, priv->debugLevel, "xf86WcmUninit\n");
+ DBG(1, priv->debugLevel, "\n");
if (priv->isParent)
{
@@ -290,7 +290,7 @@ static Bool xf86WcmMatchDevice(LocalDevicePtr pMatch, LocalDevicePtr pLocal)
!strcmp(privMatch->common->wcmDevice, common->wcmDevice))
{
DBG(2, priv->debugLevel,
- "xf86WcmInit wacom port share between"
+ "port share between"
" %s and %s\n", pLocal->name, pMatch->name);
type = xf86FindOptionValue(pMatch->options, "Type");
if ( type && (strstr(type, "eraser")) )
diff --git a/src/wcmFilter.c b/src/wcmFilter.c
index 748f699..5b0ff7c 100644
--- a/src/wcmFilter.c
+++ b/src/wcmFilter.c
@@ -248,7 +248,7 @@ int wcmFilterCoord(WacomCommonPtr common, WacomChannelPtr pChannel,
WacomDeviceState *pLast;
int *x, *y, i;
- DBG(10, common->debugLevel, "wcmFilterCoord with "
+ DBG(10, common->debugLevel,
"common->wcmRawSample = %d \n", common->wcmRawSample);
x = pChannel->rawFilter.x;
y = pChannel->rawFilter.y;
diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
index d7e26ae..045e469 100644
--- a/src/wcmISDV4.c
+++ b/src/wcmISDV4.c
@@ -281,7 +281,7 @@ static int isdv4GetRanges(LocalDevicePtr local)
if (!common->wcmMaxX || !common->wcmMaxY)
common->tablet_id = 0xE2;
- DBG(2, priv->debugLevel, "isdv4GetRanges Pen speed=%d "
+ DBG(2, priv->debugLevel, "Pen speed=%d "
"maxX=%d maxY=%d maxZ=%d resX=%d resY=%d \n",
common->wcmISDV4Speed, common->wcmMaxX, common->wcmMaxY,
common->wcmMaxZ, common->wcmResolX, common->wcmResolY);
@@ -367,7 +367,7 @@ static int isdv4GetRanges(LocalDevicePtr local)
common->wcmVersion = ( data[10] | (data[9] << 7) );
ret = Success;
- DBG(2, priv->debugLevel, "isdv4GetRanges touch speed=%d "
+ DBG(2, priv->debugLevel, "touch speed=%d "
"maxTouchX=%d maxTouchY=%d TouchresX=%d TouchresY=%d \n",
common->wcmISDV4Speed, common->wcmMaxTouchX,
common->wcmMaxTouchY, common->wcmTouchResolX,
@@ -401,7 +401,7 @@ static int isdv4Parse(LocalDevicePtr local, const unsigned char* data)
WacomDeviceState* ds;
int n, cur_type, channel = 0;
- DBG(10, common->debugLevel, "isdv4Parse \n");
+ DBG(10, common->debugLevel, "\n");
/* determine the type of message (touch or stylus) */
if (data[0] & 0x10) /* a touch data */
@@ -484,7 +484,7 @@ static int isdv4Parse(LocalDevicePtr local, const unsigned char* data)
}
}
- DBG(8, priv->debugLevel, "isdv4Parse MultiTouch "
+ DBG(8, priv->debugLevel, "MultiTouch "
"%s proximity \n", ds->proximity ? "in" : "out of");
}
else
@@ -536,7 +536,7 @@ static int isdv4Parse(LocalDevicePtr local, const unsigned char* data)
ds->device_id = ERASER_DEVICE_ID;
}
- DBG(8, priv->debugLevel, "isdv4Parse %s\n",
+ DBG(8, priv->debugLevel, "%s\n",
ds->device_type == ERASER_ID ? "ERASER " :
ds->device_type == STYLUS_ID ? "STYLUS" : "NONE");
}
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
index be9fd00..28b75fd 100644
--- a/src/wcmTouchFilter.c
+++ b/src/wcmTouchFilter.c
@@ -129,7 +129,7 @@ void xf86WcmFingerTapToClick(WacomCommonPtr common)
secondChannel->valid.states[1] };
int direction = 0;
- DBG(10, priv->debugLevel, "xf86WcmFingerTapToClick \n");
+ DBG(10, priv->debugLevel, "\n");
/* skip initial second finger event */
if (!dsLast[1].proximity)
@@ -316,7 +316,7 @@ static void xf86WcmFingerScroll(WacomDevicePtr priv)
int gesture = 0;
WacomFilterState filterd; /* borrow this struct */
- DBG(10, priv->debugLevel, "xf86WcmFingerScroll \n");
+ DBG(10, priv->debugLevel, "\n");
/* initialize the points so we can rotate them */
filterd.x[0] = ds[0].x;
@@ -391,7 +391,7 @@ static void xf86WcmFingerZoom(WacomDevicePtr priv)
int dist = touchDistance(common->wcmGestureState[0],
common->wcmGestureState[1]);
- DBG(10, priv->debugLevel, "xf86WcmFingerZoom \n");
+ DBG(10, priv->debugLevel, "\n");
dist = touchDistance(ds[0], ds[1]) - dist;
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 2ed329e..8504870 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -372,7 +372,7 @@ static Bool usbDetect(LocalDevicePtr local)
#ifdef DEBUG
WacomDevicePtr priv = (WacomDevicePtr)local->private;
- DBG(1, priv->debugLevel, "usbDetect\n");
+ DBG(1, priv->debugLevel, "\n");
#endif
SYSCALL(err = ioctl(local->fd, EVIOCGVERSION, &version));
@@ -722,7 +722,7 @@ static int usbDetectConfig(LocalDevicePtr local)
WacomDevicePtr priv = (WacomDevicePtr)local->private;
WacomCommonPtr common = priv->common;
- DBG(10, common->debugLevel, "usbDetectConfig \n");
+ DBG(10, common->debugLevel, "\n");
if (IsPad (priv))
priv->nbuttons = common->npadkeys;
else
@@ -813,7 +813,7 @@ static int usbChooseChannel(WacomCommonPtr common, int serial)
wcmEvent(common, i, &common->wcmChannel[i].work);
}
}
- DBG(1, common->debugLevel, "usbParse (device with serial number: %u)"
+ DBG(1, common->debugLevel, "device with serial number: %u"
" at %d: Exceeded channel count; ignoring the events.\n",
serial, (int)GetTimeInMillis());
}
@@ -830,7 +830,7 @@ static void usbParseEvent(LocalDevicePtr local,
WacomDevicePtr priv = (WacomDevicePtr)local->private;
WacomCommonPtr common = priv->common;
- DBG(10, common->debugLevel, "usbParseEvent \n");
+ DBG(10, common->debugLevel, "\n");
/* store events until we receive the MSC_SERIAL containing
* the serial number; without it we cannot determine the
* correct channel. */
@@ -890,7 +890,7 @@ static void usbParseEvent(LocalDevicePtr local,
/* ignore events without information */
if (common->wcmEventCnt <= 2)
{
- DBG(3, common->debugLevel, "%s - usbParse: dropping empty event"
+ DBG(3, common->debugLevel, "%s: dropping empty event"
" for serial %d\n", local->name, common->wcmLastToolSerial);
goto skipEvent;
}
@@ -923,7 +923,7 @@ static void usbParseChannel(LocalDevicePtr local, int channel)
WacomDevicePtr priv = (WacomDevicePtr)local->private;
WacomCommonPtr common = priv->common;
- DBG(6, common->debugLevel, "usbParseChannel %d events received\n", common->wcmEventCnt);
+ DBG(6, common->debugLevel, "%d events received\n", common->wcmEventCnt);
#define MOD_BUTTONS(bit, value) do { \
shift = 1<<bit; \
ds->buttons = (((value) != 0) ? \
@@ -931,10 +931,10 @@ static void usbParseChannel(LocalDevicePtr local, int channel)
} while (0)
if (common->wcmEventCnt == 1 && !common->wcmEvents->type) {
- DBG(6, common->debugLevel, "usbParseChannel no real events received\n");
+ DBG(6, common->debugLevel, "no real events received\n");
return;
}
- DBG(6, common->debugLevel, "usbParseChannel %d events received\n", common->wcmEventCnt);
+ DBG(6, common->debugLevel, "%d events received\n", common->wcmEventCnt);
/* all USB data operates from previous context except relative values*/
ds = &common->wcmChannel[channel].work;
@@ -945,7 +945,7 @@ static void usbParseChannel(LocalDevicePtr local, int channel)
for (i=0; i<common->wcmEventCnt; ++i)
{
event = common->wcmEvents + i;
- DBG(11, common->debugLevel, "usbParseChannel "
+ DBG(11, common->debugLevel,
"event[%d]->type=%d code=%d value=%d\n",
i, event->type, event->code, event->value);
@@ -1115,7 +1115,7 @@ static void usbParseChannel(LocalDevicePtr local, int channel)
if (((common->tablet_id == 0xC0) || (common->tablet_id == 0xC2)) &&
(ds->device_type == ERASER_ID))
{
- DBG(10, common->debugLevel, "usbParseChannel "
+ DBG(10, common->debugLevel,
"DTF 720 doesn't support eraser ");
return;
}
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index c10f9ae..4ebbf10 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -50,7 +50,7 @@ int xf86WcmSetPadCoreMode(LocalDevicePtr local)
/* Pad is always in relative mode when it's a core device.
* Always in absolute mode when it is not a core device.
*/
- DBG(10, priv->debugLevel, "xf86WcmSetPadCoreMode (%p)"
+ DBG(10, priv->debugLevel, "%p"
" is always in %s mode when it %s core device\n",
(void *)local->dev,
!is_core ? "absolute" : "relative",
@@ -71,7 +71,7 @@ int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode)
WacomDevicePtr priv = (WacomDevicePtr)local->private;
int is_absolute = priv->flags & ABSOLUTE_FLAG;
- DBG(3, priv->debugLevel, "xf86WcmSwitchModeCall for %s to mode=%d\n",
+ DBG(3, priv->debugLevel, "%s to mode=%d\n",
local->name, mode);
/* Pad is always in relative mode when it's a core device.
@@ -96,8 +96,8 @@ int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode)
}
else if ( (mode != Absolute) && (mode != Relative))
{
- DBG(10, priv->debugLevel, "xf86WcmSwitchModeCall"
- " for %s invalid mode=%d\n", local->name, mode);
+ DBG(10, priv->debugLevel,
+ "%s invalid mode=%d\n", local->name, mode);
return BadMatch;
}
@@ -114,7 +114,7 @@ int xf86WcmDevSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode)
#ifdef DEBUG
WacomDevicePtr priv = (WacomDevicePtr)local->private;
- DBG(3, priv->debugLevel, "xf86WcmSwitchMode dev=%p mode=%d\n",
+ DBG(3, priv->debugLevel, "dev=%p mode=%d\n",
(void *)dev, mode);
#endif
/* Share this call with sendAButton in wcmCommon.c */
@@ -211,7 +211,7 @@ void InitWcmDeviceProperties(LocalDevicePtr local)
WacomCommonPtr common = priv->common;
int values[WCM_MAX_MOUSE_BUTTONS];
- DBG(10, priv->debugLevel, "InitWcmDeviceProperties for %s \n", local->name);
+ DBG(10, priv->debugLevel, "%s\n", local->name);
values[0] = priv->topX;
values[1] = priv->topY;
@@ -299,7 +299,7 @@ int xf86WcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
WacomDevicePtr priv = (WacomDevicePtr) local->private;
WacomCommonPtr common = priv->common;
- DBG(10, priv->debugLevel, "xf86WcmSetProperty for %s \n", local->name);
+ DBG(10, priv->debugLevel, "%s\n", local->name);
if (property == prop_tablet_area)
{
@@ -497,7 +497,7 @@ int xf86WcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
{
screen = -1;
priv->currentScreen = 0;
- DBG(10, priv->debugLevel, "xf86WcmSetProperty TwinView sets to "
+ DBG(10, priv->debugLevel, "TwinView sets to "
"TV_NONE: can't change screen_no. \n");
}
xf86WcmChangeScreen(local, screen);
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index d91376d..4d61bb9 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -148,7 +148,7 @@ static int xf86WcmInitArea(LocalDevicePtr local)
double screenRatio, tabletRatio;
int bottomx = common->wcmMaxX, bottomy = common->wcmMaxY;
- DBG(10, priv->debugLevel, "xf86WcmInitArea\n");
+ DBG(10, priv->debugLevel, "\n");
if (IsTouch(priv))
{
@@ -296,7 +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->debugLevel, "xf86WcmVirtualTabletPadding for \"%s\" "
+ DBG(10, priv->debugLevel, "\"%s\" "
"x=%d y=%d \n", local->name, priv->leftPadding, priv->topPadding);
return;
}
@@ -336,7 +336,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->debugLevel, "xf86WcmVirtualTabletSize for \"%s\" "
+ DBG(10, priv->debugLevel, "\"%s\" "
"x=%d y=%d \n", local->name, priv->sizeX, priv->sizeY);
return;
}
@@ -656,7 +656,7 @@ static int xf86WcmRegisterX11Devices (LocalDevicePtr local)
* This is only a workaround.
*/
- DBG(10, priv->debugLevel, "xf86WcmRegisterX11Devices "
+ DBG(10, priv->debugLevel,
"(%s) %d buttons, %d keys, %d axes\n",
IsStylus(priv) ? "stylus" :
IsCursor(priv) ? "cursor" :
@@ -1035,7 +1035,7 @@ static int xf86WcmDevOpen(DeviceIntPtr pWcm)
WacomCommonPtr common = priv->common;
struct stat st;
- DBG(10, priv->debugLevel, "xf86WcmDevOpen\n");
+ DBG(10, priv->debugLevel, "\n");
/* Device has been open and not autoprobed */
if (priv->wcmDevOpenCount)
@@ -1098,7 +1098,7 @@ static int xf86WcmReady(LocalDevicePtr local)
WacomDevicePtr priv = (WacomDevicePtr)local->private;
#endif
int n = xf86WaitForInput(local->fd, 0);
- DBG(10, priv->debugLevel, "xf86WcmReady for %s with %d numbers of data\n", local->name, n);
+ DBG(10, priv->debugLevel, "%s with %d numbers of data\n", local->name, n);
if (n >= 0) return n ? 1 : 0;
xf86Msg(X_ERROR, "%s: select error: %s\n", local->name, strerror(errno));
@@ -1130,9 +1130,9 @@ static void xf86WcmDevReadInput(LocalDevicePtr local)
/* report how well we're doing */
if (loop >= MAX_READ_LOOPS)
- DBG(1, priv->debugLevel, "xf86WcmDevReadInput: Can't keep up!!!\n");
+ DBG(1, priv->debugLevel, "Can't keep up!!!\n");
else if (loop > 0)
- DBG(10, priv->debugLevel, "xf86WcmDevReadInput: Read (%d)\n",loop);
+ DBG(10, priv->debugLevel, "Read (%d)\n",loop);
}
void wcmReadPacket(LocalDevicePtr local)
@@ -1142,12 +1142,12 @@ void wcmReadPacket(LocalDevicePtr local)
int len, pos, cnt, remaining;
unsigned char * data;
- DBG(10, common->debugLevel, "wcmReadPacket: device=%s"
+ DBG(10, common->debugLevel, "device=%s"
" fd=%d \n", common->wcmDevice, local->fd);
remaining = sizeof(common->buffer) - common->bufpos;
- DBG(1, common->debugLevel, "wcmReadPacket: pos=%d"
+ DBG(1, common->debugLevel, "pos=%d"
" remaining=%d\n", common->bufpos, remaining);
/* fill buffer with as much data as we can handle */
@@ -1171,7 +1171,7 @@ void wcmReadPacket(LocalDevicePtr local)
/* account for new data */
common->bufpos += len;
- DBG(10, common->debugLevel, "wcmReadPacket buffer has %d bytes\n",
+ DBG(10, common->debugLevel, "buffer has %d bytes\n",
common->bufpos);
pos = 0;
@@ -1232,7 +1232,7 @@ int xf86WcmDevChangeControl(LocalDevicePtr local, xDeviceCtl * control)
{
#ifdef DEBUG
WacomDevicePtr priv = (WacomDevicePtr)local->private;
- DBG(3, priv->debugLevel, "xf86WcmDevChangeControl called\n");
+ DBG(3, priv->debugLevel, "\n");
#endif
return Success;
}
@@ -1247,7 +1247,7 @@ static void xf86WcmDevControlProc(DeviceIntPtr device, PtrCtrl* ctrl)
LocalDevicePtr local = (LocalDevicePtr)device->public.devicePrivate;
WacomDevicePtr priv = (WacomDevicePtr)local->private;
- DBG(4, priv->debugLevel, "Wacom Dev Control Proc called\n");
+ DBG(4, priv->debugLevel, "called\n");
#endif
return;
}
@@ -1284,7 +1284,7 @@ static int xf86WcmDevProc(DeviceIntPtr pWcm, int what)
LocalDevicePtr local = (LocalDevicePtr)pWcm->public.devicePrivate;
WacomDevicePtr priv = (WacomDevicePtr)local->private;
- DBG(2, priv->debugLevel, "BEGIN xf86WcmProc dev=%p priv=%p "
+ DBG(2, priv->debugLevel, "BEGIN dev=%p priv=%p "
"type=%s(%s) flags=%d fd=%d what=%s\n",
(void *)pWcm, (void *)priv,
IsStylus(priv) ? "stylus" :
@@ -1306,7 +1306,7 @@ static int xf86WcmDevProc(DeviceIntPtr pWcm, int what)
priv->wcmInitKeyClassCount = 0;
if (!xf86WcmDevOpen(pWcm))
{
- DBG(1, priv->debugLevel, "xf86WcmProc INIT FAILED\n");
+ DBG(1, priv->debugLevel, "INIT FAILED\n");
return !Success;
}
priv->wcmInitKeyClassCount++;
@@ -1316,7 +1316,7 @@ static int xf86WcmDevProc(DeviceIntPtr pWcm, int what)
case DEVICE_ON:
if (!xf86WcmDevOpen(pWcm))
{
- DBG(1, priv->debugLevel, "xf86WcmProc ON FAILED\n");
+ DBG(1, priv->debugLevel, "ON FAILED\n");
return !Success;
}
priv->wcmDevOpenCount++;
@@ -1341,7 +1341,7 @@ static int xf86WcmDevProc(DeviceIntPtr pWcm, int what)
break;
} /* end switch */
- DBG(2, priv->debugLevel, "END xf86WcmProc Success \n");
+ DBG(2, priv->debugLevel, "END Success \n");
return Success;
}
@@ -1356,7 +1356,7 @@ static Bool xf86WcmDevConvert(LocalDevicePtr local, int first, int num,
{
WacomDevicePtr priv = (WacomDevicePtr) local->private;
- DBG(6, priv->debugLevel, "xf86WcmDevConvert v0=%d v1=%d on screen %d \n",
+ DBG(6, priv->debugLevel, "v0=%d v1=%d on screen %d \n",
v0, v1, priv->currentScreen);
if (first != 0 || num == 1)
@@ -1392,7 +1392,7 @@ static Bool xf86WcmDevConvert(LocalDevicePtr local, int first, int num,
if (*y < 0) *y = 0;
}
- DBG(6, priv->debugLevel, "xf86WcmDevConvert v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y);
+ DBG(6, priv->debugLevel, "v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y);
return TRUE;
}
@@ -1409,7 +1409,7 @@ static Bool xf86WcmDevReverseConvert(LocalDevicePtr local, int x, int y,
WacomDevicePtr priv = (WacomDevicePtr) local->private;
int i = 0;
- DBG(6, priv->debugLevel, "xf86WcmDevReverseConvert x=%d y=%d \n", x, y);
+ DBG(6, priv->debugLevel, "x=%d y=%d \n", x, y);
priv->currentSX = x;
priv->currentSY = y;
diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h
index 3cf671c..50ef765 100644
--- a/src/xf86Wacom.h
+++ b/src/xf86Wacom.h
@@ -76,8 +76,10 @@
#if DEBUG
#define DBG(lvl, dLevel, ...) \
do { \
- if ((lvl) <= dLevel) \
- xf86Msg(X_INFO, __VA_ARGS__); \
+ if ((lvl) <= dLevel) { \
+ xf86Msg(X_INFO, "%s: ", __func__); \
+ xf86Msg(X_NONE, __VA_ARGS__); \
+ } \
} while (0)
#else
#define DBG(lvl, dLevel, ...)