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_get_column.c

    r12399 r16139  
    11# include <ohana.h>
    22# include <gfitsio.h>
    3 # define SWAP_BYTE \
    4   tmp = Pin[0]; Pin[0] = Pin[1]; Pin[1] = tmp;
    5 # define SWAP_WORD \
     3# define SWAP_BYTE { \
     4  char tmp; \
     5  tmp = Pin[0]; Pin[0] = Pin[1]; Pin[1] = tmp; }
     6# define SWAP_WORD { \
     7  char tmp; \
    68  tmp = Pin[0]; Pin[0] = Pin[3]; Pin[3] = tmp; \
    7   tmp = Pin[1]; Pin[1] = Pin[2]; Pin[2] = tmp;
    8 # define SWAP_DBLE \
     9  tmp = Pin[1]; Pin[1] = Pin[2]; Pin[2] = tmp; }
     10# define SWAP_DBLE { \
     11  char tmp; \
    912  tmp = Pin[0]; Pin[0] = Pin[7]; Pin[7] = tmp; \
    1013  tmp = Pin[1]; Pin[1] = Pin[6]; Pin[6] = tmp; \
    1114  tmp = Pin[2]; Pin[2] = Pin[5]; Pin[5] = tmp; \
    12   tmp = Pin[3]; Pin[3] = Pin[4]; Pin[4] = tmp;
     15  tmp = Pin[3]; Pin[3] = Pin[4]; Pin[4] = tmp; }
    1316
    1417/***********************/
     
    4346  int i, N, Nfields, Nval, Nbytes, Nx, Ny, Nstart, Nv, Nb;
    4447  char tlabel[80], field[80], format[80], type[16], tmpline[16];
    45   char *Pin, *Pout, *array, tmp;
     48  char *Pin, *Pout, *array;
    4649  double Bscale, Bzero;
    47   int I;
    4850
    4951  if (label == (char *) NULL) return (FALSE);
     
    105107    for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) {
    106108# ifdef BYTE_SWAP
    107       I = i*Nbytes;
    108109      SWAP_BYTE;
    109110# endif
     
    114115    for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) {
    115116# ifdef BYTE_SWAP
    116       I = i*Nbytes;
    117117      SWAP_WORD;
    118118# endif
     
    123123    for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) {
    124124# ifdef BYTE_SWAP
    125       I = i*Nbytes;
    126125      SWAP_WORD;
    127126# endif
     
    132131    for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) {
    133132# ifdef BYTE_SWAP
    134       I = i*Nbytes;
    135133      SWAP_DBLE;
    136134# endif
Note: See TracChangeset for help on using the changeset viewer.