if( (mpfd = malloc(sizeof(MyPrintFileData))) == NULL )
if( (mpfd = (MyPrintFileData *)malloc(sizeof(MyPrintFileData))) == NULL )
void *XpuPrintToFile( Display *pdpy, XPContext pcontext, const char *filename ){  MyPrintFileData *mpfd;  if( (mpfd = malloc(sizeof(MyPrintFileData))) == NULL )    return(NULL);  /* create pipe */  if( pipe(mpfd->pipe) == -1 )   {    /* this should never happen, but... */    perror("XpuPrintToFile: cannot create pipe");    free(mpfd);    return(NULL);  }          mpfd->displayname = DisplayString(pdpy);  mpfd->pcontext    = pcontext;  mpfd->file_name   = filename;  mpfd->file        = NULL;  mpfd->status      = XPGetDocError;    /* make sure we can open the file for writing */  if( (mpfd->file = fopen(mpfd->file_name, "w")) == NULL )   {    /* fopen() error */    close(mpfd->pipe[1]);    close(mpfd->pipe[0]);          free(mpfd);    return(NULL);  }    /* its important to flush before we fork, to make sure that the   * XpStartJob gets through first in the parent   */  XFlush(pdpy);         mpfd->pid = fork();  if( mpfd->pid == 0 )   {    /* we're now in the fork()'ed child */    PrintToFile_Consumer(mpfd);  }  else if( mpfd->pid < 0 )   {    /* fork() error */    close(mpfd->pipe[1]);    close(mpfd->pipe[0]);    fclose(mpfd->file);    free(mpfd);    return(NULL);  }    /* we're still in the parent */  XPU_DEBUG_ONLY(printf("### parent fork()'ed consumer child.\n"));    /* child will write into file - we don't need it anymore here... :-) */  fclose(mpfd->file);  close(mpfd->pipe[1]);  return(mpfd);      }