Commit 009b86cf authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

correct some malloc casts

parent 1bbbd391
......@@ -244,7 +244,7 @@ void *EOF3d(void * argument)
/* allocation of temporary fields and output structures */
in.ptr = (double*) malloc(gridsize*sizeof(double));
datafields = (field_t**) malloc(nvars*sizeof(field_t*));
datacounts = (int **) malloc(nvars*sizeof(int *));
datacounts = (int**) malloc(nvars*sizeof(int*));
eigenvectors = (field_t**) malloc(nvars*sizeof(field_t*));
eigenvalues = (field_t**) malloc(nvars*sizeof(field_t*));
......@@ -256,11 +256,10 @@ void *EOF3d(void * argument)
temp_size = gridsize * nlevs;
missval = vlistInqVarMissval(vlistID1, varID);
datafields[varID] = (field_t**) malloc(nlevs*sizeof(field_t*));
datacounts[varID] = (int* *) malloc(nlevs*sizeof(int* ));
eigenvectors[varID] = (field_t**) malloc(nlevs*sizeof(field_t*));
datacounts[varID] = (int*) malloc(nlevs*sizeof(int));
eigenvectors[varID] = (field_t*) malloc(nlevs*sizeof(field_t));
datafields[varID] = (field_t*) malloc(nts*sizeof(field_t));
datafields[varID] = (field_t*) malloc(nts*sizeof(field_t));
for ( tsID = 0; tsID < nts; tsID++ )
{
datafields[varID][tsID].grid = gridID1;
......
......@@ -102,8 +102,8 @@ int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid)
xsize = (int*) malloc(nfiles*sizeof(int));
ysize = (int*) malloc(nfiles*sizeof(int));
xyinfo = (xyinfo_t*) malloc(nfiles*sizeof(xyinfo_t));
xvals = (double*) malloc(nfiles*sizeof(double));
yvals = (double*) malloc(nfiles*sizeof(double));
xvals = (double**) malloc(nfiles*sizeof(double*));
yvals = (double**) malloc(nfiles*sizeof(double*));
for ( fileID = 0; fileID < nfiles; fileID++ )
{
......
......@@ -271,7 +271,7 @@ void *Intlevel3d(void *argument)
gridInqXvals(gridID, lonIn);
gridInqYvals(gridID, latIn);
zlevels_in = (double**) 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);
......
......@@ -155,7 +155,7 @@ static
double **createVars(int nvars, int nts)
{
double *array = (double*) malloc(nvars*nts*sizeof(double));
double **vars = (double*) malloc(nvars*sizeof(double));
double **vars = (double**) malloc(nvars*sizeof(double*));
int i;
......
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