--- ray/src/px/paintjet.c 1991/05/06 13:14:26 1.6 +++ ray/src/px/paintjet.c 2003/06/05 19:29:34 2.5 @@ -1,9 +1,6 @@ -/* Copyright (c) 1989 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: paintjet.c,v 2.5 2003/06/05 19:29:34 schorsch Exp $"; #endif - /* * paintjet.c - program to dump pixel file to HP PaintJet color printer. * @@ -11,10 +8,13 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include +#include +#include "platform.h" #include "color.h" +#include "resolu.h" -#define NCOLS 1440 /* 8" at 180 dpi */ +#define NCOLS 1440 /* 8" at 180 dpi */ main(argc, argv) @@ -22,7 +22,9 @@ int argc; char *argv[]; { int i, status = 0; - + SET_DEFAULT_BINARY(); + SET_FILE_BINARY(stdin); + SET_FILE_BINARY(stdout); if (argc < 2) status = printp(NULL) == -1; else @@ -53,7 +55,7 @@ char *fname; return(-1); } /* get picture dimensions */ - if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { + if (fgetresolu(&xres, &yres, input) < 0) { fprintf(stderr, "%s: bad picture size\n", fname); return(-1); } @@ -112,16 +114,16 @@ register int x; register int a; { static int cerr[NCOLS][3]; - static int err[3], errp[3]; - int b; + static int err[3]; + int b, errp; register int ison; b = col[a]; - errp[a] = err[a]; + errp = err[a]; err[a] += b + cerr[x][a]; ison = err[a] > 128; if (ison) err[a] -= 256; err[a] /= 3; - cerr[x][a] = err[a] + errp[a]; + cerr[x][a] = err[a] + errp; return(ison); }