Commit 08fcddd1 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

removed cast of malloc result

parent b5997e15
......@@ -118,7 +118,7 @@ void *Arithlat(void *argument)
gridsize = gridInqSize(gridID);
scale = (double *) realloc(scale, gridsize*sizeof(double));
scale = realloc(scale, gridsize*sizeof(double));
gridInqYvals(gridID, scale);
/* Convert lat/lon units if required */
......
......@@ -139,8 +139,8 @@ void *Detrend(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
dtinfo = (dtinfo_t *) realloc(dtinfo, nalloc*sizeof(dtinfo_t));
vars = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
dtinfo = realloc(dtinfo, nalloc*sizeof(dtinfo_t));
vars = realloc(vars, nalloc*sizeof(field_t **));
}
taxisInqDTinfo(taxisID1, &dtinfo[tsID]);
......
......@@ -86,9 +86,9 @@ void *Duplicate(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
vdate = (int *) realloc(vdate, nalloc*sizeof(int));
vtime = (int *) realloc(vtime, nalloc*sizeof(int));
vars = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
vdate = realloc(vdate, nalloc*sizeof(int));
vtime = realloc(vtime, nalloc*sizeof(int));
vars = realloc(vars, nalloc*sizeof(field_t **));
}
vdate[tsID] = taxisInqVdate(taxisID1);
......
......@@ -121,7 +121,7 @@ void *Eofcoeff(void * argument)
if ( eofID == 0 )
eof[varID][levelID] = malloc (1*sizeof(field_t));
else
eof[varID][levelID] = (field_t*) realloc (eof[varID][levelID], (eofID+1)*sizeof(field_t));
eof[varID][levelID] = realloc (eof[varID][levelID], (eofID+1)*sizeof(field_t));
eof[varID][levelID][eofID].grid = gridID1;
eof[varID][levelID][eofID].nmiss = 0;
eof[varID][levelID][eofID].missval= missval1;
......
......@@ -119,7 +119,7 @@ void *Eofcoeff3d(void * argument)
if ( eofID == 0 )
eof[varID][levelID] = malloc (1*sizeof(field_t));
else
eof[varID][levelID] = (field_t*) realloc (eof[varID][levelID], (eofID+1)*sizeof(field_t));
eof[varID][levelID] = realloc (eof[varID][levelID], (eofID+1)*sizeof(field_t));
eof[varID][levelID][eofID].grid = gridID1;
eof[varID][levelID][eofID].nmiss = 0;
eof[varID][levelID][eofID].missval= missval1;
......
......@@ -243,8 +243,8 @@ void *Filter(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
dtinfo = (dtinfo_t *) realloc(dtinfo, nalloc*sizeof(dtinfo_t));
vars = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
dtinfo = realloc(dtinfo, nalloc*sizeof(dtinfo_t));
vars = realloc(vars, nalloc*sizeof(field_t **));
}
taxisInqDTinfo(taxisID1, &dtinfo[tsID]);
......
......@@ -83,9 +83,9 @@ void *Fourier(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
vdate = (int *) realloc(vdate, nalloc*sizeof(int));
vtime = (int *) realloc(vtime, nalloc*sizeof(int));
vars = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
vdate = realloc(vdate, nalloc*sizeof(int));
vtime = realloc(vtime, nalloc*sizeof(int));
vars = realloc(vars, nalloc*sizeof(field_t **));
}
vdate[tsID] = taxisInqVdate(taxisID1);
......
......@@ -1297,9 +1297,9 @@ void *Gradsdes(void *argument)
if ( nrecords >= maxrecs )
{
maxrecs = nrecords;
intnum = (int *) realloc(intnum, 1*maxrecs*sizeof(int));
fltnum = (float *) realloc(fltnum, 3*maxrecs*sizeof(float));
bignum = (off_t *) realloc(bignum, 2*maxrecs*sizeof(off_t));
intnum = realloc(intnum, 1*maxrecs*sizeof(int));
fltnum = realloc(fltnum, 3*maxrecs*sizeof(float));
bignum = realloc(bignum, 2*maxrecs*sizeof(off_t));
}
for ( recID = 0; recID < nrecs; recID++ )
......
......@@ -121,7 +121,7 @@ void read_amsr(FILE *fp, int vlistID, int nvars, double *data[], int *nmiss)
for ( varID = 0; varID < nvars; ++varID )
{
gridsize = gridInqSize(vlistInqVarGrid(vlistID, varID));
amsr_data = (unsigned char *) realloc(amsr_data, gridsize);
amsr_data = realloc(amsr_data, gridsize);
size = fread(amsr_data, 1, gridsize, fp);
if ( (int)size != gridsize ) cdoAbort("Read error!");
......
......@@ -1061,7 +1061,7 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
offset = gridsize*(nz-1);
array = ((datasets_t *) opdata)->obj[nset].array;
array = (double *) realloc(array, gridsize*nz*nt*sizeof(double));
array = realloc(array, gridsize*nz*nt*sizeof(double));
((datasets_t *) opdata)->obj[nset].array = array;
array = array+offset;
......
......@@ -886,9 +886,9 @@ void *Maggraph(void *argument)
if ( nts[ fileID ] > nts_alloc )
{
nts_alloc += NINC_ALLOC;
datatab[ fileID ] = (double *) realloc(datatab[fileID], nts_alloc*sizeof(double));
vdate[ fileID ] = (int *) realloc(vdate[fileID], nts_alloc*sizeof(int));
vtime[ fileID ] = (int *) realloc(vtime[fileID], nts_alloc*sizeof(int));
datatab[ fileID ] = realloc(datatab[fileID], nts_alloc*sizeof(double));
vdate[ fileID ] = realloc(vdate[fileID], nts_alloc*sizeof(int));
vtime[ fileID ] = realloc(vtime[fileID], nts_alloc*sizeof(int));
}
streamInqRecord( streamID, &varID, &levelID );
......
......@@ -62,7 +62,7 @@ void checkDupEntry(int vlistID1, int vlistID2, const char *filename)
if ( nlev1 > mlev1 )
{
mlev1 = nlev1;
lev1 = (double *) realloc(lev1, mlev1*sizeof(double));
lev1 = realloc(lev1, mlev1*sizeof(double));
}
zaxisInqLevels(zaxisID1, lev1);
......@@ -81,7 +81,7 @@ void checkDupEntry(int vlistID1, int vlistID2, const char *filename)
if ( nlev2 > mlev2 )
{
mlev2 = nlev2;
lev2 = (double *) realloc(lev2, mlev2*sizeof(double));
lev2 = realloc(lev2, mlev2*sizeof(double));
}
zaxisInqLevels(zaxisID2, lev2);
......
......@@ -758,8 +758,8 @@ void *Outputgmt(void *argument)
{
if ( gridcorners == 0 ) cdoAbort("grid corner missing!");
nalloc = gridcorners*gridsize;
grid_corner_lat = (double *) realloc(grid_corner_lat, nalloc*sizeof(double));
grid_corner_lon = (double *) realloc(grid_corner_lon, nalloc*sizeof(double));
grid_corner_lat = realloc(grid_corner_lat, nalloc*sizeof(double));
grid_corner_lon = realloc(grid_corner_lon, nalloc*sizeof(double));
if ( gridInqYbounds(gridID, NULL) && gridInqXbounds(gridID, NULL) )
{
......
......@@ -116,8 +116,8 @@ void *Pack(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
dtinfo = (dtinfo_t *) realloc(dtinfo, nalloc*sizeof(dtinfo_t));
vars = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
dtinfo = realloc(dtinfo, nalloc*sizeof(dtinfo_t));
vars = realloc(vars, nalloc*sizeof(field_t **));
}
taxisInqDTinfo(taxisID1, &dtinfo[tsID]);
......
......@@ -140,7 +140,7 @@ double *vctFromFile(const char *filename, int *nvct)
for ( i = 0; i < nlevh2+1; ++i )
vct2[i+nvct2/2] = vct2[i+maxvct/2];
vct2 = (double *) realloc(vct2, nvct2*sizeof(double));
vct2 = realloc(vct2, nvct2*sizeof(double));
*nvct = nvct2;
......
......@@ -645,7 +645,7 @@ int gencellgrid(int gridID1, int *gridsize2, int **cellidx)
if ( nvals > maxcell )
{
maxcell += cellinc;
*cellidx = (int *) realloc(*cellidx, maxcell*sizeof(int));
*cellidx = realloc(*cellidx, maxcell*sizeof(int));
}
(*cellidx)[nvals-1] = i;
}
......
......@@ -105,9 +105,9 @@ void *Sorttimestamp(void *argument)
if ( xtsID >= nalloc )
{
nalloc += NALLOC_INC;
vdate = (int *) realloc(vdate, nalloc*sizeof(int));
vtime = (int *) realloc(vtime, nalloc*sizeof(int));
vars = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
vdate = realloc(vdate, nalloc*sizeof(int));
vtime = realloc(vtime, nalloc*sizeof(int));
vars = realloc(vars, nalloc*sizeof(field_t **));
}
vdate[xtsID] = taxisInqVdate(taxisID1);
......
......@@ -194,9 +194,9 @@ void *Spectrum(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
vdate = (int *) realloc(vdate, nalloc*sizeof(int));
vtime = (int *) realloc(vtime, nalloc*sizeof(int));
vars = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
vdate = realloc(vdate, nalloc*sizeof(int));
vtime = realloc(vtime, nalloc*sizeof(int));
vars = realloc(vars, nalloc*sizeof(field_t **));
}
vdate[tsID] = taxisInqVdate(taxisID1);
......
......@@ -91,9 +91,9 @@ void *Timsort(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
vdate = (int *) realloc(vdate, nalloc*sizeof(int));
vtime = (int *) realloc(vtime, nalloc*sizeof(int));
vars = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
vdate = realloc(vdate, nalloc*sizeof(int));
vtime = realloc(vtime, nalloc*sizeof(int));
vars = realloc(vars, nalloc*sizeof(field_t **));
}
vdate[tsID] = taxisInqVdate(taxisID1);
......
......@@ -111,7 +111,7 @@ void *Tstepcount(void *argument)
if ( tsID >= nalloc )
{
nalloc += NALLOC_INC;
vars = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
vars = realloc(vars, nalloc*sizeof(field_t **));
}
vdate = taxisInqVdate(taxisID1);
......
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