Commit af73a7ff authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Set type of initialized variables to auto.

parent fed79eaf
......@@ -483,8 +483,8 @@ expr_con_var(const int init, const int oper, const nodeType *p1, const nodeType
if (!init)
{
p->param.data = (double *) Malloc(n * sizeof(double));
double *restrict odat = p->param.data;
const double *restrict idat = p2->param.data;
auto odat = p->param.data;
const auto idat = p2->param.data;
auto cval = p1->u.con.value;
if (datatype == CDI_DATATYPE_FLT32 && isCompare(oper)) cval = (float) cval;
......@@ -519,8 +519,8 @@ expr_var_con(const int init, const int oper, const nodeType *p1, const nodeType
if (!init)
{
p->param.data = (double *) Malloc(n * sizeof(double));
double *restrict odat = p->param.data;
const double *restrict idat = p1->param.data;
auto odat = p->param.data;
const auto idat = p1->param.data;
auto cval = p2->u.con.value;
if (datatype == CDI_DATATYPE_FLT32 && isCompare(oper)) cval = (float) cval;
......@@ -616,14 +616,14 @@ expr_var_var(int init, int oper, nodeType *p1, nodeType *p2)
for (size_t k = 0; k < nlev; k++)
{
size_t loff = k * ngp;
const auto loff = k * ngp;
const size_t loff1 = (nlev1 > 1) ? k * ngp1 : 0;
const size_t loff2 = (nlev2 > 1) ? k * ngp2 : 0;
const double *restrict idat1 = p1->param.data + loff1;
const double *restrict idat2 = p2->param.data + loff2;
double *restrict odat = p->param.data + loff;
const size_t nmiss = nmiss1 || nmiss2;
const auto idat1 = p1->param.data + loff1;
const auto idat2 = p2->param.data + loff2;
auto odat = p->param.data + loff;
const size_t nmiss = (nmiss1 || nmiss2);
if (ngp1 != ngp2)
{
......@@ -1657,7 +1657,7 @@ param_search_name(const int nparam, const paramType *params, const char *name)
{
int varID = -1;
// for (varID = 0; varID < nparam; --varID)
// for (varID = 0; varID < nparam; ++varID)
for (varID = nparam - 1; varID >= 0; --varID)
{
if (cdo_cmpstr(params[varID].name, name)) break;
......@@ -1706,7 +1706,7 @@ param_print(const char *vname, const paramType &param, const long tsID)
static void
add_new_constant(const char *varname, parseParamType *parse_arg, paramType *params, const paramType &param)
{
auto varID = parse_arg->nparams;
const auto varID = parse_arg->nparams;
if (varID >= parse_arg->maxparams) cdoAbort("Too many parameter (limit=%d)", parse_arg->maxparams);
param_meta_copy(params[varID], param);
......@@ -1725,7 +1725,7 @@ static void
add_new_param(const char *varname, parseParamType *parse_arg, paramType *params, const paramType &param)
{
// printf(" create %s\n", varname);
auto varID = parse_arg->nparams;
const auto varID = parse_arg->nparams;
if (varID >= parse_arg->maxparams) cdoAbort("Too many parameter (limit=%d)", parse_arg->maxparams);
param_meta_copy(params[varID], param);
......
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