- Timestamp:
- Mar 29, 2010, 3:55:49 PM (16 years ago)
- Location:
- branches/eam_branches/20100225
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20100225
- Property svn:mergeinfo changed
-
branches/eam_branches/20100225/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/20091201/Ohana merged eligible /branches/eam_branches/largefiles.20100314/Ohana merged eligible /branches/pap_stack/Ohana merged eligible /trunk/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
branches/eam_branches/20100225/Ohana/src/kapa2/src/LoadPicture.c
r26891 r27517 5 5 Header header; 6 6 char *buff; 7 int status, bytes_left;7 off_t status, bytes_left; 8 8 Section *section; 9 9 KapaImageWidget *image; … … 24 24 Xoffset = 0.0; 25 25 Yoffset = 0.0; 26 if (image[0].image[0].matrix. size) {26 if (image[0].image[0].matrix.datasize) { 27 27 // XXX enforce int center here? 28 28 Xoffset = image[0].picture.Xc - 0.5*image[0].image[0].matrix.Naxis[0]; … … 32 32 gfits_init_header (&header); 33 33 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]); 35 35 36 36 // internal image are 32 bit floats; sender must send in this format … … 41 41 42 42 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); 44 44 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); 45 45 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); … … 67 67 status = 1; 68 68 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; 71 71 while (bytes_left > 0) { 72 72 status = read (sock, buff, bytes_left); … … 77 77 } 78 78 if (status != -1) { /* pipe has data */ 79 image[0].image[0].matrix. size += status;79 image[0].image[0].matrix.datasize += status; 80 80 bytes_left -= status; 81 81 buff = (char *)(buff + status); … … 85 85 fcntl (sock, F_SETFL, !O_NONBLOCK); 86 86 87 if (DEBUG) fprintf (stderr, "read % d bytes\n", image[0].image[0].matrix.size);88 /* it it not obvious this condition should kill k ii, 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); 91 91 return (FALSE); 92 92 }
Note:
See TracChangeset
for help on using the changeset viewer.
