diff --git a/Makefile b/Makefile index e8d37e0..8d3be3a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ TARS=Makefile main.c points.c readfont.c xwin.c label.c clip.c points.h \ symbol.c symbol.h xwin.h readfont.h eventnames.h postscript.c stipple.c \ postscript.h ${FONTS} pd pd.1 README -CC=cc -ggdb -Wall +CC=cc -ggdb -Wall -Werror #CC=cc -pg -Wall BINDIR = /usr/local/bin diff --git a/main.c b/main.c index 92cd301..5f9864c 100644 --- a/main.c +++ b/main.c @@ -1,12 +1,18 @@ +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE +#endif + #include #include #include #include #include +#include +#include + #include "points.h" #include "xwin.h" #include "readfont.h" -#include #include "symbol.h" #include "postscript.h" @@ -27,16 +33,13 @@ int getz(char *s, int n) { // return a pointer to the first // non-blank character in s char *skipblanks(char *s) { - while (isblank(*s) && *s!='\0') { + while (isblank(*s) && (*s != '\0')) { s++; } - return(s); + return s; } -int main(argc,argv) -int argc; -char **argv; -{ +int main(int argc, char *argv[]) { int n; double x,y; char s[BUF_SIZE]; @@ -44,12 +47,12 @@ char **argv; char scratch2[BUF_SIZE*2]; char *sp; int line=0; - progname = argv[0]; double xmin,xmax,ymin,ymax; double tmp; int itmp; int opt; + progname = argv[0]; setvbuf(stdin, NULL, _IONBF, 0); // make stdin unbuffered while ((opt=getopt(argc, argv, "D:")) != -1) { @@ -61,7 +64,7 @@ char **argv; // com_ci(optarg); // open rawfile // break; default: /* '?' */ - fprintf(stderr, "usage: %s [-p ] [-g ] [-r ]