summaryrefslogtreecommitdiff
path: root/cppsetup.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-06 18:24:08 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-01 14:34:58 -0800
commit37371f1cdcf351e29bf542e6b2fc269b29a4fba2 (patch)
treeb85b5aaa76a0ccb57a68d026272c5de9d74ee70e /cppsetup.c
parentce3d4de40fa89b2b209ab19acd763eec83bc70f1 (diff)
cppsetup: use C99 struct initialization
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
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;