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

clang-format.

parent e18ec024
......@@ -36,7 +36,6 @@
#include "cdo_options.h"
#include "cdo_fill.h"
static void
addOperators(void)
{
......
......@@ -33,7 +33,6 @@
#include "cdo_vlist.h"
#include "param_conversion.h"
static void
fill_vars(int vlistID, std::vector<bool> &vars)
{
......
......@@ -29,7 +29,6 @@
#include "process_int.h"
#include <mpim_grid.h>
void *
Arithlat(void *process)
{
......
......@@ -23,7 +23,6 @@
#include "timer.h"
#include "util_files.h"
const char *
filetypestr(int filetype)
{
......
......@@ -25,7 +25,6 @@
#include "cdo_wtime.h"
#include "process_int.h"
void *
CDItest(void *process)
{
......@@ -40,10 +39,10 @@ CDItest(void *process)
// bool lcopy = unchangedRecord();
const auto NCOPY = cdoOperatorAdd("ncopy", 0, 0, nullptr);
(void)(NCOPY); //CDO_UNUSED
(void) (NCOPY); // CDO_UNUSED
const auto operatorID = cdoOperatorID();
(void)(operatorID); //CDO_UNUSED
(void) (operatorID); // CDO_UNUSED
// operatorInputArg("Number of copies");
if (operatorArgc() == 1) max_copy = parameter2int(cdoOperatorArgv(0));
......
......@@ -32,7 +32,6 @@
#include "cdo_cdiWrapper.h"
#include "cdi_lockedIO.h"
void
cdo_define_var_units(CmorVar &var, int vlistID2, int varID, const char *units)
{
......@@ -192,8 +191,7 @@ applyCmorList(PMList &pmlist, int nvars, int vlistID2, std::vector<CmorVar> &var
lmissval = true;
missval = parameter2double(value);
}
else if (key == "table_id" || key == "modeling_realm" || key == "realm"
|| key == "project_id" || key == "frequency")
else if (key == "table_id" || key == "modeling_realm" || key == "realm" || key == "project_id" || key == "frequency")
{
cdiDefAttTxt(vlistID2, CDI_GLOBAL, key.c_str(), (int) value.size(), value.c_str());
}
......@@ -300,7 +298,7 @@ applyCmorList(PMList &pmlist, int nvars, int vlistID2, std::vector<CmorVar> &var
{
if (Options::cdoVerbose) cdoPrint("Attribute %s:%s not supported!", varname, key.c_str());
}
// clang-format on
// clang-format on
}
if (lvalid_min && lvalid_max) var.checkvalid = true;
......@@ -336,7 +334,7 @@ CMOR_lite(void *process)
bool convert_data = false;
if (operatorArgc() == 2)
{
if ( cdoOperatorArgv(1).compare("convert") == 0)
if (cdoOperatorArgv(1).compare("convert") == 0)
convert_data = true;
else
cdoAbort("Unknown parameter: >%s<", cdoOperatorArgv(1).c_str());
......
......@@ -25,7 +25,6 @@
#include "process_int.h"
#include "pmlist.h"
static void
dump_cmor_table(const PMList &pmlist)
{
......
......@@ -31,7 +31,6 @@
#include "progress.h"
#include "cdo_options.h"
void *
Cat(void *process)
{
......
......@@ -34,13 +34,12 @@
#include "process_int.h"
#include "param_conversion.h"
static void
changeName(const int vlistID1, const int vlistID2, const int nch, std::vector<const char *> chnames)
{
char varname[CDI_MAX_NAME], varname2[CDI_MAX_NAME];
const auto npairs = nch / 2;
std::vector<std::pair<const char *,const char *>> vpairs(npairs);
std::vector<std::pair<const char *, const char *>> vpairs(npairs);
for (int i = 0; i < npairs; ++i) vpairs[i].first = chnames[i * 2];
for (int i = 0; i < npairs; ++i) vpairs[i].second = chnames[i * 2 + 1];
......
......@@ -26,7 +26,6 @@
#include "process_int.h"
#include "cdi_lockedIO.h"
void *
Change_e5slm(void *process)
{
......
......@@ -120,7 +120,7 @@ Cloudlayer(void *process)
int aclcacID = -1;
int nvars2 = 0;
int aclcac_code_found = 0;
int kmin[NVARS] = {-1, -1, -1}, kmax[NVARS] = {-1, -1, -1};
int kmin[NVARS] = { -1, -1, -1 }, kmax[NVARS] = { -1, -1, -1 };
char varname[CDI_MAX_NAME];
double sfclevel = 0;
double pmin = 0, pmax = 0;
......@@ -318,8 +318,7 @@ Cloudlayer(void *process)
for (varID = 0; varID < nvars2; ++varID)
{
if (kmax[varID] != -1 && kmin[varID] != -1)
layer_cloud(aclcac, cloud[varID], kmax[varID], kmin[varID], gridsize);
if (kmax[varID] != -1 && kmin[varID] != -1) layer_cloud(aclcac, cloud[varID], kmax[varID], kmin[varID], gridsize);
}
for (varID = 0; varID < nvars2; ++varID)
......
......@@ -27,7 +27,6 @@
#include "cdo_options.h"
#include "cdi_lockedIO.h"
static int globalGridType = CDI_UNDEFID;
struct ensfileType
......
......@@ -26,7 +26,6 @@
#include "process_int.h"
#include "counter.h"
struct vars_t
{
int param;
......@@ -136,7 +135,7 @@ com_list(const char *arg)
int
com_quit(const char *arg)
{
(void)(arg); //CDO_UNUSED
(void) (arg); // CDO_UNUSED
Done = 1;
......@@ -146,7 +145,7 @@ com_quit(const char *arg)
int
com_stat(const char *arg)
{
(void)(arg); //CDO_UNUSED
(void) (arg); // CDO_UNUSED
fprintf(stdout, "name=%s\n", all_vars[gl_varID].name);
......@@ -307,7 +306,7 @@ command_init()
gl_vlistID = streamInqVlist(gl_streamID);
int taxisID = vlistInqTaxis(gl_vlistID);
(void)(taxisID); //CDO_UNUSED
(void) (taxisID); // CDO_UNUSED
size_t gridsize = vlistGridsizeMax(gl_vlistID);
gl_data = (double *) Malloc(gridsize * sizeof(double));
......
......@@ -35,47 +35,40 @@
#include "cdo_cdiWrapper.h"
#include "cdo_fill.h"
static void
operatorIsEQ(size_t n, double mv1, double mv2, const Varray<double> &a1, const Varray<double> &a2, Varray<double> &a3)
{
for (size_t i = 0; i < n; i++)
a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : IS_EQUAL(a1[i], a2[i]));
for (size_t i = 0; i < n; i++) a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : IS_EQUAL(a1[i], a2[i]));
}
static void
operatorIsNE(size_t n, double mv1, double mv2, const Varray<double> &a1, const Varray<double> &a2, Varray<double> &a3)
{
for (size_t i = 0; i < n; i++)
a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : IS_NOT_EQUAL(a1[i], a2[i]));
for (size_t i = 0; i < n; i++) a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : IS_NOT_EQUAL(a1[i], a2[i]));
}
static void
operatorIsLE(size_t n, double mv1, double mv2, const Varray<double> &a1, const Varray<double> &a2, Varray<double> &a3)
{
for (size_t i = 0; i < n; i++)
a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : a1[i] <= a2[i]);
for (size_t i = 0; i < n; i++) a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : a1[i] <= a2[i]);
}
static void
operatorIsLT(size_t n, double mv1, double mv2, const Varray<double> &a1, const Varray<double> &a2, Varray<double> &a3)
{
for (size_t i = 0; i < n; i++)
a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : a1[i] < a2[i]);
for (size_t i = 0; i < n; i++) a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : a1[i] < a2[i]);
}
static void
operatorIsGE(size_t n, double mv1, double mv2, const Varray<double> &a1, const Varray<double> &a2, Varray<double> &a3)
{
for (size_t i = 0; i < n; i++)
a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : a1[i] >= a2[i]);
for (size_t i = 0; i < n; i++) a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : a1[i] >= a2[i]);
}
static void
operatorIsGT(size_t n, double mv1, double mv2, const Varray<double> &a1, const Varray<double> &a2, Varray<double> &a3)
{
for (size_t i = 0; i < n; i++)
a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : a1[i] > a2[i]);
for (size_t i = 0; i < n; i++) a3[i] = (DBL_IS_EQUAL(a1[i], mv1) || DBL_IS_EQUAL(a2[i], mv2) ? mv1 : a1[i] > a2[i]);
}
void *
......
......@@ -32,7 +32,6 @@
#include "cdo_vlist.h"
#include "param_conversion.h"
void *
Compc(void *process)
{
......
......@@ -19,7 +19,6 @@
#include "process_int.h"
void *
Complextorect(void *process)
{
......
......@@ -30,19 +30,16 @@
#include "cdo_vlist.h"
#include "cdo_fill.h"
static void
operatorIFTHEN(size_t n, double mv1, double mv2, const Varray<double> &a1, const Varray<double> &a2, Varray<double> &a3)
{
for (size_t i = 0; i < n; i++)
a3[i] = !DBL_IS_EQUAL(a1[i], mv1) && !DBL_IS_EQUAL(a1[i], 0.) ? a2[i] : mv2;
for (size_t i = 0; i < n; i++) a3[i] = !DBL_IS_EQUAL(a1[i], mv1) && !DBL_IS_EQUAL(a1[i], 0.) ? a2[i] : mv2;
}
static void
operatorIFNOTTHEN(size_t n, double mv1, double mv2, const Varray<double> &a1, const Varray<double> &a2, Varray<double> &a3)
{
for (size_t i = 0; i < n; i++)
a3[i] = !DBL_IS_EQUAL(a1[i], mv1) && DBL_IS_EQUAL(a1[i], 0.) ? a2[i] : mv2;
for (size_t i = 0; i < n; i++) a3[i] = !DBL_IS_EQUAL(a1[i], mv1) && DBL_IS_EQUAL(a1[i], 0.) ? a2[i] : mv2;
}
void *
......
......@@ -29,7 +29,6 @@
#include "cdo_vlist.h"
#include "cdo_fill.h"
void *
Cond2(void *process)
{
......
......@@ -28,7 +28,6 @@
#include "cdo_vlist.h"
#include "param_conversion.h"
void *
Condc(void *process)
{
......
......@@ -36,7 +36,6 @@
#include "cdo_vlist.h"
#include "param_conversion.h"
enum
{
CONSECSUM,
......
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