From c10847366966274e04fa9f56532c899081a7f503 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 22 Sep 2014 17:10:37 +0000 Subject: remove dead code --- Graph.c | 15 ++------------- GraphDisplay.c | 2 +- 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; } -- cgit v1.2.3