Changeset 27435 for trunk/Ohana/src/libfits/matrix/F_write_M.c
- Timestamp:
- Mar 24, 2010, 11:22:25 AM (16 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/libfits/matrix/F_write_M.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/20091201/Ohana merged eligible /branches/eam_branches/largefiles.20100314/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/libfits/matrix/F_write_M.c
r16139 r27435 11 11 if (f == NULL) return (FALSE); 12 12 13 fseek (f, 0, SEEK_END); /* write matrix to end of file! */13 fseeko (f, 0LL, SEEK_END); /* write matrix to end of file! */ 14 14 15 15 status = gfits_fwrite_matrix (f, matrix); … … 21 21 int gfits_fwrite_matrix (FILE *f, Matrix *matrix) { 22 22 23 int status, nbytes, Nbytes; 23 int status; 24 off_t nbytes, Nbytes; 24 25 25 26 status = TRUE; … … 27 28 /* this is a bit dangerous: we are not realloc'ing the matrix. 28 29 if the size is wrong, it probably should simply pad the fwrite statement. 29 better policy should be defined (ie, matrix. size always correct blocking?)30 better policy should be defined (ie, matrix.datasize always correct blocking?) 30 31 */ 31 32 32 if (matrix[0]. size % FT_RECORD_SIZE)33 nbytes = FT_RECORD_SIZE * (( int) (matrix[0].size / FT_RECORD_SIZE) + 1);33 if (matrix[0].datasize % FT_RECORD_SIZE) 34 nbytes = FT_RECORD_SIZE * ((off_t) (matrix[0].datasize / FT_RECORD_SIZE) + 1); 34 35 else 35 nbytes = FT_RECORD_SIZE * (( int) (matrix[0].size / FT_RECORD_SIZE));36 nbytes = FT_RECORD_SIZE * ((off_t) (matrix[0].datasize / FT_RECORD_SIZE)); 36 37 37 38 /* this is a bit cumbersome: swap all words, write out file, then swap back... */ 38 39 # ifdef BYTE_SWAP 39 40 { 40 int i;41 off_t i; 41 42 unsigned char *byte0, *byte1, *byte2, *byte3, *byte4, *byte5, *byte6, *byte7, tmp; 42 43 int perpix; … … 96 97 # ifdef BYTE_SWAP 97 98 { 98 int i;99 off_t i; 99 100 unsigned char *byte0, *byte1, *byte2, *byte3, *byte4, *byte5, *byte6, *byte7, tmp; 100 101 int perpix;
Note:
See TracChangeset
for help on using the changeset viewer.
