diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-06 18:24:08 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-01-01 14:34:58 -0800 |
commit | 37371f1cdcf351e29bf542e6b2fc269b29a4fba2 (patch) | |
tree | b85b5aaa76a0ccb57a68d026272c5de9d74ee70e | |
parent | ce3d4de40fa89b2b209ab19acd763eec83bc70f1 (diff) |
cppsetup: use C99 struct initialization
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | cppsetup.c | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -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; |