"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "putcoli.c" between
cfitsio3440.tar.gz and cfitsio3450.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.

putcoli.c  (cfitsio3440):putcoli.c  (cfitsio3450)
skipping to change at line 853 skipping to change at line 853
LONGLONG *output, /* O - output array of converted values */ LONGLONG *output, /* O - output array of converted values */
int *status) /* IO - error status */ int *status) /* IO - error status */
/* /*
Copy input to output prior to writing output to a FITS file. Copy input to output prior to writing output to a FITS file.
Do datatype conversion and scaling if required Do datatype conversion and scaling if required
*/ */
{ {
long ii; long ii;
double dvalue; double dvalue;
if (scale == 1. && zero == 0.) if (scale == 1. && zero == 9223372036854775808.)
{
/* Writing to unsigned long long column. Input values must not be negati
ve */
/* Instead of subtracting 9223372036854775808, it is more efficient */
/* and more precise to just flip the sign bit with the XOR operator */
for (ii = 0; ii < ntodo; ii++) {
if (input[ii] < 0) {
*status = OVERFLOW_ERR;
output[ii] = LONGLONG_MIN;
} else {
output[ii] = ((LONGLONG) input[ii]) ^ 0x8000000000000000;
}
}
}
else if (scale == 1. && zero == 0.)
{ {
for (ii = 0; ii < ntodo; ii++) for (ii = 0; ii < ntodo; ii++)
output[ii] = input[ii]; output[ii] = input[ii];
} }
else else
{ {
for (ii = 0; ii < ntodo; ii++) for (ii = 0; ii < ntodo; ii++)
{ {
dvalue = (input[ii] - zero) / scale; dvalue = (input[ii] - zero) / scale;
 End of changes. 1 change blocks. 
1 lines changed or deleted 17 lines changed or added

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