Skip to content

Commit

Permalink
Check return value of 'plotbegin()' in all programs and exit if it's …
Browse files Browse the repository at this point in the history
…negative. Only 'allover12.c' and 'pconic.c' omitted.
  • Loading branch information
anachrocomputer committed Aug 11, 2020
1 parent 5b7405b commit 8d8638c
Show file tree
Hide file tree
Showing 34 changed files with 137 additions and 35 deletions.
5 changes: 4 additions & 1 deletion allover13.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ int main(int argc, char * const argv[])
Scale = 40.0;
pitch = 45.0 * Scale;

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion arches.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ int main(int argc, char * const argv[])
}

/* Select first pen and draw border */
plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion celticstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion circle_lines.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion coords.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion cs_rosette.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ int main(int argc, char * const argv[])
nrings = 4;
nlines = 16;

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion curve_stitching.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion dala1.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion dala2.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion dala2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ int main (int argc, char * const argv[])
}
}

plotbegin (0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize (&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion dala3.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion ellipse.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ int main(int argc, char * const argv[])
}

/* Select first pen and draw border */
plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion fraserspiral.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion hyp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ int main(int argc, char *const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&X0, &Y0);

Expand Down
5 changes: 4 additions & 1 deletion isogrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion libtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion lissajous.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ int main(int argc, char * const argv[])
}

/* Select first pen and draw border */
plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion lotus.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion morphpoly.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ int main(int argc, char * const argv[])

srand((unsigned int)time(NULL));

plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion op_moire.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion pappus.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion pin_and_cotton.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion pin_circle.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion piscis.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ int main(int argc, char * const argv[])
}

/* Select first pen and draw border */
plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion poly_oval.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion qrplot.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

plotPBM("qr_sample.pbm", 50.0, 0.0, 2.0);

Expand Down
5 changes: 4 additions & 1 deletion spiralsq.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion sqinsq.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion star_grid.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion superellipse.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ int main(int argc, char * const argv[])
}

/* Select first pen and draw border */
plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion sutpent.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(1);
if (plotbegin(1) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion ternary_arcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
5 changes: 4 additions & 1 deletion twist.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ int main(int argc, char * const argv[])
}
}

plotbegin(0);
if (plotbegin(0) < 0) {
fputs("Failed to initialise HPGL library\n", stderr);
exit(EXIT_FAILURE);
}

getplotsize(&maxx, &maxy);

Expand Down
Loading

0 comments on commit 8d8638c

Please sign in to comment.