IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/Ohana

  • branches/eam_branches/20100225/Ohana/src/kapa2/src/LoadPicture.c

    r26891 r27517  
    55  Header header;
    66  char *buff;
    7   int status, bytes_left;
     7  off_t status, bytes_left;
    88  Section *section;
    99  KapaImageWidget *image;
     
    2424  Xoffset = 0.0;
    2525  Yoffset = 0.0;
    26   if (image[0].image[0].matrix.size) {
     26  if (image[0].image[0].matrix.datasize) {
    2727    // XXX enforce int center here?
    2828    Xoffset = image[0].picture.Xc - 0.5*image[0].image[0].matrix.Naxis[0];
     
    3232  gfits_init_header (&header);
    3333  header.Naxes = 2;
    34   KiiScanMessage (sock, "%d %d", &header.Naxis[0], &header.Naxis[1]);
     34  KiiScanMessage (sock, "%lld %lld", (long long *) &header.Naxis[0], (long long *) &header.Naxis[1]);
    3535
    3636  // internal image are 32 bit floats; sender must send in this format
     
    4141
    4242  KiiScanMessage (sock, "%lf %lf %s %s",  &image[0].image[0].zero, &image[0].image[0].range, image[0].image[0].name, image[0].image[0].file);
    43   KiiScanMessage (sock, "%lf %lf %d", &image[0].image[0].min,  &image[0].image[0].max, &header.size);
     43  KiiScanMessage (sock, "%lf %lf %lld", &image[0].image[0].min,  &image[0].image[0].max, (long long *) &header.datasize);
    4444  KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].image[0].coords.crval1, &image[0].image[0].coords.crpix1, &image[0].image[0].coords.cdelt1, &image[0].image[0].coords.pc1_1, &image[0].image[0].coords.pc1_2);
    4545  KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].image[0].coords.crval2, &image[0].image[0].coords.crpix2, &image[0].image[0].coords.cdelt2, &image[0].image[0].coords.pc2_1, &image[0].image[0].coords.pc2_2);
     
    6767  status = 1;
    6868  buff = image[0].image[0].matrix.buffer;
    69   bytes_left = header.size;
    70   image[0].image[0].matrix.size = 0;
     69  bytes_left = header.datasize;
     70  image[0].image[0].matrix.datasize = 0;
    7171  while (bytes_left > 0) {
    7272    status = read (sock, buff, bytes_left);
     
    7777    }
    7878    if (status != -1) { /* pipe has data */
    79       image[0].image[0].matrix.size += status;
     79      image[0].image[0].matrix.datasize += status;
    8080      bytes_left -= status;
    8181      buff = (char *)(buff + status);
     
    8585  fcntl (sock, F_SETFL, !O_NONBLOCK); 
    8686
    87   if (DEBUG) fprintf (stderr, "read %d bytes\n", image[0].image[0].matrix.size);
    88   /* it it not obvious this condition should kill kii, but ... */
    89   if (image[0].image[0].matrix.size != header.size) { 
    90     fprintf (stderr, "error: expected %d bytes, but got only %d\n", header.size, image[0].image[0].matrix.size);
     87  if (DEBUG) fprintf (stderr, "read %lld bytes\n", (long long) image[0].image[0].matrix.datasize);
     88  /* it it not obvious this condition should kill kapa, but ... */
     89  if (image[0].image[0].matrix.datasize != header.datasize) { 
     90    fprintf (stderr, "error: expected %lld bytes, but got only %lld\n", (long long) header.datasize, (long long) image[0].image[0].matrix.datasize);
    9191    return (FALSE);
    9292  }
Note: See TracChangeset for help on using the changeset viewer.