--- ray/src/px/ra_t16.c 1989/07/23 11:35:48 1.3 +++ ray/src/px/ra_t16.c 1990/01/18 23:58:21 1.6 @@ -15,6 +15,8 @@ static char SCCSid[] = "$SunId$ LBL"; #include "color.h" +#include "random.h" + #include "targa.h" #define goodpic(h) (((h)->dataType==IM_RGB || (h)->dataType==IM_CRGB) \ @@ -93,12 +95,12 @@ char *argv[]; /* put header */ printargs(argc, argv, stdout); putchar('\n'); - printf("-Y %d +X %d\n", head.y, head.x); + fputresolu(YMAJOR|YDECR, head.x, head.y, stdout); /* convert file */ tg2ra(&head); } else { getheader(stdin, NULL); - if (scanf("-Y %d +X %d\n", &head.y, &head.x) != 2) + if (fgetresolu(&head.x, &head.y, stdin) != (YMAJOR|YDECR)) quiterr("bad picture file"); /* assign header */ head.textSize = 0; @@ -187,7 +189,7 @@ register FILE *fp; if (ip != NULL) if (nidbytes) - fread(ip, nidbytes, 1, fp); + fread((char *)ip, nidbytes, 1, fp); else *ip = '\0'; else if (nidbytes) @@ -329,7 +331,7 @@ unsigned char *d; FILE *fp; { if (h->dataType == IM_RGB) { /* uncompressed */ - if (fwrite(d, 3*h->x, h->y, fp) != h->y) + if (fwrite((char *)d, 3*h->x, h->y, fp) != h->y) quiterr("error writing targa file"); return; } @@ -365,7 +367,7 @@ FILE *fp; int r, g, b; if (h->dataType == IM_RGB) { /* uncompressed */ - if (fread(data, 3*h->x, h->y, fp) != h->y) + if (fread((char *)data, 3*h->x, h->y, fp) != h->y) goto readerr; return; }