Skip to content
Snippets Groups Projects
Commit 4019a427 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

fix gcc warning

parent 42d13a2f
No related branches found
No related tags found
1 merge request!56M214003/develop
Pipeline #38946 failed
......@@ -184,18 +184,23 @@ zaxisCreate_(int zaxistype, int size, int id)
zaxisptr->type = zaxistype;
zaxisptr->size = size;
if (zaxistype >= CDI_NumZaxistype || zaxistype < 0)
Error("Internal problem! zaxistype=%d out of range (min=0/max=%d)!", zaxistype, CDI_NumZaxistype - 1);
int zaxisID = zaxisptr->self;
cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_NAME, ZaxistypeEntry[zaxistype].name);
if (zaxistype != ZAXIS_GENERIC) zaxisDefLongname(zaxisID, ZaxistypeEntry[zaxistype].longname);
cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_UNITS, ZaxistypeEntry[zaxistype].units);
const char *stdname = ZaxistypeEntry[zaxistype].stdname;
if (*stdname) cdiDefVarKeyBytes(&zaxisptr->keys, CDI_KEY_STDNAME, (const unsigned char *) stdname, (int) strlen(stdname) + 1);
if (zaxistype >= 0 && zaxistype < CDI_NumZaxistype)
{
cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_NAME, ZaxistypeEntry[zaxistype].name);
if (zaxistype != ZAXIS_GENERIC) zaxisDefLongname(zaxisID, ZaxistypeEntry[zaxistype].longname);
cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_UNITS, ZaxistypeEntry[zaxistype].units);
const char *stdname = ZaxistypeEntry[zaxistype].stdname;
if (*stdname) cdiDefVarKeyBytes(&zaxisptr->keys, CDI_KEY_STDNAME, (const unsigned char *) stdname, (int) strlen(stdname) + 1);
zaxisptr->positive = ZaxistypeEntry[zaxistype].positive;
zaxisptr->positive = ZaxistypeEntry[zaxistype].positive;
}
else
{
Error("Internal problem! zaxistype=%d out of range (min=0/max=%d)!", zaxistype, CDI_NumZaxistype - 1);
}
return zaxisID;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment