Commit 3fbbfaea authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

EcaIndices: replace std::vector<char> by char array.

parent d0bb3d11
Pipeline #4900 passed with stages
in 16 minutes and 42 seconds
......@@ -469,14 +469,14 @@ void *EcaCwdi(void *process)
else if ( operatorArgc() > 0 ) argN = parameter2int(cdoOperatorArgv(0));
cdoOperatorAdd("eca_cwdi", 0, 31, nullptr);
}
std::vector<char> longname(strlen(CWDI_LONGNAME) + 80);
sprintf(longname.data(), CWDI_LONGNAME, argN, argT);
char longname[sizeof(CWDI_LONGNAME) + 80];
sprintf(longname, CWDI_LONGNAME, argN, argT);
ECA_REQUEST_2 request;
request.var1.name = CWDI_NAME;
request.var1.longname = longname.data();
request.var1.longname = longname;
request.var1.refdate = ECA_refdate;
request.var1.units = CWDI_UNITS;
request.var1.f2 = vfarcsub;
......@@ -522,15 +522,15 @@ void *EcaCwfi(void *process)
OPID_ETC = cdoOperatorAdd("etccdi_csdi", 0, 10, nullptr);
}
std::vector<char> longname(strlen(CWFI_LONGNAME) + 40);
sprintf(longname.data(), CWFI_LONGNAME, argN);
char longname[sizeof(CWFI_LONGNAME) + 40];
sprintf(longname, CWFI_LONGNAME, argN);
ECA_REQUEST_2 request;
if (OPID_ECA == cdoOperatorID())
{
request.var1.name = CWFI_NAME;
request.var1.longname = longname.data();
request.var1.longname = longname;
request.var1.units = CWFI_UNITS;
request.var1.refdate = ECA_refdate;
}
......@@ -650,13 +650,13 @@ void *EcaGsl(void *process)
if ( operatorArgc() > 1 ) argT = parameter2double(cdoOperatorArgv(1));
if ( operatorArgc() > 2 ) minLandFraction = parameter2double(cdoOperatorArgv(2));
std::vector<char> longname(strlen(GSL_LONGNAME) + 160);
sprintf(longname.data(), GSL_LONGNAME, argN, argT, argN, argT);
char longname[sizeof(GSL_LONGNAME) + 160];
sprintf(longname, GSL_LONGNAME, argN, argT, argN, argT);
ECA_REQUEST_4 request;
request.name = GSL_NAME;
request.longname = longname.data();
request.longname = longname;
request.units = GSL_UNITS;
request.name2 = GSL_NAME2;
request.longname2 = GSL_LONGNAME2;
......@@ -736,13 +736,13 @@ void *EcaHwdi(void *process)
cdoOperatorAdd("eca_hwdi", 0, 31, nullptr);
}
std::vector<char> longname(strlen(HWDI_LONGNAME) + 80);
sprintf(longname.data(), HWDI_LONGNAME, argN, argT);
char longname[sizeof(HWDI_LONGNAME) + 80];
sprintf(longname, HWDI_LONGNAME, argN, argT);
ECA_REQUEST_2 request;
request.var1.name = HWDI_NAME;
request.var1.longname = longname.data();
request.var1.longname = longname;
request.var1.refdate = ECA_refdate;
request.var1.units = HWDI_UNITS;
request.var1.f2 = vfarcadd;
......@@ -788,15 +788,15 @@ void *EcaHwfi(void *process)
OPID_ETC = cdoOperatorAdd("etccdi_wsdi", 0, 10, nullptr);
}
std::vector<char> longname(strlen(HWFI_LONGNAME) + 40);
sprintf(longname.data(), HWFI_LONGNAME, argN);
char longname[sizeof(HWFI_LONGNAME) + 40];
sprintf(longname, HWFI_LONGNAME, argN);
ECA_REQUEST_2 request;
if (OPID_ECA == cdoOperatorID())
{
request.var1.name = HWFI_NAME;
request.var1.longname = longname.data();
request.var1.longname = longname;
request.var1.refdate = ECA_refdate;
request.var1.units = HWFI_UNITS;
}
......@@ -892,15 +892,15 @@ void *EcaSu(void *process)
OPID_ECA = cdoOperatorAdd("eca_su", 0, 31, nullptr);
}
std::vector<char> longname(strlen(SU_LONGNAME) + 40);
sprintf(longname.data(), SU_LONGNAME, argT);
char longname[sizeof(SU_LONGNAME) + 40];
sprintf(longname, SU_LONGNAME, argT);
ECA_REQUEST_1 request;
if ( OPID_ECA == cdoOperatorID() )
{
request.var1.name = SU_NAME;
request.var1.longname = longname.data();
request.var1.longname = longname;
request.var1.refdate = ECA_refdate;
}
else if (OPID_ETC == cdoOperatorID())
......@@ -1703,8 +1703,8 @@ EcaRx5day(void *process)
OPID_ETC = cdoOperatorAdd("etccdi_rx5day", 0, 10, nullptr);
}
std::vector<char> longname(strlen(RX5DAY_LONGNAME2) + 40);
sprintf(longname.data(), RX5DAY_LONGNAME2, argX);
char longname[sizeof(RX5DAY_LONGNAME2) + 40];
sprintf(longname, RX5DAY_LONGNAME2, argX);
ECA_REQUEST_1 request;
......@@ -1724,7 +1724,7 @@ EcaRx5day(void *process)
}
request.var1.f2 = vfarmax;
request.var2.name = RX5DAY_NAME2;
request.var2.longname = longname.data();
request.var2.longname = longname;
request.var2.units = RX5DAY_UNITS2;
request.var2.h1 = vfarselgec;
request.var2.h1arg = argX;
......@@ -1834,13 +1834,13 @@ Strwin(void *process)
cdoOperatorAdd("strwin", 0, 31, nullptr);
}
std::vector<char> longname(strlen(STRWIN_LONGNAME) + 40);
sprintf(longname.data(), STRWIN_LONGNAME, maxWind);
char longname[sizeof(STRWIN_LONGNAME) + 40];
sprintf(longname, STRWIN_LONGNAME, maxWind);
ECA_REQUEST_1 request;
request.var1.name = STRWIN_NAME;
request.var1.longname = longname.data();
request.var1.longname = longname;
request.var1.refdate = ECA_refdate;
request.var1.units = STRWIN_UNITS;
request.var1.f1 = vfarselgec;
......
Markdown is supported
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