Changeset 16139 for trunk/Ohana/src/libfits/table/F_get_column.c
- Timestamp:
- Jan 18, 2008, 2:52:14 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/table/F_get_column.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/table/F_get_column.c
r12399 r16139 1 1 # include <ohana.h> 2 2 # 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; \ 6 8 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; \ 9 12 tmp = Pin[0]; Pin[0] = Pin[7]; Pin[7] = tmp; \ 10 13 tmp = Pin[1]; Pin[1] = Pin[6]; Pin[6] = tmp; \ 11 14 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; } 13 16 14 17 /***********************/ … … 43 46 int i, N, Nfields, Nval, Nbytes, Nx, Ny, Nstart, Nv, Nb; 44 47 char tlabel[80], field[80], format[80], type[16], tmpline[16]; 45 char *Pin, *Pout, *array , tmp;48 char *Pin, *Pout, *array; 46 49 double Bscale, Bzero; 47 int I;48 50 49 51 if (label == (char *) NULL) return (FALSE); … … 105 107 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 106 108 # ifdef BYTE_SWAP 107 I = i*Nbytes;108 109 SWAP_BYTE; 109 110 # endif … … 114 115 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 115 116 # ifdef BYTE_SWAP 116 I = i*Nbytes;117 117 SWAP_WORD; 118 118 # endif … … 123 123 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 124 124 # ifdef BYTE_SWAP 125 I = i*Nbytes;126 125 SWAP_WORD; 127 126 # endif … … 132 131 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 133 132 # ifdef BYTE_SWAP 134 I = i*Nbytes;135 133 SWAP_DBLE; 136 134 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
