#define MIN(X,Y) (X < Y ? X : Y) default: if ((area->cv_bp % BYTEBITS) == 0) { /* integer number of bytes */ int pictbytes = area->cv_bp / BYTEBITS; int outbytes = MIN(pictbytes, DOUBLEBITS / BYTEBITS); char *ibuf; register char *bp, *newobp; int i; if ((ibuf = malloc(icnt*pictbytes)) == (char *) -1) { fprintf(stderr,"wrowd: core allocation error"); return(-1); } bp = ibuf; do { newobp = (char *) obp; for (i=0; i 0); if (write(fd,ibuf,nbytes) == nbytes) { free(ibuf); return(1); } else { free(ibuf); fprintf(stderr,"wrowd: write error"); return(-1); } } else { /* not an integer number of bytes */ fprintf(stderr,"wrowd: error, bits per pixel=%d\n",area->cv_bp); return(-1); }