-/* $Cambridge: exim/src/exim_monitor/em_strip.c,v 1.4 2007/01/08 10:50:17 ph10 Exp $ */
-
/*************************************************
* Exim Monitor *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2007 */
+/* Copyright (c) University of Cambridge 1995 - 2009 */
/* See the file NOTICE for conditions of use and distribution. */
static int stripchart_count = 0; /* count stripcharts created */
static int *stripchart_delay; /* vector of delay counts */
static Widget *stripchart_label; /* vector of label widgets */
-static int *stripchart_last_total; /* vector of prevous values */
+static int *stripchart_last_total; /* vector of previous values */
static int *stripchart_max; /* vector of maxima */
static int *stripchart_middelay; /* vector of */
static int *stripchart_midmax; /* vector of */
passed back via the value pointer without the compiler doing an
unwanted cast. */
-static void stripchartAction(Widget w, XtPointer client_data, XtPointer value)
+static void
+stripchartAction(Widget w, XtPointer client_data, XtPointer value)
{
-double *ptr = (double *)value;
+double * ptr = (double *)value;
static int thresholds[] =
{10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 0};
-int num = (int)client_data;
+int num = (long)client_data;
int oldmax = 0;
int newmax = 0;
int newvalue = 0;
thresh : stripchart_midmax[num];
if (newmax == 10) sprintf(CS buffer, "%s", stripchart_name[num]);
else sprintf(CS buffer, "%s x%d", stripchart_name[num], newmax/10);
- if (size_stripchart != NULL && num == 1) Ustrcat(buffer, "%");
+ if (size_stripchart != NULL && num == 1) Ustrcat(buffer, US"%");
xs_SetValues(stripchart_label[num], 1, "label", buffer);
oldmax = stripchart_max[num];
stripchart_max[num] = newmax;
initially set to 1 second so that it gives an immediate display of the queue.
The first time its callback function is obeyed, the update time gets reset. */
-void create_stripchart(Widget parent, uschar *title)
+void
+create_stripchart(Widget parent, uschar *title)
{
Widget chart;
XtNfromVert, label);
XtAddCallback(chart, "getValue", stripchartAction,
- (XtPointer)stripchart_count);
+ (XtPointer)(long)stripchart_count);
stripchart_last_total[stripchart_count] = 0;
stripchart_max[stripchart_count] = 10;