From b4d40b674b402b62e9406fd8c8ab0fc080fd70e5 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Sun, 16 Mar 2008 18:44:12 -0300 Subject: [PATCH] Compile warning fixes. Ansify some functions with K&R definitions. --- get_load.c | 53 ++++++++++++++++++++++++++--------------------------- get_rload.c | 17 ++++++++--------- xload.c | 13 +++---------- 3 files changed, 37 insertions(+), 46 deletions(-) diff --git a/get_load.c b/get_load.c index 8143577..9b306ec 100644 --- a/get_load.c +++ b/get_load.c @@ -415,15 +415,15 @@ XtPointer call_data; /* pointer to (double) return value */ #if defined(linux) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__)) -void InitLoadPoint() +void InitLoadPoint(void) { return; } -void GetLoadPoint( w, closure, call_data ) - Widget w; /* unused */ - XtPointer closure; /* unused */ - XtPointer call_data; /* pointer to (double) return value */ +void GetLoadPoint( + Widget w, /* unused */ + XtPointer closure, /* unused */ + XtPointer call_data) /* pointer to (double) return value */ { static int fd = -1; int n; @@ -476,17 +476,17 @@ void GetLoadPoint( w, closure, call_data ) static processor_set_t default_set; -void InitLoadPoint() +void InitLoadPoint(void) { if (processor_set_default (mach_host_self (), &default_set) != KERN_SUCCESS) xload_error("cannot get processor_set_default", ""); } /* ARGSUSED */ -void GetLoadPoint( w, closure, call_data ) - Widget w; /* unused */ - XtPointer closure; /* unused */ - XtPointer call_data; /* pointer to (double) return value */ +void GetLoadPoint( + Widget w, /* unused */ + XtPointer closure, /* unused */ + XtPointer call_data) /* pointer to (double) return value */ { host_t host; struct processor_set_basic_info info; @@ -514,16 +514,16 @@ void GetLoadPoint( w, closure, call_data ) static mach_port_t host_priv_port; -void InitLoadPoint() +void InitLoadPoint(void) { host_priv_port = mach_host_self(); } /* ARGSUSED */ -void GetLoadPoint( w, closure, call_data ) - Widget w; /* unused */ - XtPointer closure; /* unused */ - XtPointer call_data; /* pointer to (double) return value */ +void GetLoadPoint( + Widget w, /* unused */ + XtPointer closure, /* unused */ + XtPointer call_data) /* pointer to (double) return value */ { double *loadavg = (double *)call_data; @@ -591,7 +591,7 @@ static int nto_idle_id; static struct timespec nto_now, nto_last; void -InitLoadPoint() +InitLoadPoint(void) { nto_idle_id = ClockId(1, 1); /* Idle thread */ ClockTime(nto_idle_id, NULL, &nto_idle_last); @@ -600,10 +600,10 @@ InitLoadPoint() /* ARGSUSED */ void -GetLoadPoint( w, closure, call_data ) /* QNX NTO version */ -Widget w; /* unused */ -XtPointer closure; /* unused */ -XtPointer call_data; /* pointer to (double) return value */ +GetLoadPoint( /* QNX NTO version */ + Widget w, /* unused */ + XtPointer closure, /* unused */ + XtPointer call_data) /* pointer to (double) return value */ { double *loadavg = (double *)call_data; double timediff; @@ -633,7 +633,7 @@ static struct nlist nl[] = { static kvm_t *kd; static int fscale; -void InitLoadPoint() +void InitLoadPoint(void) { fixpt_t averunnable[3]; /* unused really */ @@ -654,10 +654,10 @@ void InitLoadPoint() return; } -void GetLoadPoint(w, closure, call_data) - Widget w; /* unused */ - XtPointer closure; /* unused */ - XtPointer call_data; /* ptr to (double) return value */ +void GetLoadPoint( + Widget w, /* unused */ + XtPointer closure, /* unused */ + XtPointer call_data) /* ptr to (double) return value */ { double *loadavg = (double *)call_data; fixpt_t t; @@ -1138,8 +1138,7 @@ void GetLoadPoint( w, closure, call_data ) #endif /* KVM_ROUTINES else */ #endif /* SYSV && i386 else */ -void xload_error(str1, str2) -char *str1, *str2; +void xload_error(char *str1, char *str2) { (void) fprintf(stderr,"xload: %s %s\n", str1, str2); #ifdef __bsdi__ diff --git a/get_rload.c b/get_rload.c index 9629d01..0c4cc61 100644 --- a/get_rload.c +++ b/get_rload.c @@ -15,10 +15,10 @@ #endif #ifdef RLOADSTUB -void GetRLoadPoint( w, closure, call_data ) - Widget w; /* unused */ - XtPointer closure; /* unused */ - XtPointer call_data; /* pointer to (double) return value */ +void GetRLoadPoint( + Widget w, /* unused */ + XtPointer closure, /* unused */ + XtPointer call_data) /* pointer to (double) return value */ { *(double *)call_data = 1.0; @@ -40,11 +40,10 @@ extern XLoadResources resources ; #define WHDRSIZE ((int)(sizeof (buf) - sizeof (buf.wd_we))) -void GetRLoadPoint( w, closure, call_data ) - Widget w; /* unused */ - XtPointer closure; /* unused */ - XtPointer call_data; /* pointer to (double) return value */ - +void GetRLoadPoint( + Widget w, /* unused */ + XtPointer closure, /* unused */ + XtPointer call_data) /* pointer to (double) return value */ { int f; static char *fname = NULL; diff --git a/xload.c b/xload.c index 2dc1cb3..b7dea0c 100644 --- a/xload.c +++ b/xload.c @@ -270,8 +270,7 @@ main(int argc, char **argv) static unsigned long current_leds; static void -ClearLights (dpy) - Display *dpy; +ClearLights (Display *dpy) { XKeyboardControl cntrl; @@ -281,9 +280,7 @@ ClearLights (dpy) } static void -SetLights (data, timer) - XtPointer data; - XtIntervalId *timer; +SetLights (XtPointer data, XtIntervalId *timer) { Widget toplevel; Display *dpy; @@ -318,11 +315,7 @@ SetLights (data, timer) SetLights, data); } -static void quit (w, event, params, num_params) - Widget w; - XEvent *event; - String *params; - Cardinal *num_params; +static void quit (Widget w, XEvent *event, String *params, Cardinal *num_params) { if (event->type == ClientMessage && event->xclient.data.l[0] != wm_delete_window) { -- 1.5.3.2