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

ZaxisDescription: change type of string members to std::string

parent ae31b708
No related branches found
No related tags found
1 merge request!29M214003/develop
......@@ -33,9 +33,9 @@ struct ZaxisDesciption
int datatype = CDI_UNDEFID;
size_t size = 0;
bool scalar = false;
char name[CDI_MAX_NAME] = { 0 };
char longname[CDI_MAX_NAME] = { 0 };
char units[CDI_MAX_NAME] = { 0 };
std::string name;
std::string longname;
std::string units;
};
static int
......@@ -82,9 +82,9 @@ zaxisDefine(ZaxisDesciption zaxis)
if (zaxis.lbounds.size()) zaxisDefLbounds(zaxisID, zaxis.lbounds.data());
if (zaxis.ubounds.size()) zaxisDefUbounds(zaxisID, zaxis.ubounds.data());
if (zaxis.name[0]) cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_NAME, zaxis.name);
if (zaxis.longname[0]) cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_LONGNAME, zaxis.longname);
if (zaxis.units[0]) cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_UNITS, zaxis.units);
if (zaxis.name.size()) cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_NAME, zaxis.name.c_str());
if (zaxis.longname.size()) cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_LONGNAME, zaxis.longname.c_str());
if (zaxis.units.size()) cdiDefKeyString(zaxisID, CDI_GLOBAL, CDI_KEY_UNITS, zaxis.units.c_str());
if (zaxis.type == ZAXIS_HYBRID || zaxis.type == ZAXIS_HYBRID_HALF)
{
......@@ -148,9 +148,9 @@ zaxis_read_data(size_t nkv, KVMap *kvmap, ZaxisDesciption &zaxis, size_t &natts,
else if (key == "size") zaxis.size = parameter_to_int(value);
else if (key == "scalar") zaxis.scalar = parameter_to_bool(value);
else if (key == "vctsize") zaxis.vctsize = parameter_to_int(value);
else if (key == "name") strcpy(zaxis.name, parameter_to_word(value.c_str()));
else if (key == "units") strcpy(zaxis.units, parameter_to_word(value.c_str()));
else if (key == "longname") strcpy(zaxis.longname, value.c_str());
else if (key == "name") zaxis.name = parameter_to_word(value);
else if (key == "units") zaxis.units = parameter_to_word(value);
else if (key == "longname") zaxis.longname = value;
else if (key == "levels")
{
if (zaxis.size == 0) cdo_abort("size undefined (zaxis description file: %s)!", dname);
......@@ -417,7 +417,6 @@ int
zaxis_to_ltype(int zaxisID)
{
int ltype = 0;
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, &ltype);
if (ltype <= 0) ltype = ztype2ltype(zaxisInqType(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