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>
This commit is contained in:
Dan Cross 2020-01-10 14:44:21 +00:00
parent 77a0a5b519
commit fa325e9b42
1021 changed files with 5688 additions and 6193 deletions

View file

@ -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);

View file

@ -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);

View file

@ -1,5 +1,5 @@
#include "mplot.h"
void move(double xx, double yy){
e1->copyx = xx;
e1->copyx = xx;
e1->copyy = yy;
}

View file

@ -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;

View file

@ -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();
}

View file

@ -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);
}

View file

@ -1,5 +1,5 @@
#include "mplot.h"
void save(void){
sscpy(e1, e1 + 1);
e1++;
void save(void){
sscpy(e1, e1 + 1);
e1++;
}

View file

@ -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);
}

View file

@ -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){}

View file

@ -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);