IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 6, 2010, 4:06:31 PM (16 years ago)
Author:
eugene
Message:

merging changes from branches/eam_branches/Ohana.20100606: re-work the off_t print/scan format; fix and test NAN implementation in gnu89 context; fix and test BYTE_SWAP for libohana

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/kapa2/src/LoadPicture.c

    r27435 r28241  
    3232  gfits_init_header (&header);
    3333  header.Naxes = 2;
    34   KiiScanMessage (sock, "%lld %lld", (long long *) &header.Naxis[0], (long long *) &header.Naxis[1]);
     34  KiiScanMessage (sock, OFF_T_FMT" "OFF_T_FMT,  &header.Naxis[0], &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 %lld", &image[0].image[0].min,  &image[0].image[0].max, (long long *) &header.datasize);
     43  KiiScanMessage (sock, "%lf %lf "OFF_T_FMT, &image[0].image[0].min,  &image[0].image[0].max, &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);
     
    8585  fcntl (sock, F_SETFL, !O_NONBLOCK); 
    8686
    87   if (DEBUG) fprintf (stderr, "read %lld bytes\n", (long long) image[0].image[0].matrix.datasize);
     87  if (DEBUG) fprintf (stderr, "read "OFF_T_FMT" bytes\n", image[0].image[0].matrix.datasize);
    8888  /* it it not obvious this condition should kill kapa, but ... */
    8989  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);
     90    fprintf (stderr, "error: expected "OFF_T_FMT" bytes, but got only "OFF_T_FMT"\n",  header.datasize, image[0].image[0].matrix.datasize);
    9191    return (FALSE);
    9292  }
Note: See TracChangeset for help on using the changeset viewer.