"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "putcol.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.

putcol.c  (cfitsio-3.49):putcol.c  (cfitsio-4.0.0)
skipping to change at line 1109 skipping to change at line 1109
unsigned long ulongnull; unsigned long ulongnull;
float floatnull; float floatnull;
double doublenull; double doublenull;
LONGLONG longlongnull; LONGLONG longlongnull;
} null; } null;
} colNulls; } colNulls;
void *dataptr, *defaultnull; void *dataptr, *defaultnull;
colNulls *col; colNulls *col;
int ii, jj, tstatus, naxis, bitpix; int ii, jj, tstatus, naxis, bitpix;
int typecode, hdutype, jtype, type, anynul, nfiles, nbytes; int typecode, hdutype, jtype, type, anynul=0, nfiles, nbytes;
long totaln, nleft, frow, felement, n_optimum, i_optimum, ntodo; long totaln, nleft, frow, felement, n_optimum, i_optimum, ntodo;
long rept, rowrept, width, tnull, naxes[9] = {1,1,1,1,1,1,1,1,1}, groups; long rept, rowrept, width, tnull, naxes[9] = {1,1,1,1,1,1,1,1,1}, groups;
double zeros = 0.; double zeros = 0.;
char message[FLEN_ERRMSG], keyname[FLEN_KEYWORD], nullstr[FLEN_VALUE]; char message[FLEN_ERRMSG], keyname[FLEN_KEYWORD], nullstr[FLEN_VALUE];
char **stringptr, *nullptr, *cptr; char **stringptr, *nullptr, *cptr;
if (*status > 0) if (*status > 0)
return(*status); return(*status);
if (n_cols < 0 || n_cols > 999 ) if (n_cols < 0 || n_cols > 999 )
skipping to change at line 1428 skipping to change at line 1428
cols[jj].datatype = TINT; cols[jj].datatype = TINT;
else else
cols[jj].datatype = abs(typecode); cols[jj].datatype = abs(typecode);
} }
/* calc total number of elements to do on each iteration */ /* calc total number of elements to do on each iteration */
if (hdutype == IMAGE_HDU || cols[jj].datatype == TSTRING) if (hdutype == IMAGE_HDU || cols[jj].datatype == TSTRING)
{ {
ntodo = n_optimum; ntodo = n_optimum;
cols[jj].repeat = 1; cols[jj].repeat = 1;
/* handle special case of a 0-width string column */
if (hdutype == BINARY_TBL && rept == 0)
cols[jj].repeat = 0;
/* get the BLANK keyword value, if it exists */ /* get the BLANK keyword value, if it exists */
if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecod e) == TLONG if (abs(typecode) == TBYTE || abs(typecode) == TSHORT || abs(typecod e) == TLONG
|| abs(typecode) == TINT || abs(typecode) == TLONGLONG) || abs(typecode) == TINT || abs(typecode) == TLONGLONG)
{ {
tstatus = 0; tstatus = 0;
ffgkyj(cols[jj].fptr, "BLANK", &tnull, 0, &tstatus); ffgkyj(cols[jj].fptr, "BLANK", &tnull, 0, &tstatus);
if (tstatus) if (tstatus)
{ {
tnull = 0L; /* no null values */ tnull = 0L; /* no null values */
skipping to change at line 1704 skipping to change at line 1707
/* allocate array of pointers to all the strings */ /* allocate array of pointers to all the strings */
if( hdutype==ASCII_TBL ) rept = width; if( hdutype==ASCII_TBL ) rept = width;
stringptr = calloc((ntodo + 1) , sizeof(stringptr)); stringptr = calloc((ntodo + 1) , sizeof(stringptr));
cols[jj].array = stringptr; cols[jj].array = stringptr;
col[jj].nullsize = rept + 1; /* number of bytes per value */ col[jj].nullsize = rept + 1; /* number of bytes per value */
if (stringptr) if (stringptr)
{ {
/* allocate string to store the null string value */ /* allocate string to store the null string value */
col[jj].null.stringnull = calloc(rept + 1, sizeof(char) ); col[jj].null.stringnull = calloc(rept + 1, sizeof(char) );
col[jj].null.stringnull[1] = 1; /* to make sure string != 0 */ if (rept > 0)
col[jj].null.stringnull[1] = 1; /* to make sure string != 0 */
/* allocate big block for the array of table column strings */ /* allocate big block for the array of table column strings */
stringptr[0] = calloc((ntodo + 1) * (rept + 1), sizeof(char) ); stringptr[0] = calloc((ntodo + 1) * (rept + 1), sizeof(char) );
if (stringptr[0]) if (stringptr[0])
{ {
for (ii = 1; ii <= ntodo; ii++) for (ii = 1; ii <= ntodo; ii++)
{ /* pointer to each string */ { /* pointer to each string */
stringptr[ii] = stringptr[ii - 1] + (rept + 1); stringptr[ii] = stringptr[ii - 1] + (rept + 1);
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 6 lines changed or added

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