IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 18, 2008, 2:52:14 PM (19 years ago)
Author:
eugene
Message:

return NULL if output var requested and entry not found

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/table/F_set_column.c

    r15487 r16139  
    11# include <ohana.h>
    22# include <gfitsio.h>
    3 # define SWAP_BYTE \
    4   tmp = Pout[0]; Pout[0] = Pout[1]; Pout[1] = tmp;
    5 # define SWAP_WORD \
     3# define SWAP_BYTE { \
     4  char tmp; \
     5  tmp = Pout[0]; Pout[0] = Pout[1]; Pout[1] = tmp; }
     6# define SWAP_WORD { \
     7  char tmp; \
    68  tmp = Pout[0]; Pout[0] = Pout[3]; Pout[3] = tmp; \
    7   tmp = Pout[1]; Pout[1] = Pout[2]; Pout[2] = tmp;
    8 # define SWAP_DBLE \
     9  tmp = Pout[1]; Pout[1] = Pout[2]; Pout[2] = tmp; }
     10# define SWAP_DBLE { \
     11  char tmp; \
    912  tmp = Pout[0]; Pout[0] = Pout[7]; Pout[7] = tmp; \
    1013  tmp = Pout[1]; Pout[1] = Pout[6]; Pout[6] = tmp; \
    1114  tmp = Pout[2]; Pout[2] = Pout[5]; Pout[5] = tmp; \
    12   tmp = Pout[3]; Pout[3] = Pout[4]; Pout[4] = tmp;
     15  tmp = Pout[3]; Pout[3] = Pout[4]; Pout[4] = tmp; }
    1316
    1417/***********************/
     
    1720  int i, N, Nfields, Nval, Nbytes, Nx, Ny, nbytes, Nstart, Nv, Nb;
    1821  char tlabel[80], field[80], format[80], type[16], tmpline[16];
    19   char *Pin, *Pout, *array, tmp;
     22  char *Pin, *Pout, *array;
    2023  double Bscale, Bzero;
    21   int I;
    2224
    2325  if (label == (char *) NULL) return (FALSE);
     
    8284      *(short *)Pout = (*(short *)Pin - Bzero) / Bscale;
    8385# ifdef BYTE_SWAP
    84       I = i*Nbytes;
    8586      SWAP_BYTE;
    8687# endif
     
    9192      *(int *)Pout = (*(int *)Pin - Bzero) / Bscale;
    9293# ifdef BYTE_SWAP
    93       I = i*Nbytes;
    9494      SWAP_WORD;
    9595# endif
     
    100100      *(float *)Pout = (*(float *)Pin - Bzero) / Bscale;
    101101# ifdef BYTE_SWAP
    102       I = i*Nbytes;
    103102      SWAP_WORD;
    104103# endif
     
    109108      *(double *)Pout = (*(double *)Pin - Bzero) / Bscale;
    110109# ifdef BYTE_SWAP
    111       I = i*Nbytes;
    112110      SWAP_DBLE;
    113111# endif
Note: See TracChangeset for help on using the changeset viewer.