Commit 3b81805f authored by Alessandro Rubini's avatar Alessandro Rubini

trivial: turn OPTS() to a function

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 660e35a0
......@@ -256,7 +256,11 @@ struct pp_instance {
waiting_for_follow:1;
};
#define OPTS(x) ((x)->rt_opts)
/* We use data sets a lot, so have these helpers */
static inline struct pp_runtime_opts *OPTS(struct pp_instance *ppi)
{
return ppi->rt_opts;
}
#define DSDEF(x) ((x)->defaultDS)
#define DSCUR(x) ((x)->currentDS)
......
......@@ -49,9 +49,9 @@ static struct wr_data_t wr_data; /* white rabbit specific global data */
int pp_open_instance(struct pp_instance *ppi, struct pp_runtime_opts *rt_opts)
{
if (rt_opts)
OPTS(ppi) = rt_opts;
ppi->rt_opts = rt_opts;
else
OPTS(ppi) = &default_rt_opts;
ppi->rt_opts = &default_rt_opts;
ppi->ext_data = &wr_data;
......
......@@ -45,9 +45,9 @@ struct pp_runtime_opts default_rt_opts = {
int pp_open_instance(struct pp_instance *ppi, struct pp_runtime_opts *rt_opts)
{
if (rt_opts)
OPTS(ppi) = rt_opts;
ppi->rt_opts = rt_opts;
else
OPTS(ppi) = &default_rt_opts;
ppi->rt_opts = &default_rt_opts;
ppi->state = PPS_INITIALIZING;
......
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