commit 620ada5a3b9e6e69e24c34bc24d769d02b8273e2
parent 819a78f10eb24d79f8618f44f126a54be5c56986
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 8 Sep 2017 09:50:46 +0200
Fix variable name
Identifiers can't begin with an underscore prefix since it is reserved
in one way or another (C standard, POSIX, Libc, etc.). This commit
renames the __weight and __sqr_weight mc_data internal variables in
weight__ and sqr_weight__.
Diffstat:
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/ssol_estimator_c.h b/src/ssol_estimator_c.h
@@ -33,8 +33,8 @@ struct mc_data {
double tmp;
/* Internal data; use get() */
- double __weight;
- double __sqr_weight;
+ double weight__;
+ double sqr_weight__;
};
#define MC_DATA_NULL__ { SIZE_MAX, 0, 0, 0 }
static const struct mc_data MC_DATA_NULL = MC_DATA_NULL__;
@@ -65,8 +65,8 @@ static INLINE void
mc_data_flush(struct mc_data* data)
{
ASSERT(data);
- data->__weight += data->tmp;
- data->__sqr_weight += data->tmp * data->tmp;
+ data->weight__ += data->tmp;
+ data->sqr_weight__ += data->tmp * data->tmp;
data->tmp = 0;
}
@@ -88,8 +88,8 @@ mc_data_accum(struct mc_data* dst, struct mc_data* src)
ASSERT(dst && src);
mc_data_flush(dst);
mc_data_flush(src);
- dst->__weight += src->__weight;
- dst->__sqr_weight += src->__sqr_weight;
+ dst->weight__ += src->weight__;
+ dst->sqr_weight__ += src->sqr_weight__;
}
static INLINE void
@@ -97,8 +97,8 @@ mc_data_get(struct mc_data* data, double* weight, double* sqr_weight)
{
ASSERT(data && weight && sqr_weight);
mc_data_flush(data);
- *weight = data->__weight;
- *sqr_weight = data->__sqr_weight;
+ *weight = data->weight__;
+ *sqr_weight = data->sqr_weight__;
}
/*******************************************************************************
diff --git a/src/ssol_solver.c b/src/ssol_solver.c
@@ -717,7 +717,7 @@ update_mc
(pt->mc_samp, pt->inst, pt->side, &mc_samp_x_rcv1);
if(res != RES_OK) goto error;
- #define ACCUM_WEIGHT(Name, W)\
+ #define ACCUM_WEIGHT(Name, W) \
mc_data_add_weight(&mc_samp_x_rcv1->Name, irealisation, W)
ACCUM_ALL;
#undef ACCUM_WEIGHT
@@ -733,7 +733,7 @@ update_mc
res = mc_shape_1side_get_mc_primitive(mc_shape1, pt->prim.prim_id, &mc_prim1);
if(res != RES_OK) goto error;
- #define ACCUM_WEIGHT(Name, W)\
+ #define ACCUM_WEIGHT(Name, W) \
mc_data_add_weight(&mc_prim1->Name, irealisation, W)
ACCUM_ALL;
#undef ACCUM_WEIGHT