ministat.c (183961) | ministat.c (189934) |
---|---|
1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * 9 */ 10 11#include <sys/cdefs.h> | 1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * 9 */ 10 11#include <sys/cdefs.h> |
12__FBSDID("$FreeBSD: head/usr.bin/ministat/ministat.c 183961 2008-10-16 20:56:09Z phk $"); | 12__FBSDID("$FreeBSD: head/usr.bin/ministat/ministat.c 189934 2009-03-17 19:37:47Z dwmalone $"); |
13 14#include <stdio.h> 15#include <math.h> 16#include <err.h> 17#include <string.h> 18#include <stdlib.h> 19#include <unistd.h> 20#include <sys/ioctl.h> --- 110 unchanged lines hidden (view full) --- 131#define MAX_DS 8 132static char symbol[MAX_DS] = { ' ', 'x', '+', '*', '%', '#', '@', 'O' }; 133 134struct dataset { 135 char *name; 136 double *points; 137 unsigned lpoints; 138 double sy, syy; | 13 14#include <stdio.h> 15#include <math.h> 16#include <err.h> 17#include <string.h> 18#include <stdlib.h> 19#include <unistd.h> 20#include <sys/ioctl.h> --- 110 unchanged lines hidden (view full) --- 131#define MAX_DS 8 132static char symbol[MAX_DS] = { ' ', 'x', '+', '*', '%', '#', '@', 'O' }; 133 134struct dataset { 135 char *name; 136 double *points; 137 unsigned lpoints; 138 double sy, syy; |
139 int n; | 139 unsigned n; |
140}; 141 142static struct dataset * 143NewSet(void) 144{ 145 struct dataset *ds; 146 147 ds = calloc(1, sizeof *ds); --- 38 unchanged lines hidden (view full) --- 186{ 187 188 return(ds->sy / ds->n); 189} 190 191static double 192Median(struct dataset *ds) 193{ | 140}; 141 142static struct dataset * 143NewSet(void) 144{ 145 struct dataset *ds; 146 147 ds = calloc(1, sizeof *ds); --- 38 unchanged lines hidden (view full) --- 186{ 187 188 return(ds->sy / ds->n); 189} 190 191static double 192Median(struct dataset *ds) 193{ |
194 int even, i; 195 struct point *p1, *p2; | |
196 197 return (ds->points[ds->n / 2]); 198} 199 200static double 201Var(struct dataset *ds) 202{ 203 --- 108 unchanged lines hidden (view full) --- 312 AdjPlot(Avg(ds) - Stddev(ds)); 313 AdjPlot(Avg(ds) + Stddev(ds)); 314} 315 316static void 317PlotSet(struct dataset *ds, int val) 318{ 319 struct plot *pl; | 194 195 return (ds->points[ds->n / 2]); 196} 197 198static double 199Var(struct dataset *ds) 200{ 201 --- 108 unchanged lines hidden (view full) --- 310 AdjPlot(Avg(ds) - Stddev(ds)); 311 AdjPlot(Avg(ds) + Stddev(ds)); 312} 313 314static void 315PlotSet(struct dataset *ds, int val) 316{ 317 struct plot *pl; |
320 struct point *pp; 321 int i, j, m, x, n; | 318 int i, j, m, x; 319 unsigned n; |
322 int bar; 323 324 pl = &plot; 325 if (pl->span == 0) 326 return; 327 328 if (pl->separate_bars) 329 bar = val-1; --- 302 unchanged lines hidden --- | 320 int bar; 321 322 pl = &plot; 323 if (pl->span == 0) 324 return; 325 326 if (pl->separate_bars) 327 bar = val-1; --- 302 unchanged lines hidden --- |