diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-08-04 18:59:14 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-11-09 19:19:04 +0100 |
commit | 8df3705152aa32d8551b5fb7db08e0c8e442b480 (patch) | |
tree | 60879e7d4af85d71d64885ea903ac234a09bffda /core/parse.c | |
parent | 7c9f46acd202121e67557bb634961ef17a9f6c1f (diff) | |
download | subsurface-8df3705152aa32d8551b5fb7db08e0c8e442b480.tar.gz |
Cleanup: return cylinder from cylinder_start() in parser
Most callers of this function accessed the newly generated cylinder
immediately after calling this function. Thus, for convenience,
return the added cylinder. This avoids a number of verbose expressions.
On the flip side, cylinder_start() now has to be cast to
function returning void in a the "nesting" function table.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/parse.c')
-rw-r--r-- | core/parse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/parse.c b/core/parse.c index dd8c612e8..8a07ba818 100644 --- a/core/parse.c +++ b/core/parse.c @@ -287,9 +287,10 @@ void picture_end(struct parser_state *state) state->cur_picture = NULL; } -void cylinder_start(struct parser_state *state) +cylinder_t *cylinder_start(struct parser_state *state) { add_empty_cylinder(&state->cur_dive->cylinders); + return &state->cur_dive->cylinders.cylinders[state->cur_dive->cylinders.nr - 1]; } void cylinder_end(struct parser_state *state) |