示例#1
0
static int
test_new_normalized_edgecase(void)
{
    Init_Entry *vals = normalized_edgecase_vals;
    int i, num = sizeof(normalized_edgecase_vals)/sizeof(Init_Entry);

    for (i=0; i<num; i++) {
        new_setup(vals, i);
        if (new_check_flt(&vals[i]) != 0)
            return 1;
        yasm_floatnum_destroy(flt);
    }
    return 0;
}
示例#2
0
Setup *fill_setup(Image *image, char *setupfile, int usefile, int autopars)
{
  int no_error=1;     /* Flag set to 0 on error */
  Setup *setup=NULL;  /* Container for plotting parameters */

  /*
   * Allocate memory for Setup container
   */

  if(!(setup = new_setup(1))) {
    fprintf(stderr,"ERROR: fill_setup\n");
    return NULL;
  }

  /*
   * Set up image display parameters
   */

  if(no_error)
    if(set_setup_defaults(image,setup))
      no_error = 0;

  if(autopars) 
    if(init_setup(image,setup,autopars))
      no_error = 0;

  if(no_error && usefile)
    if(setup_file(image,setup,setupfile))
      no_error = 0;

  if(no_error)
    setup_interact(image,setup);

  /*
   * Return filled setup container if no errors
   */

  if(no_error)
    return setup;
  else {
    fprintf(stderr,"ERROR: fill_setup\n");
    return del_setup(setup);
  }
}
示例#3
0
int OpenSerial(char *port)
{
    char buf[256];
    int i = 0;
    
    if(ttys[0] != 0)
        i = 1;
//    if((ttys[i] = open(port,O_RDWR)) < 0)
        if((ttys[i] = open(port,O_RDWR|O_NONBLOCK)) < 0)
    {
        sprintf(buf,"Can't open %s",port);
        perror(buf);
        return(0);
        /*    exit(-1);*/
    }
    new_setup(ttys[i]);
#ifdef DEBUG_SERIAL
    serintest = fopen("serial.in");
    totalcharsin = 0;
#endif
    return(ttys[i]);
}
示例#4
0
void game_setup_()
  {
  wire_setup();
  new_setup();
  }