From 7dcfb00b4f61a9775887eeca2362450a761ab2ed Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 19 Oct 2014 20:32:16 +0000 Subject: add TraceOnce --- DisplayP.h | 1 - Sgraph.c | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/DisplayP.h b/DisplayP.h index 2944b50..b09b643 100644 --- a/DisplayP.h +++ b/DisplayP.h @@ -31,7 +31,6 @@ typedef struct _DisplayClassRec { typedef struct { Dimension maxWidth; - XtPointer extension; } DisplayConstraintPart; typedef struct _DisplayConstraintRec { diff --git a/Sgraph.c b/Sgraph.c index cbcabf3..20091d7 100644 --- a/Sgraph.c +++ b/Sgraph.c @@ -24,6 +24,13 @@ #include #define Trace(w) warnx("%s.%s", XtClass(w)->core_class.class_name, __func__) +#define TraceOnce(w) do { \ + static int once = 1; \ + if (once) { \ + Trace(w); \ + once = 0; \ + } \ +} while (0) static void Initialize(Widget request, Widget w, ArgList args, Cardinal *nargs); static void Realize(Widget w, XtValueMask *mask, XSetWindowAttributes *attr); @@ -192,9 +199,7 @@ Redisplay(Widget w, XEvent *event, Region r) if (!XtIsRealized(w)) return; -#if 0 - Trace(w); -#endif + TraceOnce(w); width = sw->core.width; if (width > sw->sgraph.size) -- cgit v1.2.3