- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/Ohana
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/Ohana merged eligible /branches/eam_branches/Ohana.20100407 27635-27772 /branches/pap_delete/Ohana 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/simtest_nebulous_branches/Ohana/src/opihi/cmd.data/wd.c
r20652 r27840 75 75 /* save the (float) version, write out a temporary buffer */ 76 76 temp_matrix = buf[0].matrix; 77 ALLOCATE (temp_matrix.buffer, char, MAX(1, temp_matrix. size));78 memcpy (temp_matrix.buffer, buf[0].matrix.buffer, temp_matrix. size);77 ALLOCATE (temp_matrix.buffer, char, MAX(1, temp_matrix.datasize)); 78 memcpy (temp_matrix.buffer, buf[0].matrix.buffer, temp_matrix.datasize); 79 79 temp_header = buf[0].header; 80 ALLOCATE (temp_header.buffer, char, MAX(1, temp_header. size));81 memcpy (temp_header.buffer, buf[0].header.buffer, temp_header. size);80 ALLOCATE (temp_header.buffer, char, MAX(1, temp_header.datasize)); 81 memcpy (temp_header.buffer, buf[0].header.buffer, temp_header.datasize); 82 82 83 83 if (temp_header.Naxes) { … … 88 88 gfits_modify (&temp_header, "BSCALE", "%lf", 1, outScale); 89 89 gfits_modify (&temp_header, "BZERO", "%lf", 1, outZero); 90 gfits_modify (&temp_header, "UNSIGN", "%t", 1, outUnsign);90 gfits_modify_alt (&temp_header, "UNSIGN", "%t", 1, outUnsign); 91 91 } 92 92 … … 94 94 Header Xhead; 95 95 FILE *f; 96 off_t nbytes; 96 97 int status, Nextend; 97 98 … … 109 110 } 110 111 111 gfits_modify (&Xhead, "EXTEND", "%t", 1, TRUE);112 gfits_modify_alt (&Xhead, "EXTEND", "%t", 1, TRUE); 112 113 113 114 Nextend = 0; … … 125 126 126 127 /* position to begining of file to write header */ 127 fseek (f, 0, SEEK_SET);128 status = fwrite (Xhead.buffer, 1, Xhead.size, f);129 if ( status != Xhead.size) {128 fseeko (f, 0LL, SEEK_SET); 129 nbytes = fwrite (Xhead.buffer, 1, Xhead.datasize, f); 130 if (nbytes != Xhead.datasize) { 130 131 gprint (GP_ERR, "ERROR: failed writing data to image header\n"); 131 132 status = FALSE; … … 144 145 145 146 /* position to end of file to write new extend */ 146 fseek (f, 0, SEEK_END);147 status = fwrite (temp_header.buffer, 1, temp_header.size, f);147 fseeko (f, 0LL, SEEK_END); 148 nbytes = fwrite (temp_header.buffer, 1, temp_header.datasize, f); 148 149 fclose (f); 149 if ( status != temp_header.size) {150 if (nbytes != temp_header.datasize) { 150 151 gprint (GP_ERR, "failed to write file\n"); 151 152 status = FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.
