summaryrefslogtreecommitdiff
path: root/cppsetup.c
diff options
context:
space:
mode:
Diffstat (limited to 'cppsetup.c')
-rw-r--r--cppsetup.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/cppsetup.c b/cppsetup.c
index e0fe51b..3868cbe 100644
--- a/cppsetup.c
+++ b/cppsetup.c
@@ -114,19 +114,20 @@ int
cppsetup(const char *filename, const char *line,
struct filepointer *filep, struct inclist *inc)
{
- IfParser ip;
- struct _parse_data pd;
+ struct _parse_data pd = {
+ .filep = filep,
+ .inc = inc,
+ .line = line,
+ .filename = filename
+ };
+ IfParser ip = {
+ .funcs.handle_error = my_if_errors,
+ .funcs.eval_defined = my_eval_defined,
+ .funcs.eval_variable = my_eval_variable,
+ .data = &pd
+ };
long val = 0;
- pd.filep = filep;
- pd.inc = inc;
- pd.line = line;
- pd.filename = filename;
- ip.funcs.handle_error = my_if_errors;
- ip.funcs.eval_defined = my_eval_defined;
- ip.funcs.eval_variable = my_eval_variable;
- ip.data = &pd;
-
(void) ParseIfExpression(&ip, line, &val);
if (val)
return IF;