aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2015-10-06 22:27:10 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-12-30 00:05:53 +0100
commit8b0e2af3600dc6ae585eb5426bb7f48fbcfbdebf (patch)
treea2d5491bda0519eceb043e0e821ba87cb05b130d /nx-X11/programs/Xserver
parentc6482d24fff982d5e11636167c719766f8207d48 (diff)
downloadnx-libs-8b0e2af3600dc6ae585eb5426bb7f48fbcfbdebf.tar.gz
nx-libs-8b0e2af3600dc6ae585eb5426bb7f48fbcfbdebf.tar.bz2
nx-libs-8b0e2af3600dc6ae585eb5426bb7f48fbcfbdebf.zip
rrmode.c: add debug output
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/randr/rrmode.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c
index cb45bf74a..c3740b5f8 100644
--- a/nx-X11/programs/Xserver/randr/rrmode.c
+++ b/nx-X11/programs/Xserver/randr/rrmode.c
@@ -104,11 +104,13 @@ RRModeCreate (xRRModeInfo *modeInfo,
}
modes = newModes;
modes[num_modes++] = mode;
-
/*
* give the caller a reference to this mode
*/
++mode->refcnt;
+#ifdef DEBUG
+ fprintf(stderr, "RRModeCreate: num_modes [%d] new mode [%s] ([%p]) refcnt [%d]\n", num_modes, mode->name, mode, mode->refcnt);
+#endif
return mode;
}
@@ -144,11 +146,22 @@ RRModeGet (xRRModeInfo *modeInfo,
!memcmp (name, mode->name, modeInfo->nameLength))
{
++mode->refcnt;
+#ifdef DEBUG
+ fprintf(stderr, "RRModeGet: return existing mode [%s] ([%p]) refcnt [%d]\n", mode->name, mode, mode->refcnt);
+#endif
return mode;
}
}
+#ifdef DEBUG
+ {
+ RRModePtr mode = RRModeCreate (modeInfo, name, NULL);
+ fprintf(stderr, "RRModeGet: return new mode [%s] ([%p]) refcnt [%d]\n", mode->name, mode, mode->refcnt);
+ return mode;
+ }
+#else
return RRModeCreate (modeInfo, name, NULL);
+#endif
}
static RRModePtr
@@ -252,8 +265,12 @@ RRModeDestroy (RRModePtr mode)
{
int m;
- if (--mode->refcnt > 0)
+ if (--mode->refcnt > 0) {
+#ifdef DEBUG
+ fprintf(stderr, "RRModeDestroy: mode [%s] ([%p]) refcnt [%d -> %d]\n", mode->name, mode, mode->refcnt + 1, mode->refcnt);
+#endif
return;
+ }
for (m = 0; m < num_modes; m++)
{
if (modes[m] == mode)
@@ -270,12 +287,18 @@ RRModeDestroy (RRModePtr mode)
}
}
+#ifdef DEBUG
+ fprintf(stderr, "RRModeDestroy: destroyed mode [%s] ([%p])\n", mode->name, mode);
+#endif
xfree (mode);
}
static int
RRModeDestroyResource (void * value, XID pid)
{
+#ifdef DEBUG
+ fprintf(stderr, "RRModeDestroyResource: mode [%s] ([%p]) refcnt [%d]\n", ((RRModePtr)value)->name, (RRModePtr)value, ((RRModePtr)value)->refcnt);
+#endif
RRModeDestroy ((RRModePtr) value);
return 1;
}