aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-22 17:10:37 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-22 17:10:37 +0000
commitc10847366966274e04fa9f56532c899081a7f503 (patch)
tree05b188895e146ae7a4a11be8881d4d0934bdeb8e
parentbc2811a3815aa0d19c284f89073f2c55b09f6587 (diff)
remove dead code
-rw-r--r--Graph.c15
-rw-r--r--GraphDisplay.c2
2 files changed, 3 insertions, 14 deletions
diff --git a/Graph.c b/Graph.c
index 2bf66df..75beb74 100644
--- a/Graph.c
+++ b/Graph.c
@@ -177,16 +177,11 @@ Initialize(Widget request,
GraphWidget gw = (GraphWidget) new;
int *values;
int i;
- String label;
values = (int *)XtCalloc(gw->graph.num_entries, sizeof(int));
for (i = 0; i < gw->graph.num_entries; i++)
values[i] = gw->graph.values[i];
gw->graph.values = values;
-
- if (gw->graph.labels != NULL)
- for (i = 0; i < gw->graph.num_entries; i++)
- label = gw->graph.labels[i];
}
static Boolean
@@ -199,12 +194,9 @@ SetValues(Widget old,
GraphWidget oldgraph = (GraphWidget) old;
GraphWidget newgraph = (GraphWidget) new;
int *values;
- String label;
int i;
#define NE(field) (newgraph->graph.field != oldgraph->graph.field)
-#define EQ(field) (newgraph->graph.field == oldgraph->graph.field)
-
if (NE(values)) {
values = (int *)XtCalloc(newgraph->graph.num_entries, sizeof(int));
XtFree((XtPointer)oldgraph->graph.values);
@@ -214,19 +206,16 @@ SetValues(Widget old,
return True;
}
+#define EQ(field) (!NE(field))
if (NE(num_entries) && (EQ(labels) || EQ(values))) {
XtAppErrorMsg(XtWidgetToApplicationContext(new),
"counterError", "numEntries", "WidgetError",
"Number of graph entries changed but not labels of values",
NULL, NULL);
}
-
- if (NE(labels) && newgraph->graph.labels != NULL)
- for (i = 0; i < newgraph->graph.num_entries; i++)
- label = newgraph->graph.labels[i];
+#undef EQ
return NE(num_entries) || NE(labels) || NE(max_value);
-#undef EQ
#undef NE
}
diff --git a/GraphDisplay.c b/GraphDisplay.c
index 9cab2da..c91b45e 100644
--- a/GraphDisplay.c
+++ b/GraphDisplay.c
@@ -117,11 +117,11 @@ SetValues(Widget old,
XtReleaseGC(new, oldgd->graphDisplay.gc);
newgd->graphDisplay.gc = GetGC(newgd);
}
+#undef NE
if (XtIsRealized(XtParent((Widget)newgd)))
XClearArea(XtDisplayOfObject(new),
XtWindowOfObject(new), 0, 0, 0, 0, True);
-#undef NE
return False;
}