IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38325


Ignore:
Timestamp:
May 26, 2015, 4:28:35 PM (11 years ago)
Author:
eugene
Message:

add var and var64 types to set_column

Location:
branches/eam_branches/ohana.20150429/src/libfits/table
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libfits/table/F_get_column.c

    r37039 r38325  
    133133    }
    134134  }
     135
     136  // check that we supplied a valid type
    135137
    136138  *Ncol = Nval;
  • branches/eam_branches/ohana.20150429/src/libfits/table/F_set_column.c

    r37039 r38325  
    137137    for (i = 0; i < Nval*Nrow; i++, Pin+=Nbytes, Pout+=Nbytes) {
    138138      *(double *)Pout = (*(double *)Pin - Bzero) / Bscale;
     139# ifdef BYTE_SWAP
     140      SWAP_DBLE;
     141# endif
     142    }
     143  }
     144
     145  if (!strcmp (type, "var")) {
     146    for (i = 0; i < Nval*Nrow; i++, Pin+=Nbytes, Pout+=Nbytes) {
     147      *(int *)Pout = *(int *)Pin;
     148# ifdef BYTE_SWAP
     149      SWAP_WORD;
     150# endif
     151    }
     152  }
     153
     154  if (!strcmp (type, "var64")) {
     155    for (i = 0; i < Nval*Nrow; i++, Pin+=Nbytes, Pout+=Nbytes) {
     156      *(int *)Pout = *(int *)Pin;
    139157# ifdef BYTE_SWAP
    140158      SWAP_DBLE;
Note: See TracChangeset for help on using the changeset viewer.