"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "getkey.c" between
cfitsio-3.49.tar.gz and cfitsio-4.0.0.tar.gz

About: CFITSIO is a library of C and Fortran subroutines for reading and writing data files in the FITS (Flexible Image Transport System) data format.

getkey.c  (cfitsio-3.49):getkey.c  (cfitsio-4.0.0)
skipping to change at line 289 skipping to change at line 289
const char *keyname, /* I - name of keyword to read */ const char *keyname, /* I - name of keyword to read */
void *value, /* O - keyword value */ void *value, /* O - keyword value */
char *comm, /* O - keyword comment */ char *comm, /* O - keyword comment */
int *status) /* IO - error status */ int *status) /* IO - error status */
/* /*
Read (get) the keyword value and comment from the FITS header. Read (get) the keyword value and comment from the FITS header.
Reads a keyword value with the datatype specified by the 2nd argument. Reads a keyword value with the datatype specified by the 2nd argument.
*/ */
{ {
LONGLONG longval; LONGLONG longval;
ULONGLONG ulongval;
double doubleval; double doubleval;
if (*status > 0) /* inherit input status value if > 0 */ if (*status > 0) /* inherit input status value if > 0 */
return(*status); return(*status);
if (datatype == TSTRING) if (datatype == TSTRING)
{ {
ffgkys(fptr, keyname, (char *) value, comm, status); ffgkys(fptr, keyname, (char *) value, comm, status);
} }
else if (datatype == TBYTE) else if (datatype == TBYTE)
skipping to change at line 364 skipping to change at line 365
else else
*(int *) value = longval; *(int *) value = longval;
} }
} }
else if (datatype == TLOGICAL) else if (datatype == TLOGICAL)
{ {
ffgkyl(fptr, keyname, (int *) value, comm, status); ffgkyl(fptr, keyname, (int *) value, comm, status);
} }
else if (datatype == TULONG) else if (datatype == TULONG)
{ {
if (ffgkyjj(fptr, keyname, &longval, comm, status) <= 0) if (ffgkyujj(fptr, keyname, &ulongval, comm, status) <= 0)
{ {
if (longval > ULONG_MAX || longval < 0) if (ulongval > ULONG_MAX)
*status = NUM_OVERFLOW; *status = NUM_OVERFLOW;
else else
*(unsigned long *) value = longval; *(unsigned long *) value = ulongval;
} }
} }
else if (datatype == TLONG) else if (datatype == TLONG)
{ {
if (ffgkyjj(fptr, keyname, &longval, comm, status) <= 0) if (ffgkyjj(fptr, keyname, &longval, comm, status) <= 0)
{ {
if (longval > LONG_MAX || longval < LONG_MIN) if (longval > LONG_MAX || longval < LONG_MIN)
*status = NUM_OVERFLOW; *status = NUM_OVERFLOW;
else else
*(int *) value = longval; *(int *) value = longval;
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)