diff options
author | Dan Cross <cross@gajendra.net> | 2020-01-10 14:44:21 +0000 |
---|---|---|
committer | Dan Cross <cross@gajendra.net> | 2020-01-10 14:54:30 +0000 |
commit | fa325e9b42b0bdfb48857d1958d9fb7ceac55151 (patch) | |
tree | 81d26256d152435135bcb1ae43121979a49f5f2b /src/cmd/plot | |
parent | 77a0a5b5194d4441c86de097f2aae297cb75e2c2 (diff) | |
download | plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.gz plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.bz2 plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.zip |
Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.
Signed-off-by: Dan Cross <cross@gajendra.net>
Diffstat (limited to 'src/cmd/plot')
-rw-r--r-- | src/cmd/plot/libplot/circ.c | 2 | ||||
-rw-r--r-- | src/cmd/plot/libplot/disk.c | 2 | ||||
-rw-r--r-- | src/cmd/plot/libplot/move.c | 2 | ||||
-rw-r--r-- | src/cmd/plot/libplot/parabola.c | 10 | ||||
-rw-r--r-- | src/cmd/plot/libplot/ppause.c | 10 | ||||
-rw-r--r-- | src/cmd/plot/libplot/rarc.c | 28 | ||||
-rw-r--r-- | src/cmd/plot/libplot/save.c | 6 | ||||
-rw-r--r-- | src/cmd/plot/libplot/spline.c | 26 | ||||
-rw-r--r-- | src/cmd/plot/libplot/subr.c | 40 | ||||
-rw-r--r-- | src/cmd/plot/plot.c | 2 |
10 files changed, 64 insertions, 64 deletions
diff --git a/src/cmd/plot/libplot/circ.c b/src/cmd/plot/libplot/circ.c index 53337117..d4b6699f 100644 --- a/src/cmd/plot/libplot/circ.c +++ b/src/cmd/plot/libplot/circ.c @@ -4,7 +4,7 @@ void circ(double xc, double yc, double r){ int rad; p.x=SCX(xc); p.y=SCY(yc); - if (r < 0) + if (r < 0) rad=SCR(-r); else rad=SCR(r); diff --git a/src/cmd/plot/libplot/disk.c b/src/cmd/plot/libplot/disk.c index 47b39012..6255efa5 100644 --- a/src/cmd/plot/libplot/disk.c +++ b/src/cmd/plot/libplot/disk.c @@ -4,7 +4,7 @@ void plotdisc(double xc, double yc, double r){ int rad; p.x=SCX(xc); p.y=SCY(yc); - if (r < 0) + if (r < 0) rad=SCR(-r); else rad=SCR(r); diff --git a/src/cmd/plot/libplot/move.c b/src/cmd/plot/libplot/move.c index 4e60260b..11cdcfcb 100644 --- a/src/cmd/plot/libplot/move.c +++ b/src/cmd/plot/libplot/move.c @@ -1,5 +1,5 @@ #include "mplot.h" void move(double xx, double yy){ - e1->copyx = xx; + e1->copyx = xx; e1->copyy = yy; } diff --git a/src/cmd/plot/libplot/parabola.c b/src/cmd/plot/libplot/parabola.c index 212b9c97..d8b5ffb2 100644 --- a/src/cmd/plot/libplot/parabola.c +++ b/src/cmd/plot/libplot/parabola.c @@ -5,13 +5,13 @@ void parabola(double x0, double y0, double x1, double y1, double xb, double yb){ double dt, d2, d1; d1 = sqrt((xb - x0) * (xb - x0) + (yb - y0) * (yb - y0)); d2 = sqrt((xb - x1) * (xb - x1) + (yb - y1) * (yb - y1)); - if (d1 <= e1->quantum || d2 <= e1->quantum) { - plotline(x0, y0, x1, y1); - return; + if (d1 <= e1->quantum || d2 <= e1->quantum) { + plotline(x0, y0, x1, y1); + return; } - c0x = x0 + x1 - 2. * xb; + c0x = x0 + x1 - 2. * xb; c1x = 2. * (xb - x0); - c0y = y0 + y1 - 2. * yb; + c0y = y0 + y1 - 2. * yb; c1y = 2. * (yb - y0); move(x0, y0); dt = e1->quantum / d1; diff --git a/src/cmd/plot/libplot/ppause.c b/src/cmd/plot/libplot/ppause.c index 9fb8863d..993a7b20 100644 --- a/src/cmd/plot/libplot/ppause.c +++ b/src/cmd/plot/libplot/ppause.c @@ -1,7 +1,7 @@ #include "mplot.h" -void ppause(void){ - char aa[4]; - fflush(stdout); - read(0, aa, 4); - erase(); +void ppause(void){ + char aa[4]; + fflush(stdout); + read(0, aa, 4); + erase(); } diff --git a/src/cmd/plot/libplot/rarc.c b/src/cmd/plot/libplot/rarc.c index 9c8ccf15..c0c8c6b3 100644 --- a/src/cmd/plot/libplot/rarc.c +++ b/src/cmd/plot/libplot/rarc.c @@ -12,31 +12,31 @@ void rarc(double x1, double y1, double x2, double y2, double xc, double yc, doub dx = x1 - xc; dy = y1 - yc; rd = sqrt(dx * dx + dy * dy); - if (rd / e1->quantum < 1.0) { - move(xc, yc); - vec(xc, yc); + if (rd / e1->quantum < 1.0) { + move(xc, yc); + vec(xc, yc); return; } dph = acos(1.0 - (e1->quantum / rd)); - if (dph > PI4) + if (dph > PI4) dph = PI4; ph=atan2((y2-yc),(x2 - xc)) - atan2(dy, dx); - if (ph < 0) - ph += 6.2832; - if (rr < 0) + if (ph < 0) + ph += 6.2832; + if (rr < 0) ph = 6.2832 - ph; - if (ph < dph) + if (ph < dph) plotline(x1, y1, x2, y2); else { - n = ph / dph; - a = cos(dph); - b = sin(dph); - if (rr < 0) + n = ph / dph; + a = cos(dph); + b = sin(dph); + if (rr < 0) b = -b; move(x1, y1); while ((n--) >= 0) { - xnext = dx * a - dy * b; - dy = dx * b + dy * a; + xnext = dx * a - dy * b; + dy = dx * b + dy * a; dx = xnext; vec(dx + xc, dy + yc); } diff --git a/src/cmd/plot/libplot/save.c b/src/cmd/plot/libplot/save.c index e3dc4058..0f12b636 100644 --- a/src/cmd/plot/libplot/save.c +++ b/src/cmd/plot/libplot/save.c @@ -1,5 +1,5 @@ #include "mplot.h" -void save(void){ - sscpy(e1, e1 + 1); - e1++; +void save(void){ + sscpy(e1, e1 + 1); + e1++; } diff --git a/src/cmd/plot/libplot/spline.c b/src/cmd/plot/libplot/spline.c index 8cfa83d7..6001bd72 100644 --- a/src/cmd/plot/libplot/spline.c +++ b/src/cmd/plot/libplot/spline.c @@ -10,25 +10,25 @@ void splin(int mode, int num[], double *ff[]){ np = num; fp = ff; while((n = *np++)){ - xp = *fp++; - yp = xp + 1; - xp0 = xp; + xp = *fp++; + yp = xp + 1; + xp0 = xp; yp0 = yp; - xpe = xp0 + 2 * (n - 1); + xpe = xp0 + 2 * (n - 1); ype = yp0 + 2 * (n - 1); - if (n < 3) { - plotline(*xp, *yp, *(xp + 2), *(yp + 2)); + if (n < 3) { + plotline(*xp, *yp, *(xp + 2), *(yp + 2)); continue; } if (mode == 4) { /*closed curve*/ - xa = 0.5 * (*xpe + *(xpe - 2)); + xa = 0.5 * (*xpe + *(xpe - 2)); xc = 0.5 * (*xpe + *xp0); - ya = 0.5 * (*ype + *(ype - 2)); + ya = 0.5 * (*ype + *(ype - 2)); yc = 0.5 * (*ype + *yp0); parabola(xa, ya, xc, yc, *xpe, *ype); - xa = 0.5 * (*xpe + *xp0); + xa = 0.5 * (*xpe + *xp0); xc = 0.5 * (*(xp0 + 2) + *xp0); - ya = 0.5 * (*ype + *yp0); + ya = 0.5 * (*ype + *yp0); yc = 0.5 * (*(yp0 + 2) + *yp0); parabola(xa, ya, xc, yc, *xp0, *yp0); } @@ -36,12 +36,12 @@ void splin(int mode, int num[], double *ff[]){ if (mode % 2) /*odd mode makes first point double*/ plotline(*xp0,*yp0,0.5*(*xp0+*(xp0+2)),0.5*(*yp0+*(yp0+2))); } - xp += 2; + xp += 2; yp += 2; for (i = 1; i < (n - 1); i++, xp += 2, yp += 2) { - xa = 0.5 * (*(xp - 2) + *xp); + xa = 0.5 * (*(xp - 2) + *xp); xc = 0.5 * ( *xp + *(xp + 2)); - ya = 0.5 * (*(yp - 2) + *yp); + ya = 0.5 * (*(yp - 2) + *yp); yc = 0.5 * ( *yp + *(yp + 2)); parabola(xa, ya, xc, yc, *xp, *yp); } diff --git a/src/cmd/plot/libplot/subr.c b/src/cmd/plot/libplot/subr.c index 2b41990d..62333edf 100644 --- a/src/cmd/plot/libplot/subr.c +++ b/src/cmd/plot/libplot/subr.c @@ -22,28 +22,28 @@ bcolor(char *s){ return(DBlack); case 'r': return(DRed); - case 'g': + case 'g': return(DGreen); - case 'b': + case 'b': return(DBlue); - case 'm': + case 'm': return(DMagenta); - case 'y': + case 'y': return(DYellow); - case 'c': + case 'c': return(DCyan); - case 'w': + case 'w': return(DWhite); - case 'R': + case 'R': return(atoi(s + 1)); - case 'G': - e1->pgap = atof(s + 1); + case 'G': + e1->pgap = atof(s + 1); return(-1); - case 'A': - e1->pslant = (180. - atof(s + 1)) / RADIAN; + case 'A': + e1->pslant = (180. - atof(s + 1)) / RADIAN; return(-1); } - while (*++s != 0) + while (*++s != 0) if (*s == '/') { s++; break; @@ -52,20 +52,20 @@ bcolor(char *s){ return DBlack; } void sscpy(struct penvir *a, struct penvir *b){ /* copy 'a' onto 'b' */ - b->left = a->left; - b->bottom = a->bottom; - b->xmin = a->xmin; + b->left = a->left; + b->bottom = a->bottom; + b->xmin = a->xmin; b->ymin = a->ymin; - b->scalex = a->scalex; + b->scalex = a->scalex; b->scaley = a->scaley; - b->sidex = a->sidex; + b->sidex = a->sidex; b->sidey = a->sidey; - b->copyx = a->copyx; + b->copyx = a->copyx; b->copyy = a->copyy; b->quantum = a->quantum; b->grade = a->grade; - b->pmode = a->pmode; - b->foregr = a->foregr; + b->pmode = a->pmode; + b->foregr = a->foregr; b->backgr = a->backgr; } void idle(void){} diff --git a/src/cmd/plot/plot.c b/src/cmd/plot/plot.c index 8b62387b..f87e228b 100644 --- a/src/cmd/plot/plot.c +++ b/src/cmd/plot/plot.c @@ -559,7 +559,7 @@ void call(char *a){ exits("undefined"); } *ap = sav; - while (isspace((uchar)*ap) || *ap == ',') + while (isspace((uchar)*ap) || *ap == ',') ap++; if (*ap != '\0') SC = atof(ap); |