Commit e79b1abc authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

dmemory.h: update

parent ca0e9b1c
......@@ -113,9 +113,9 @@ void *cdoReadTimestep(void *rarg)
}
if ( CDO_Memtype == MEMTYPE_FLOAT )
streamReadRecordF(streamID, input_vars[varID][levelID].ptr2, &nmiss);
streamReadRecordF(streamID, (float*)input_vars[varID][levelID].ptr2, &nmiss);
else
streamReadRecord(streamID, input_vars[varID][levelID].ptr2, &nmiss);
streamReadRecord(streamID, (double*)input_vars[varID][levelID].ptr2, &nmiss);
input_vars[varID][levelID].nmiss2 = nmiss;
}
......@@ -140,12 +140,12 @@ void cdoUpdateVars(int nvars, int vlistID, field_t **vars)
if ( CDO_Memtype == MEMTYPE_FLOAT )
{
tmp = vars[varID][levelID].ptrf;
vars[varID][levelID].ptrf = vars[varID][levelID].ptr2;
vars[varID][levelID].ptrf = (float*) vars[varID][levelID].ptr2;
}
else
{
tmp = vars[varID][levelID].ptr;
vars[varID][levelID].ptr = vars[varID][levelID].ptr2;
vars[varID][levelID].ptr = (double*) vars[varID][levelID].ptr2;
}
vars[varID][levelID].ptr2 = tmp;
vars[varID][levelID].nmiss = vars[varID][levelID].nmiss2;
......@@ -377,7 +377,7 @@ void *XTimstat(void *argument)
if ( nmiss > 0 || samp1[varID][levelID].ptr )
{
if ( samp1[varID][levelID].ptr == NULL )
samp1[varID][levelID].ptr = (double*) Malloc(nwpv*gridsize*sizeof(double));
samp1[varID][levelID].ptr = (double*) malloc(nwpv*gridsize*sizeof(double));
for ( int i = 0; i < nwpv*gridsize; i++ )
if ( DBL_IS_EQUAL(vars1[varID][levelID].ptr[i], vars1[varID][levelID].missval) )
......@@ -404,7 +404,7 @@ void *XTimstat(void *argument)
{
if ( samp1[varID][levelID].ptr == NULL )
{
samp1[varID][levelID].ptr = (double*) Malloc(nwpv*gridsize*sizeof(double));
samp1[varID][levelID].ptr = (double*) malloc(nwpv*gridsize*sizeof(double));
for ( int i = 0; i < nwpv*gridsize; i++ )
samp1[varID][levelID].ptr[i] = nsets;
}
......
......@@ -35,15 +35,6 @@ extern void memFree (void *ptr, const char *file, const char *functionname,
#endif /* DEBUG_MEMORY */
void *cdiXmalloc(size_t, const char *, const char *, int);
#define xmalloc(size) cdiXmalloc((size), __FILE__, __func__, __LINE__ )
void *cdiXcalloc(size_t, size_t, const char *, const char *, int);
#define xcalloc(nmemb,size) cdiXcalloc((nmemb), (size), __FILE__, __func__, __LINE__)
void *cdiXrealloc(void *, size_t, const char *, const char *, int);
#define xrealloc(p,size) cdiXrealloc((p), (size), __FILE__, __func__, __LINE__)
#endif /* _DMEMORY_H */
/*
* Local Variables:
......
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