--- ray/src/meta/expand.c 2003/06/08 12:03:10 1.2 +++ ray/src/meta/expand.c 2003/11/15 02:13:36 1.4 @@ -1,15 +1,15 @@ #ifndef lint -static const char RCSid[] = "$Id: expand.c,v 1.2 2003/06/08 12:03:10 schorsch Exp $"; +static const char RCSid[] = "$Id: expand.c,v 1.4 2003/11/15 02:13:36 schorsch Exp $"; #endif /* * Expansion routine for command implementation * on simple drivers */ +#include #include "meta.h" - /* vector characters file */ #define VINPUT "vchars.mta" @@ -41,7 +41,7 @@ FILE *infp, short *exlist ) { - static PRIMITIVE pincl = {PINCL, 02, -1, -1, -1, -1, VINPUT}; + static PRIMITIVE pincl = {PINCL, 02, {-1, -1, -1, -1}, VINPUT, NULL}; static short vcloaded = FALSE; xlist = exlist; @@ -85,7 +85,7 @@ register PRIMITIVE *p { int xflag = xlist[comndx(p->com)]; /* 1==expand, 0==pass, -1==discard */ - if (xflag != -1) + if (xflag != -1) { if (xflag == 1) switch (p->com) { @@ -126,7 +126,7 @@ register PRIMITIVE *p segprim(p); else writep(p, stdout); - + } } @@ -171,7 +171,7 @@ register PRIMITIVE *p ) { PRIMITIVE pout; - int xadv, yadv; + int xadv = 0, yadv = 0; char s[3]; register char *cp; @@ -242,18 +242,19 @@ int code, char *fname ) { - register FILE *fp; + register FILE *fp = NULL; if (fname == NULL) error(USER, "missing include file name in include"); - if (code == 2 || (fp = fopen(fname, "r")) == NULL) + if (code == 2 || (fp = fopen(fname, "r")) == NULL) { if (code != 0) fp = mfopen(fname, "r"); else { sprintf(errmsg, "cannot open user include file \"%s\"", fname); error(USER, errmsg); } + } exfile(fp); fclose(fp); @@ -267,8 +268,8 @@ polyfill( /* expand polygon fill command */ PRIMITIVE *p ) { - char *nextscan(); - int firstx, firsty, lastx, lasty, x, y; + char firstx, firsty, x, y; + int lastx, lasty; register char *cp; if ((cp=nextscan(nextscan(p->args,"%d",&firstx),"%d",&firsty)) == NULL) {