Commit 776dbec3 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

patch from Nathanael Huebbe: 0006-fixed-an-incompatibility-with-the-current-C-standard

parent 30bca1f5
......@@ -858,7 +858,7 @@ int streamOpenRead(const char *filename)
{
cdiInitialize();
int byteorder;
int byteorder = 0;
int filetype = getFiletype(filename, &byteorder);
if ( filetype < 0 ) return (filetype);
......@@ -879,7 +879,7 @@ int streamOpenAppend(const char *filename)
{
cdiInitialize();
int byteorder;
int byteorder = 0;
int filetype = getFiletype(filename, &byteorder);
if ( filetype < 0 ) return (filetype);
......@@ -2082,8 +2082,8 @@ int streamNtsteps(int streamID)
return (streamptr->ntsteps);
}
off_t streamNvals(int streamID)
// This function is used in CDO!
off_t streamNvals(int streamID)
{
stream_t *streamptr = stream_to_pointer(streamID);
......
......@@ -4218,10 +4218,11 @@ void cdfReadVarSliceDP(stream_t *streamptr, int varID, int levelID, double *data
if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_FLT32 )
{
float *data_fp = (float *) data;
float *data_fp = malloc(gridsize*sizeof(*data_fp));
cdf_get_vara_float(fileID, ncvarid, start, count, data_fp);
for ( i = gridsize-1; i >=0; i-- )
for ( i = 0; i < gridsize; i++ )
data[i] = (double) data_fp[i];
free(data_fp);
}
else
cdf_get_vara_double(fileID, ncvarid, start, count, data);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment