--- ray/src/meta/gcalc.c 2003/06/30 14:59:12 1.2 +++ ray/src/meta/gcalc.c 2011/12/01 18:47:35 1.4 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: gcalc.c,v 1.2 2003/06/30 14:59:12 schorsch Exp $"; +static const char RCSid[] = "$Id: gcalc.c,v 1.4 2011/12/01 18:47:35 greg Exp $"; #endif /* * gcalc.c - routines to do calculations on graph files. @@ -19,11 +19,16 @@ static double xmin, xmax, ymin, ymax; static double lastx, lasty, rsum; static int npts; +static void gcheader(char *types); +static void calcpoint(int c, double x, double y); +static void gcvalue(int c, char *types); -gcalc(types) /* do a calculation */ -char *types; +void +gcalc( /* do a calculation */ + char *types +) { - int i, calcpoint(); + int i; if (strchr(types, 'h') == NULL) gcheader(types); @@ -45,8 +50,10 @@ char *types; } -gcheader(types) /* print header */ -register char *types; +void +gcheader( /* print header */ + register char *types +) { printf("__"); while (*types) @@ -64,7 +71,7 @@ register char *types; printf("|___Integ_"); break; case 'l': - printf("|___Slope_____Intcp______Corr_"); + printf("|____Slope_______Intcp____Corr_"); break; default: break; @@ -73,9 +80,11 @@ register char *types; } -gcvalue(c, types) /* print the values for the curve */ -int c; -register char *types; +void +gcvalue( /* print the values for the curve */ + int c, + register char *types +) { double d1, d2, d3, sqrt(); @@ -104,7 +113,7 @@ register char *types; d1 = (xysum - xsum*ysum/npts)/d3; d2 = (ysum - d1*xsum)/npts; d3 = d1*sqrt(d3/(yysum - ysum*ysum/npts)); - printf(" %9.5f %9.2f %9.5f", d1, d2, d3); + printf(" %10.6f %11.4f %7.3f", d1, d2, d3); break; default: break; @@ -113,9 +122,12 @@ register char *types; } -calcpoint(c, x, y) /* add a point to our calculation */ -int c; -double x, y; +void +calcpoint( /* add a point to our calculation */ + int c, + double x, + double y +) { if (x < xmin || x > xmax) return;