IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2010, 11:22:25 AM (16 years ago)
Author:
eugene
Message:

large update merging in changes for Ohana to support large files

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/libfits/matrix/F_write_M.c

    r16139 r27435  
    1111  if (f == NULL) return (FALSE);
    1212 
    13   fseek (f, 0, SEEK_END);  /* write matrix to end of file! */
     13  fseeko (f, 0LL, SEEK_END);  /* write matrix to end of file! */
    1414
    1515  status = gfits_fwrite_matrix (f, matrix);
     
    2121int gfits_fwrite_matrix (FILE *f, Matrix *matrix) {
    2222
    23   int status, nbytes, Nbytes;
     23  int status;
     24  off_t nbytes, Nbytes;
    2425
    2526  status = TRUE;
     
    2728  /* this is a bit dangerous: we are not realloc'ing the matrix.
    2829     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?)
    3031  */
    3132
    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);
    3435  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));
    3637
    3738  /* this is a bit cumbersome: swap all words, write out file, then swap back... */
    3839# ifdef BYTE_SWAP 
    3940  {
    40     int i;
     41    off_t i;
    4142    unsigned char *byte0, *byte1, *byte2, *byte3, *byte4, *byte5, *byte6, *byte7, tmp;
    4243    int perpix;
     
    9697# ifdef BYTE_SWAP
    9798  {
    98     int i;
     99    off_t i;
    99100    unsigned char *byte0, *byte1, *byte2, *byte3, *byte4, *byte5, *byte6, *byte7, tmp;
    100101    int perpix;
Note: See TracChangeset for help on using the changeset viewer.