Commit 545f131e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

zaxisDefCvals: change type of clength to int.

parent 960303d0
......@@ -1008,7 +1008,7 @@ void zaxisPrint(int zaxisID);
void zaxisDefLevels(int zaxisID, const double levels[]);
/* zaxisDefCvals: Define area types of a Z-axis */
void zaxisDefCvals(int zaxisID, const char *cvals[], size_t clength);
void zaxisDefCvals(int zaxisID, const char *cvals[], int clength);
/* zaxisInqLevels: Get all levels of a Z-axis */
int zaxisInqLevels(int zaxisID, double levels[]);
......
......@@ -1011,7 +1011,7 @@ int varDefZaxis(int vlistID, int zaxistype, int nlevels, const double *levels, c
zaxisDefUbounds(zaxisID, levels2);
}
if ( cvals != NULL && nlevels != 0 && clength != 0 ) zaxisDefCvals(zaxisID, cvals, clength);
if ( cvals != NULL && nlevels != 0 && clength != 0 ) zaxisDefCvals(zaxisID, cvals, (int)clength);
if ( (zaxistype == ZAXIS_HYBRID || zaxistype == ZAXIS_HYBRID_HALF) && vctsize > 0 )
zaxisDefVct(zaxisID, vctsize, vct);
......
......@@ -488,7 +488,7 @@ int vlist_generate_zaxis(int vlistID, int zaxistype, int nlevels, const double *
zaxisDefLevels(zaxisID, levels);
if ( zaxistype == ZAXIS_CHAR )
zaxisDefCvals(zaxisID, cvals, clen);
zaxisDefCvals(zaxisID, cvals, (int)clen);
if ( has_bounds )
{
......
......@@ -783,20 +783,20 @@ void zaxisDefLevels(int zaxisID, const double *levels)
}
void zaxisDefCvals(int zaxisID, const char **cvals, size_t clen)
void zaxisDefCvals(int zaxisID, const char **cvals, int clen)
{
zaxis_t *zaxisptr = zaxis_to_pointer(zaxisID);
size_t size = (size_t)zaxisptr->size;
int size = zaxisptr->size;
if ( cvals && clen )
{
zaxisptr->clength = clen;
zaxisptr->cvals = (char**) Malloc(size*sizeof(char *));
zaxisptr->cvals = (char**) Malloc((size_t)size*sizeof(char *));
for ( size_t ilev = 0; ilev < size; ++ilev )
for ( int ilev = 0; ilev < size; ++ilev )
{
zaxisptr->cvals[ilev] = Malloc(clen*sizeof(char));
memcpy(zaxisptr->cvals[ilev],cvals[ilev], clen*sizeof(char));
zaxisptr->cvals[ilev] = Malloc((size_t)clen*sizeof(char));
memcpy(zaxisptr->cvals[ilev],cvals[ilev], (size_t)clen*sizeof(char));
}
reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
}
......
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