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

cast result of malloc

parent bc590a12
......@@ -266,12 +266,12 @@ void *Intlevel3d(void *argument)
nlonIn = gridInqXsize(gridID);
nlatIn = gridInqYsize(gridID);
lonIn = malloc(nlonIn*sizeof(double));
latIn = malloc(nlatIn*sizeof(double));
lonIn = (double*) malloc(nlonIn*sizeof(double));
latIn = (double*) malloc(nlatIn*sizeof(double));
gridInqXvals(gridID, lonIn);
gridInqYvals(gridID, latIn);
zlevels_in = malloc(gridsize*(nlevel+2)*sizeof(double*));
zlevels_in = (double**) malloc(gridsize*(nlevel+2)*sizeof(double*));
nlevi = nlevel; /* number of input levels for later use */
gridsizei = gridsize; /* horizontal gridsize of input z coordinate */
nrecs = streamInqTimestep(streamID0, 0);
......@@ -302,12 +302,12 @@ void *Intlevel3d(void *argument)
nlonOut = gridInqXsize(gridID);
nlatOut = gridInqYsize(gridID);
lonOut = malloc(nlonOut*sizeof(double));
latOut = malloc(nlatOut*sizeof(double));
lonOut = (double*) malloc(nlonOut*sizeof(double));
latOut = (double*) malloc(nlatOut*sizeof(double));
gridInqXvals(gridID, lonOut);
gridInqYvals(gridID, latOut);
zlevels_out = malloc(gridsize*nlevel*sizeof(double));
zlevels_out = (double*) malloc(gridsize*nlevel*sizeof(double));
nlevo = nlevel; /* number of output levels for later use */
gridsizeo = gridsize;/* horizontal gridsize of output z coordinate */
nrecs = streamInqTimestep(streamID2, 0);
......@@ -427,10 +427,10 @@ void *Intlevel3d(void *argument)
/*
* Create weights for later interpolation - assumption: input vertical correct is constant in time
*/
lev_idx1 = malloc(nlevo*gridSize*sizeof(int));
lev_idx2 = malloc(nlevo*gridSize*sizeof(int));
lev_wgt1 = malloc(nlevo*gridSize*sizeof(double));
lev_wgt2 = malloc(nlevo*gridSize*sizeof(double));
lev_idx1 = (int*) malloc(nlevo*gridSize*sizeof(int));
lev_idx2 = (int*) malloc(nlevo*gridSize*sizeof(int));
lev_wgt1 = (double*) malloc(nlevo*gridSize*sizeof(double));
lev_wgt2 = (double*) malloc(nlevo*gridSize*sizeof(double));
gen_weights3d(expol, nlevi+2, gridSize, zlevels_in, nlevo, zlevels_out, lev_idx1, lev_idx2, lev_wgt1, lev_wgt2);
......@@ -438,7 +438,7 @@ void *Intlevel3d(void *argument)
* Copy z-axis information to output z-axis
*/
zaxisID3 = zaxisCreate(zaxisInqType(zaxisID1), nlevo);
lev2 = malloc(nlevo*sizeof(double));
lev2 = (double*) malloc(nlevo*sizeof(double));
/* fill values with its indices */
for (i=0;i<nlevo;i++)
lev2[i] = (double) i;
......@@ -470,11 +470,11 @@ void *Intlevel3d(void *argument)
maxlev = nlevi > nlevo ? nlevi : nlevo;
nvars = vlistNvars(vlistID1);
vars = malloc(nvars*sizeof(int));
vardata1 = malloc(nvars*sizeof(double*)); /* input */
vardata2 = malloc(nvars*sizeof(double*)); /* output */
varnmiss = malloc(nvars*sizeof(int*)); /* can for missing values of arbitrary variables */
varinterp = malloc(nvars*sizeof(int)); /* marker for variables to be interpolated */
vars = (int*) malloc(nvars*sizeof(int));
vardata1 = (double**) malloc(nvars*sizeof(double*)); /* input */
vardata2 = (double**) malloc(nvars*sizeof(double*)); /* output */
varnmiss = (int**) malloc(nvars*sizeof(int*)); /* can for missing values of arbitrary variables */
varinterp = (int*) malloc(nvars*sizeof(int)); /* marker for variables to be interpolated */
/* by default no variable should be interpolated */
for (i = 0; i < nvars;i++)
......@@ -489,7 +489,7 @@ void *Intlevel3d(void *argument)
vlistInqVarName(vlistID1, varID, varname);
vardata1[varID] = malloc(gridsize*nlevel*sizeof(double));
vardata1[varID] = (double*) malloc(gridsize*nlevel*sizeof(double));
/* variabls for interpolation:
* * have the required vertical axis, i.e. the correct number of levels (nlevi)
......@@ -500,8 +500,8 @@ void *Intlevel3d(void *argument)
{
nlonIn = gridInqXsize(gridID);
nlatIn = gridInqYsize(gridID);
lonIn = malloc(nlonIn*sizeof(double));
latIn = malloc(nlatIn*sizeof(double));
lonIn = (double*) malloc(nlonIn*sizeof(double));
latIn = (double*) malloc(nlatIn*sizeof(double));
gridInqXvals(gridID, lonIn);
gridInqYvals(gridID, latIn);
......@@ -512,14 +512,14 @@ void *Intlevel3d(void *argument)
{
varinterp[varID] = FALSE;
vardata2[varID] = vardata1[varID];
varnmiss[varID] = malloc(nlevel*sizeof(int));
varnmiss[varID] = (int*) malloc(nlevel*sizeof(int));
if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels\n",varname,nlevel);
}
else
{
varinterp[varID] = TRUE;
vardata2[varID] = malloc(gridsize*nlevo*sizeof(double));
varnmiss[varID] = malloc(maxlev*sizeof(int));
vardata2[varID] = (double*) malloc(gridsize*nlevo*sizeof(double));
varnmiss[varID] = (int*) malloc(maxlev*sizeof(int));
memset(varnmiss[varID], 0, maxlev*sizeof(int));
}
}
......@@ -527,7 +527,7 @@ void *Intlevel3d(void *argument)
{
varinterp[varID] = FALSE;
vardata2[varID] = vardata1[varID];
varnmiss[varID] = malloc(nlevel*sizeof(int));
varnmiss[varID] = (int*) malloc(nlevel*sizeof(int));
if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels\n",varname,nlevel);
}
}
......
......@@ -68,25 +68,25 @@ void *Intntime(void *argument)
nvars = vlistNvars(vlistID1);
nrecords = vlistNrecs(vlistID1);
recVarID = malloc(nrecords*sizeof(int));
recLevelID = malloc(nrecords*sizeof(int));
recVarID = (int*) malloc(nrecords*sizeof(int));
recLevelID = (int*) malloc(nrecords*sizeof(int));
gridsize = vlistGridsizeMax(vlistID1);
array = malloc(gridsize*sizeof(double));
array = (double*) malloc(gridsize*sizeof(double));
nmiss1 = malloc(nvars*sizeof(int *));
nmiss2 = malloc(nvars*sizeof(int *));
vardata1 = malloc(nvars*sizeof(double *));
vardata2 = malloc(nvars*sizeof(double *));
nmiss1 = (int **) malloc(nvars*sizeof(int *));
nmiss2 = (int **) malloc(nvars*sizeof(int *));
vardata1 = (double **) malloc(nvars*sizeof(double *));
vardata2 = (double **) malloc(nvars*sizeof(double *));
for ( varID = 0; varID < nvars; varID++ )
{
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
nmiss1[varID] = malloc(nlevel*sizeof(int));
nmiss2[varID] = malloc(nlevel*sizeof(int));
vardata1[varID] = malloc(gridsize*nlevel*sizeof(double));
vardata2[varID] = malloc(gridsize*nlevel*sizeof(double));
nmiss1[varID] = (int*) malloc(nlevel*sizeof(int));
nmiss2[varID] = (int*) malloc(nlevel*sizeof(int));
vardata1[varID] = (double*) malloc(gridsize*nlevel*sizeof(double));
vardata2[varID] = (double*) malloc(gridsize*nlevel*sizeof(double));
}
taxisID1 = vlistInqTaxis(vlistID1);
......
......@@ -111,25 +111,25 @@ void *Inttime(void *argument)
nvars = vlistNvars(vlistID1);
nrecords = vlistNrecs(vlistID1);
recVarID = malloc(nrecords*sizeof(int));
recLevelID = malloc(nrecords*sizeof(int));
recVarID = (int*) malloc(nrecords*sizeof(int));
recLevelID = (int*) malloc(nrecords*sizeof(int));
gridsize = vlistGridsizeMax(vlistID1);
array = malloc(gridsize*sizeof(double));
array = (double*) malloc(gridsize*sizeof(double));
nmiss1 = malloc(nvars*sizeof(int *));
nmiss2 = malloc(nvars*sizeof(int *));
vardata1 = malloc(nvars*sizeof(double *));
vardata2 = malloc(nvars*sizeof(double *));
nmiss1 = (int **) malloc(nvars*sizeof(int *));
nmiss2 = (int **) malloc(nvars*sizeof(int *));
vardata1 = (double **) malloc(nvars*sizeof(double *));
vardata2 = (double **) malloc(nvars*sizeof(double *));
for ( varID = 0; varID < nvars; varID++ )
{
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
nmiss1[varID] = malloc(nlevel*sizeof(int));
nmiss2[varID] = malloc(nlevel*sizeof(int));
vardata1[varID] = malloc(gridsize*nlevel*sizeof(double));
vardata2[varID] = malloc(gridsize*nlevel*sizeof(double));
nmiss1[varID] = (int*) malloc(nlevel*sizeof(int));
nmiss2[varID] = (int*) malloc(nlevel*sizeof(int));
vardata1[varID] = (double*) malloc(gridsize*nlevel*sizeof(double));
vardata2[varID] = (double*) malloc(gridsize*nlevel*sizeof(double));
}
taxisID1 = vlistInqTaxis(vlistID1);
......
......@@ -60,7 +60,7 @@ void *Intyear(void *argument)
iyears = (int *) listArrayPtr(ilist);
streamIDs = malloc(nyears*sizeof(int));
streamIDs = (int*) malloc(nyears*sizeof(int));
streamID1 = streamOpenRead(cdoStreamName(0));
streamID2 = streamOpenRead(cdoStreamName(1));
......@@ -72,9 +72,9 @@ void *Intyear(void *argument)
vlistCompare(vlistID1, vlistID2, CMP_ALL);
gridsize = vlistGridsizeMax(vlistID1);
array1 = malloc(gridsize*sizeof(double));
array2 = malloc(gridsize*sizeof(double));
array3 = malloc(gridsize*sizeof(double));
array1 = (double*) malloc(gridsize*sizeof(double));
array2 = (double*) malloc(gridsize*sizeof(double));
array3 = (double*) malloc(gridsize*sizeof(double));
taxisID1 = vlistInqTaxis(vlistID1);
taxisID2 = vlistInqTaxis(vlistID2);
......
......@@ -66,8 +66,8 @@ void invertLonDes(int vlistID)
else
size = nlon;
xv1 = malloc(size*sizeof(double));
xv2 = malloc(size*sizeof(double));
xv1 = (double*) malloc(size*sizeof(double));
xv2 = (double*) malloc(size*sizeof(double));
gridInqXvals(gridID1, xv1);
......@@ -101,8 +101,8 @@ void invertLonDes(int vlistID)
else
size = nv*nlon;
xb1 = malloc(size*sizeof(double));
xb2 = malloc(size*sizeof(double));
xb1 = (double*) malloc(size*sizeof(double));
xb2 = (double*) malloc(size*sizeof(double));
gridInqXbounds(gridID1, xb1);
......@@ -165,8 +165,8 @@ void invertLatDes(int vlistID)
else
size = nlat;
yv1 = malloc(size*sizeof(double));
yv2 = malloc(size*sizeof(double));
yv1 = (double*) malloc(size*sizeof(double));
yv2 = (double*) malloc(size*sizeof(double));
if ( gridtype == GRID_CURVILINEAR )
......@@ -213,8 +213,8 @@ void invertLatDes(int vlistID)
else
size = nv*nlat;
yb1 = malloc(size*sizeof(double));
yb2 = malloc(size*sizeof(double));
yb1 = (double*) malloc(size*sizeof(double));
yb2 = (double*) malloc(size*sizeof(double));
gridInqYbounds(gridID1, yb1);
......@@ -256,8 +256,8 @@ void invertLonData(double *array1, double *array2, int gridID1)
if ( nlat > 0 )
{
field1 = malloc(nlat*sizeof(double *));
field2 = malloc(nlat*sizeof(double *));
field1 = (double **) malloc(nlat*sizeof(double *));
field2 = (double **) malloc(nlat*sizeof(double *));
for ( ilat = 0; ilat < nlat; ilat++ )
{
......@@ -290,8 +290,8 @@ void invertLatData(double *array1, double *array2, int gridID1)
if ( nlat > 0 )
{
field1 = malloc(nlat*sizeof(double *));
field2 = malloc(nlat*sizeof(double *));
field1 = (double **) malloc(nlat*sizeof(double *));
field2 = (double **) malloc(nlat*sizeof(double *));
for ( ilat = 0; ilat < nlat; ilat++ )
{
......@@ -366,8 +366,8 @@ void *Invert(void *argument)
gridsize = vlistGridsizeMax(vlistID1);
array1 = malloc(gridsize*sizeof(double));
array2 = malloc(gridsize*sizeof(double));
array1 = (double*) malloc(gridsize*sizeof(double));
array2 = (double*) malloc(gridsize*sizeof(double));
tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
......
......@@ -55,8 +55,8 @@ void invertLevDes(int vlistID)
/* if ( zaxisInqLevels(zaxisID1, NULL) ) */
{
yv1 = malloc(nlev*sizeof(double));
yv2 = malloc(nlev*sizeof(double));
yv1 = (double*) malloc(nlev*sizeof(double));
yv2 = (double*) malloc(nlev*sizeof(double));
zaxisInqLevels(zaxisID1, yv1);
for ( ilev = 0; ilev < nlev; ++ilev ) yv2[nlev-ilev-1] = yv1[ilev];
......@@ -68,8 +68,8 @@ void invertLevDes(int vlistID)
if ( zaxisInqLbounds(zaxisID1, NULL) && zaxisInqUbounds(zaxisID1, NULL) )
{
yb1 = malloc(nlev*sizeof(double));
yb2 = malloc(nlev*sizeof(double));
yb1 = (double*) malloc(nlev*sizeof(double));
yb2 = (double*) malloc(nlev*sizeof(double));
zaxisInqLbounds(zaxisID1, yb1);
for ( ilev = 0; ilev < nlev; ++ilev ) yb2[nlev-ilev-1] = yb1[ilev];
......@@ -137,12 +137,12 @@ void *Invertlev(void *argument)
gridsize = vlistGridsizeMax(vlistID1);
array = malloc(gridsize*sizeof(double));
array = (double*) malloc(gridsize*sizeof(double));
nvars = vlistNvars(vlistID1);
vardata = malloc(nvars*sizeof(double*));
varnmiss = malloc(nvars*sizeof(int*));
vardata = (double**) malloc(nvars*sizeof(double*));
varnmiss = (int**) malloc(nvars*sizeof(int*));
for ( varID = 0; varID < nvars; varID++ )
{
......@@ -160,8 +160,8 @@ void *Invertlev(void *argument)
else
{
linvert = TRUE;
vardata[varID] = malloc(gridsize*nlev*sizeof(double));
varnmiss[varID] = malloc(nlev*sizeof(int));
vardata[varID] = (double*) malloc(gridsize*nlev*sizeof(double));
varnmiss[varID] = (int*) malloc(nlev*sizeof(int));
}
}
......
......@@ -135,7 +135,7 @@ void *Isosurface(void *argument)
if ( i == nzaxis ) cdoAbort("No processable variable found!");
nlev1 = nlevel;
lev1 = malloc((nlev1)*sizeof(double));
lev1 = (double*) malloc((nlev1)*sizeof(double));
zaxisInqLevels(zaxisID1, lev1);
zaxisIDsfc = zaxisCreate(ZAXIS_SURFACE, 1);
......@@ -150,13 +150,13 @@ void *Isosurface(void *argument)
gridsize = vlistGridsizeMax(vlistID1);
field_init(&field);
field.ptr = malloc(gridsize*sizeof(double));
field.ptr = (double*) malloc(gridsize*sizeof(double));
nvars = vlistNvars(vlistID1);
liso = malloc(nvars*sizeof(int));
vars = malloc(nvars*sizeof(int));
vars1 = malloc(nvars*sizeof(field_t));
vars1 = (field_t*) malloc(nvars*sizeof(field_t));
for ( varID = 0; varID < nvars; varID++ )
{
......@@ -176,7 +176,7 @@ void *Isosurface(void *argument)
vars1[varID].zaxis = zaxisID;
vars1[varID].nmiss = 0;
vars1[varID].missval = missval;
vars1[varID].ptr = malloc(gridsize*nlevel*sizeof(double));
vars1[varID].ptr = (double*) malloc(gridsize*nlevel*sizeof(double));
}
tsID = 0;
......
......@@ -824,10 +824,10 @@ void *Maggraph(void *argument)
fprintf( stderr," files %s\n",ofilename );
}
datatab = malloc(nfiles*sizeof(double *));
vdate = malloc(nfiles*sizeof(int *));
vtime = malloc(nfiles*sizeof(int *));
nts = malloc(nfiles*sizeof(long));
datatab = (double **) malloc(nfiles*sizeof(double *));
vdate = (int **) malloc(nfiles*sizeof(int *));
vtime = (int **) malloc(nfiles*sizeof(int *));
nts = (long*) malloc(nfiles*sizeof(long));
for ( fileID = 0; fileID < nfiles; fileID++ )
{
......
......@@ -549,9 +549,9 @@ void *Magplot(void *argument)
nlat = gridInqYsize(gridID);
nlev = zaxisInqSize(zaxisID);
array = malloc(gridsize*sizeof(double));
grid_center_lat = malloc(gridsize*sizeof(double));
grid_center_lon = malloc(gridsize*sizeof(double));
array = (double*) malloc(gridsize*sizeof(double));
grid_center_lat = (double*) malloc(gridsize*sizeof(double));
grid_center_lon = (double*) malloc(gridsize*sizeof(double));
gridInqYvals(gridID, grid_center_lat);
gridInqXvals(gridID, grid_center_lon);
......
......@@ -291,10 +291,10 @@ void *Magvector(void *argument)
nlat = gridInqYsize(gridID);
nlev = zaxisInqSize(zaxisID);
uarray = malloc(gridsize*sizeof(double));
varray = malloc(gridsize*sizeof(double));
grid_center_lat = malloc(gridsize*sizeof(double));
grid_center_lon = malloc(gridsize*sizeof(double));
uarray = (double*) malloc(gridsize*sizeof(double));
varray = (double*) malloc(gridsize*sizeof(double));
grid_center_lat = (double*) malloc(gridsize*sizeof(double));
grid_center_lon = (double*) malloc(gridsize*sizeof(double));
gridInqYvals(gridID, grid_center_lat);
gridInqXvals(gridID, grid_center_lon);
......
......@@ -145,8 +145,8 @@ void maskregion(int *mask, int gridID, double *xcoords, double *ycoords, int nof
nlon = gridInqXsize(gridID);
nlat = gridInqYsize(gridID);
xvals = malloc(nlon*sizeof(double));
yvals = malloc(nlat*sizeof(double));
xvals = (double*) malloc(nlon*sizeof(double));
yvals = (double*) malloc(nlat*sizeof(double));
gridInqXvals(gridID, xvals);
gridInqYvals(gridID, yvals);
......@@ -304,7 +304,7 @@ void *Maskbox(void *argument)
vlistDefTaxis(vlistID2, taxisID2);
nvars = vlistNvars(vlistID1);
vars = malloc(nvars*sizeof(int));
vars = (int*) malloc(nvars*sizeof(int));
for ( varID = 0; varID < nvars; varID++ )
{
if ( gridID == vlistInqVarGrid(vlistID1, varID) )
......
......@@ -42,12 +42,12 @@ void mastrfu(int gridID, int zaxisID, double *array1, double *array2, int nmiss,
nlat = gridInqSize(gridID);
nlev = zaxisInqSize(zaxisID);
phi = malloc(nlat*sizeof(double));
dummy = malloc(nlat*sizeof(double));
cosphi = malloc(nlat*sizeof(double));
plevel = malloc(nlev*sizeof(double));
field1 = malloc(nlev*sizeof(double*));
field2 = malloc(nlev*sizeof(double*));
phi = (double*) malloc(nlat*sizeof(double));
dummy = (double*) malloc(nlat*sizeof(double));
cosphi = (double*) malloc(nlat*sizeof(double));
plevel = (double*) malloc(nlev*sizeof(double));
field1 = (double**) malloc(nlev*sizeof(double*));
field2 = (double**) malloc(nlev*sizeof(double*));
zaxisInqLevels(zaxisID, plevel);
......@@ -167,8 +167,8 @@ void *Mastrfu(void *argument)
streamDefVlist(streamID2, vlistID2);
array1 = malloc(gridsize*nlev*sizeof(double));
array2 = malloc(gridsize*nlev*sizeof(double));
array1 = (double*) malloc(gridsize*nlev*sizeof(double));
array2 = (double*) malloc(gridsize*nlev*sizeof(double));
tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
......
......@@ -98,8 +98,8 @@ void *Math(void *argument)
gridsize = vlistGridsizeMax(vlistID1);
array1 = malloc(gridsize*sizeof(double));
array2 = malloc(gridsize*sizeof(double));
array1 = (double*) malloc(gridsize*sizeof(double));
array2 = (double*) malloc(gridsize*sizeof(double));
streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
......
......@@ -168,8 +168,8 @@ void *Merge(void *argument)
if ( !userFileOverwrite(ofilename) )
cdoAbort("Outputfile %s already exists!", ofilename);
streamIDs = malloc(nmerge*sizeof(int));
vlistIDs = malloc(nmerge*sizeof(int));
streamIDs = (int*) malloc(nmerge*sizeof(int));
vlistIDs = (int*) malloc(nmerge*sizeof(int));
for ( index = 0; index < nmerge; index++ )
{
......@@ -208,7 +208,7 @@ void *Merge(void *argument)
if ( ! lcopy )
{
gridsize = vlistGridsizeMax(vlistID2);
array = malloc(gridsize*sizeof(double));
array = (double*) malloc(gridsize*sizeof(double));
}
tsID = 0;
......
......@@ -71,13 +71,13 @@ void gen_index(int gridID1, int gridID2, int *index)
if ( ! (gridInqXvals(gridID2, NULL) && gridInqYvals(gridID2, NULL)) )
cdoAbort("Grid 2 has no values!");
xvals1 = malloc(nlon1*sizeof(double));
yvals1 = malloc(nlat1*sizeof(double));
xvals2 = malloc(nlon2*sizeof(double));
yvals2 = malloc(nlat2*sizeof(double));
xvals1 = (double*) malloc(nlon1*sizeof(double));
yvals1 = (double*) malloc(nlat1*sizeof(double));
xvals2 = (double*) malloc(nlon2*sizeof(double));
yvals2 = (double*) malloc(nlat2*sizeof(double));
xindex = malloc(nlon2*sizeof(int));
yindex = malloc(nlat2*sizeof(int));
xindex = (int*) malloc(nlon2*sizeof(int));
yindex = (int*) malloc(nlat2*sizeof(int));
gridInqXvals(gridID1, xvals1);
gridInqYvals(gridID1, yvals1);
......@@ -220,9 +220,9 @@ void *Mergegrid(void *argument)
gridsize1 = gridInqSize(gridID1);
gridsize2 = gridInqSize(gridID2);
array1 = malloc(gridsize1*sizeof(double));
array2 = malloc(gridsize2*sizeof(double));
gindex = malloc(gridsize2*sizeof(int));
array1 = (double*) malloc(gridsize1*sizeof(double));
array2 = (double*) malloc(gridsize2*sizeof(double));
gindex = (int*) malloc(gridsize2*sizeof(int));
gen_index(gridID1, gridID2, gindex);
......
......@@ -80,7 +80,7 @@ void *Mergetime(void *argument)
nfiles = cdoStreamCnt() - 1;
sf = malloc(nfiles*sizeof(sfile_t));
sf = (sfile_t*) malloc(nfiles*sizeof(sfile_t));
for ( fileID = 0; fileID < nfiles; fileID++ )
{
......@@ -130,7 +130,7 @@ void *Mergetime(void *argument)
if ( ! lcopy )
{
gridsize = vlistGridsizeMax(sf[0].vlistID);
array = malloc(gridsize*sizeof(double));
array = (double*) malloc(gridsize*sizeof(double));
}
while ( TRUE )
......
......@@ -133,12 +133,12 @@ void *Merstat(void *argument)
field_init(&field2);
lim = vlistGridsizeMax(vlistID1);
field1.ptr = malloc(lim*sizeof(double));
field1.ptr = (double*) malloc(lim*sizeof(double));
field1.weight = NULL;
if ( needWeights )
field1.weight = malloc(lim*sizeof(double));
field1.weight = (double*) malloc(lim*sizeof(double));
field2.ptr = malloc(nlonmax*sizeof(double));
field2.ptr = (double*) malloc(nlonmax*sizeof(double));
field2.grid = gridID2;
tsID = 0;
......
......@@ -72,8 +72,8 @@ void *Monarith(void *argument)
field_init(&field1);
field_init(&field2);
field1.ptr = malloc(gridsize*sizeof(double));
field2.ptr = malloc(gridsize*sizeof(double));
field1.ptr = (double*) malloc(gridsize*sizeof(double));
field2.ptr = (double*) malloc(gridsize*sizeof(double));
taxisID1 = vlistInqTaxis(vlistID1);
taxisID2 = vlistInqTaxis(vlistID2);
......@@ -86,15 +86,15 @@ void *Monarith(void *argument)
nvars = vlistNvars(vlistID2);
vardata2 = malloc(nvars*sizeof(double *));
varnmiss2 = malloc(nvars*sizeof(int *));