Changeset 15487 for trunk/Ohana/src/libfits/table/F_table_format.c
- Timestamp:
- Nov 6, 2007, 5:09:52 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/table/F_table_format.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/table/F_table_format.c
r15038 r15487 25 25 if (*Fchar == 'E') { *Nbytes = 4; strcpy (type, "float"); *Nval = Nv; } 26 26 if (*Fchar == 'D') { *Nbytes = 8; strcpy (type, "double"); *Nval = Nv; } 27 if (*Fchar == 'P') { *Nbytes = 8; strcpy (type, " float");*Nval = 2*Nv; }27 if (*Fchar == 'P') { *Nbytes = 8; strcpy (type, "var"); *Nval = 2*Nv; } 28 28 if (*Fchar == 'C') { *Nbytes = 8; strcpy (type, "float"); *Nval = 2*Nv; } 29 29 if (*Fchar == 'M') { *Nbytes = 16; strcpy (type, "double"); *Nval = 2*Nv; } … … 194 194 int i, j, n, Nx, Ny, Nfields; 195 195 int off, Nchar, Nval, Nbytes, status; 196 char *line,format[64], field[16], type[16];196 char format[64], field[16], type[16]; 197 197 double tzero, tscale; 198 198 char *tmpChar; … … 233 233 for (j = 0; j < Ny; j++) { 234 234 for (n = 0; n < Nval; n++) { 235 tmpChar = ( int*)&ftable[0].buffer[j*Nx + n*Nbytes + off];235 tmpChar = (char *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 236 236 *tmpChar = *tmpChar * tscale + tzero; 237 237 } … … 241 241 for (j = 0; j < Ny; j++) { 242 242 for (n = 0; n < Nval; n++) { 243 tmpShort = ( int *)&ftable[0].buffer[j*Nx + n*Nbytes + off];243 tmpShort = (short *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 244 244 *tmpShort = *tmpShort * tscale + tzero; 245 245 } … … 264 264 int i, j, n, Nx, Ny, Nfields; 265 265 int off, Nchar, Nval, Nbytes, status; 266 char *line,format[64], field[16], type[16];266 char format[64], field[16], type[16]; 267 267 double tzero, tscale; 268 268 char *tmpChar; … … 303 303 for (j = 0; j < Ny; j++) { 304 304 for (n = 0; n < Nval; n++) { 305 tmpChar = ( int*)&ftable[0].buffer[j*Nx + n*Nbytes + off];305 tmpChar = (char *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 306 306 *tmpChar = (*tmpChar - tzero) / tscale; 307 307 } … … 311 311 for (j = 0; j < Ny; j++) { 312 312 for (n = 0; n < Nval; n++) { 313 tmpShort = ( int *)&ftable[0].buffer[j*Nx + n*Nbytes + off];313 tmpShort = (short *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 314 314 *tmpShort = (*tmpShort - tzero) / tscale; 315 315 }
Note:
See TracChangeset
for help on using the changeset viewer.
